Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2745
Set Initial Value of WebDropDown
posted

Ciao!

I have a page with three dropdown boxes, we can call them dropdown1, dropdown2 and dropdown3. When the value in dropdown1 is changed, the value in dropdown2 should change and son on with dropdown3. Using the valuechanged server event this works fine, when changes are made on the client side.

Now i want to set the initial value of dropdown1 (selected value) and I cant get that to work. The first dropdown contains available languages and I want to set this according to the language used in the current browser. I have the language to use, but i don't know how and where to set this initial value.

i tried to set the value in the dropdown1's DataBound event but when I do that it doesn't fire any other event in the hierarchy, like dropdown1_ValueChanged.  i suppose that that event only fires when something is happening on the client side...

what is the best solution for setting the initial value in my case?

thanks for helping out!

/Henrik