I assume that anything in script tag should run when page loads. I am including the aspx code that is working if I use a code behind file but doesn't work if I use it within script tag in and .aspx file. Thanks in advance for any responses.
void Page_Load()
{
lblServerTime.Text = DateTime.Now.ToString();
}
/* This thing works if I put it in code behind file
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
lblServerTime.Text = DateTime.Now.ToString();
}
}*/
First Page
Welcome to ASP.NET 2.0! The current date and time is:
...
Go to the complete details ...