Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I'm using dropdownlists for the user to select an item which is then saved into the database. I'm sure this WAS working when i originally tested it, now i've come back to it (was using the frame to set up test data for a later frame) and its not working. (It just selects the first item).

 

I've even tried the below, which isnt working either.

 

   Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
       Label11.Text = ddownRoles.SelectedIndex.ToString 
       'also tried selectedvalue, which as i'm sure you know displays the samething
   End Sub

 

I'm using .Net 2005, i've checked that the 'EnableViewState' is set to true. I'm guessing this has something to do with the button doing a postback. After the label has been changed (to show the first item, not the selected one), the dropdownlist shows the first item again.

 

Does anybody know what i've done to display the viewstate memory?

 

Thanks.

Posted

I'm calling the procedure to populate the in the page_load, but its wrapped in a "if not ispostback".

 

I think i've solved it by setting the dropdownlists to autopostback, but i'm not sure if thats the 'best' way to do this.

 

Thanks for the reply though :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...