Please go through this thread:
I've used this code on submit button:
If Not (Page.IsStartupScriptRegis
Dim temp As String
temp += " alert(""Successful;"");"
temp += " var newElm = document.createElement('op
temp += " newElm.text ='" + txtcompany.Text
temp += "'; newElm.value ='" + txtcompany.Text
temp += "'; parent.document.getElement
temp += " parent.document.getElement
temp += "</script>"
Now the only problem is that the data shows in the dropdown. I go to the next dropdown whose AutoPostBack is set to True. I choose an option from the dropdown. It postbacks to the server and the newly added data to the previous dropdown disappears although the value is in the database. How do I solve this? And why is this happening, when on postback it should be actually showing the new data?