T
tshad
I have just installed IIS and ASP.NET running on my XP professional machine.
I am just checking to see if the setup is working and the page sort of
works, but not on the submit (post back).
When the page first displays it displays the push button correctly and
everything else is blank. Here is my code:
***************************************************
<script runat="server">
Sub Page_Load
if 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>
<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>
*********************************************************
If I change the "if Page.IsPostBack then" to "if not Page.IsPostBack then"
the page correctly displays the date and time.
But if I run it as is, there is a blank page with a submit button. If I
press the button I get the same page back - no date and time - and the lbl2
label does not display the "Hello World!".
Is it the code or is there something wrong with how I set up the XP, IIS
and/or .NET.
Thanks,
Tom.
I am just checking to see if the setup is working and the page sort of
works, but not on the submit (post back).
When the page first displays it displays the push button correctly and
everything else is blank. Here is my code:
***************************************************
<script runat="server">
Sub Page_Load
if 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>
<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>
*********************************************************
If I change the "if Page.IsPostBack then" to "if not Page.IsPostBack then"
the page correctly displays the date and time.
But if I run it as is, there is a blank page with a submit button. If I
press the button I get the same page back - no date and time - and the lbl2
label does not display the "Hello World!".
Is it the code or is there something wrong with how I set up the XP, IIS
and/or .NET.
Thanks,
Tom.