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.
<script runat="server">
void Page_Load()
{
lblServerTime.Text = DateTime.Now.ToString();
}
</script>
/* 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();
}
}*/
<head runat="server">
<title>First Page</title>
</head>
<body>
<form id="form1" runat="server" method="post">
<div>
Welcome to ASP.NET 2.0! The current date and time is:
<asp:Label
id="lblServerTime"
Runat="server"/>
</div>
</form>
</body>
</html>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web
Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://cm.megasolutions.net/forums/default.aspx
-~----------~----~----~----~------~----~------~--~---