Results 1 to 3 of 3

Thread: problems

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Connecticut
    Posts
    98
    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.

    Code:
    <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>

  2. #2
    grigp
    Guest

    Smile it works

    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 !

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Connecticut
    Posts
    98
    I reinstalled the framework on the server AGAIN and it finally started to work.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width