ASP.NET HTML 控件 Page.IsPostBack

asp.net html 控件 page.ispostback

<script  runat="server">
sub page_load
if not page.ispostback then
   lbl1.text="the date and time is " & now()
end if
end sub

sub submit(s as object, e as eventargs)
lbl2.text="hello world!"
end sub
</script>


<!doctype html>
<html>
<body>
<form runat="server">
<h3><asp:label id="lbl1" runat="server" /></h3>
<h3><asp:label id="lbl2" runat="server" /></h3>
<asp:button text="submit" onclick="submit" runat="server" />
</form>
</body>
</html>
相关文章