Pass parameters to a user control - asp.net

Posted by Cristian Boariu on Stack Overflow See other posts from Stack Overflow or by Cristian Boariu
Published on 2010-04-27T15:30:44Z Indexed on 2010/04/27 15:43 UTC
Read the original article Hit count: 220

Filed under:
|

Hi,

I have this user control:

<user:RatingStars runat="server" product="<%= getProductId() %>" category="<%= getCategoryId() %>"></user:RatingStars>

You see that i fill the product and category by calling two methods:

public string getProductId()
{
    return productId.ToString();
}

public string getCategoryId()
{
    return categoryId.ToString();
}

I do not understand why, in the user control, when i take the data received (product and category) it gives me "<%= getProductId() %>" instead of giving the id received from that method...

Any help would be kindly appreciated...

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about c#