<% lbl1.Text="The date and time is " + DateTime.Now; %>
<html><body>
<form runat="server">
<h3><asp:label id="lbl1" runat="server" /></h3>
</form>
</body></html>
|
Page_Load event is one of many events that ASP.NET understands.
The Page_Load event is triggered when a page loads, and ASP.NET will automatically call the subroutine Page_Load, and execute the code inside it.
The property DateTime.Now returns the current date and time according to the setting of your computer’s system date and time.
|
demo_pageload.aspx |
Web |
|
|---|---|---|
|