Very simple and stupid question.
i have a page class
public partial class ProtectWayItem : System.Web.UI.UserControl
{
public int Count { get; set; }
protected void Page_Load(object sender, EventArgs e)
{
Count = 10;
}
}
and how i can set div id equal Count.
I mean something like:
<div id='<%# Count %>' > </div>
You have to use
= instead #And if you want to call with the
# signthen you need to call a DataBind() method..here is what each expression means
render time
DataBind() time and are not evaluated
at all if DataBind() is not called.
properties in server-side controls.
<%= expressions cannot.
For a better understanding, please check out this link: The difference between <%= and <%# in ASP.NET