Hello Everyone,

Page Structure
Page -> Place Holder -> web User control -> Dropdownlists

This is my Page Elements. There is click event to generate new webUserControl and place it onto PlaceHolder.
Now my Problem is that
I have three Dropdownlist inside webUserControl
and all values of dropdownlist populates from xml files.

Here is some Images to clarify my Problem
"All are inside WebUserControl which will created dynamically on the occurance of Click event"

1) suppose this is my first Drop down list

2) Now suppose I am selected "verb" option from dropdownlist1 automatically other dropdownlist2 will be visible and populates items in it according to dropdownlist1 selection

here is second pic

3) **Now main Problem starts here, **
when I am clicked on "Auxiliary" option, I am supposed to get index of Auxiliary text. It is 3. but it always returns index 0

4) and finally picture becomes like this.

this dropDownList does not hold the selected value.

Please give suggesions to resolve this problem.
Thanking you

Recommended Answers

Are you using ajax? If so, be sure to register the controls so the DOM can be updated properly.

Jump to Post

check the postsbacks with the third dropdownlist. sometimes when there is no postbacks fired, the value is not working properly

Jump to Post

All 5 Replies

Please Post Your Codes for Both User Control and codebehind...

Are you using ajax? If so, be sure to register the controls so the DOM can be updated properly.

check the postsbacks with the third dropdownlist. sometimes when there is no postbacks fired, the value is not working properly

  use this code on Page_Load

   Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then

            Dropdownlist1()
            Dropdownlist2()

            '' Fill ur Dropdownlist
        End If


    End Sub

Can you please mention your code for all the three dropdownlists?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.