Hi,
I got the following code:
<script runat="server" language="c#">
void Page_Load()
{
if (Request.Form["list1"] != "")
{
message.Text = "You have selected " + Request.Form["list1"];
}
}
</script>
<html>
<head>
<title>Drop Down List Example</title>
</head>
<body>
<asp:label id="message" runat="server"/>
<br />
<form runat="server">
Which city do you wish to look at hotels for?<br /><br />
<asp:listbox id="list1" runat="server" selectionmode="multiple">
<asp:listitem>Madrid</asp:listitem>
<asp:listitem>Oslo</asp:listitem>
<asp:listitem>Lisbon</asp:listitem>
</asp:listbox>
<br /><br /><br /><br />
<input type="Submit">
</form>
</body>
</html>
When the 1st time I run this page in IE 6.0 by entering 127.0.0.1/ch01/listpage.aspx
The message label shouldn't come out with the phrase "You have selected " since I have prevented it from appearing using the asp script with the if statement. But it still display when I 1st load the page.
Pls...................help......................!!
I got the following code:
<script runat="server" language="c#">
void Page_Load()
{
if (Request.Form["list1"] != "")
{
message.Text = "You have selected " + Request.Form["list1"];
}
}
</script>
<html>
<head>
<title>Drop Down List Example</title>
</head>
<body>
<asp:label id="message" runat="server"/>
<br />
<form runat="server">
Which city do you wish to look at hotels for?<br /><br />
<asp:listbox id="list1" runat="server" selectionmode="multiple">
<asp:listitem>Madrid</asp:listitem>
<asp:listitem>Oslo</asp:listitem>
<asp:listitem>Lisbon</asp:listitem>
</asp:listbox>
<br /><br /><br /><br />
<input type="Submit">
</form>
</body>
</html>
When the 1st time I run this page in IE 6.0 by entering 127.0.0.1/ch01/listpage.aspx
The message label shouldn't come out with the phrase "You have selected " since I have prevented it from appearing using the asp script with the if statement. But it still display when I 1st load the page.
Pls...................help......................!!