PDA

Click to See Complete Forum and Search --> : problems


Piz Bruin
Apr 2nd, 2001, 01:46 PM
I copied a piece of code from the aspng/quickstart website & can't get it to work.

The code is ridiculously simple but the problem lies elsewhere, but I'm not sure where.

I am running VS.Net Beta1. The server is Win2K Advanced Server, IE6 installed, MDAC 2.6, and the framework is installed.

I add a new web form to my project and paste in the code (to load a dropdownlist), but the list does not get loaded.

Anyone have any idea what the problem is? I reinstalled MDAC & the framework but that was no help.


<html>
<head>

<script language="VB" runat="server">

Sub Page_Load(sender As Object, e As EventArgs)
If Not IsPostBack Then

Dim values as ArrayList= new ArrayList()

values.Add ("IN")
values.Add ("KS")
values.Add ("MD")
values.Add ("MI")
values.Add ("OR")
values.Add ("TN")

DropDown1.DataSource = values
DropDown1.DataBind
End If
End Sub

Sub SubmitBtn_Click(sender As Object, E As EventArgs)
Label1.Text = "You chose: " + DropDown1.SelectedItem.Text
End Sub

</script>

</head>
<body>

<h3><font face="Verdana">DataBinding DropDownList</font></h3>

<form runat=server>

<asp:dropDownList id="DropDown1" runat="server" />

<asp:button Text="Submit" OnClick="SubmitBtn_Click" runat=server/>

<p>

<asp:Label id=Label1 font-name="Verdana" font-size="10pt" runat="server" />

</form>

</body>
</html>

grigp
Apr 11th, 2001, 06:17 AM
I just tested your sample on my computer.
It works as it is. (of course I put it in \inetpub\wwwroot\SameFolder) and the extension is aspx.

Good luck !

Piz Bruin
Apr 13th, 2001, 11:02 AM
I reinstalled the framework on the server AGAIN and it finally started to work.