Author: steven1979 | Posted on: 3/14/2010 2:36:09 PM | Views : 424

Hi 
I want to reference a variable inside an html element without having to use an asp lable. for example at the start of the page I grab the current year and then inside a paragraph html tag I want to output this. I have tried using <%# year%> and <%=year%> but I get an error. Here is the code
void Page_Load(Object sender , EventArgs e)
{
  
 int year;
 year = DateTime.Now.Year;
 

}
.....
 
<p> This current year is <%=year%>  <p>
 
Please can somebody point out where I am going wrong?
 
...

Go to the complete details ...