Click here to Skip to main content
15,900,681 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my form i have dropdown list and a "New" Button.when i click "new" button a child window will open.In child window a textbox and "Save" button.When i click save button .Add new value in sql ,refresh parent window and close the child window.
My question is how to set dropdown selected value to newly added value from child window.after closing child window.
I use following code to refresh and close child window


C#
Response.Write("<script language='javascript'> { opener.document.location.reload(true)  }</script>");
         
            Response.Write("<script language='javascript'> { self.close() }</script>");
Posted
Updated 15-Apr-12 20:27pm
v2

when you refresh parent windows, your DorpDownList reload the value from sql.
your solution should be looked in the code of aspx page

is your dropdownlist binded to a datasource?
use code like this:

HTML
SelectedValue='<%# Eval("someField") %>'
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900