Very simple and stupid question.
i have a page class
public partial class ProtectWayItem : System.Web.UI.UserControl
{
public int Count {
You have to use = instead #
And if you want to call with the # sign then you need to call a DataBind() method..
protected void Page_PreRenderComplete(object sender, EventArgs e)
{
DataBind();
}
here is what each expression means
- The <%= expressions are evaluated at
render time
- The <%# expressions are evaluated at
DataBind() time and are not evaluated
at all if DataBind() is not called.
- <%# expressions can be used as
properties in server-side controls.
<%= expressions cannot.
For a better understanding, please check out this link: The difference between <%= and <%# in ASP.NET