| | |
Refreshing a dropdownlist in a FormView Template
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2008
Posts: 2
Reputation:
Solved Threads: 0
I have a FormView InsertItemTemplate which has a databound dropdownlist. The dropdownlist displays a list of names retrieved through a SQL Server stored proc. The user has an option to add a new name to the database by clicking a button next to the dropdownlist. Clicking the button fires a javascript function, which opens a modal window. This "popup" window is where a new name and other pertinent data is entered. When the modal window closes the dropdownlist needs to refresh in order to display the new name (which was just entered in the modal window).
What is the best approach to refresh the dropdownlist? Where and when should a refresh occur (in what event)?
Thanks for your help!
What is the best approach to refresh the dropdownlist? Where and when should a refresh occur (in what event)?
Thanks for your help!
•
•
Join Date: Apr 2008
Posts: 115
Reputation:
Solved Threads: 6
found this:
In your modal
Then in your mainpage
its in c but it can hopefully give you a starting point on where to research!
In your modal
ASP.NET Syntax (Toggle Plain Text)
window.returnValue = "doReload"; window.close();
ASP.NET Syntax (Toggle Plain Text)
var modal = window.showModal.... if (modal == "doReload") { window.location = window.location; }
its in c but it can hopefully give you a starting point on where to research!
Please mark this post as 'Solved' if it has helped and fixed your issue.
Hi,
Where did you bind the dropdownlist it have binded the dropdownlist in page load you can use this javascript
or
You can try like this
in child page
in parent page:
Where did you bind the dropdownlist it have binded the dropdownlist in page load you can use this javascript
ASP.NET Syntax (Toggle Plain Text)
window.opener.refresh();
or
You can try like this
in child page
ASP.NET Syntax (Toggle Plain Text)
ClientScript.RegisterStartupScript(this.GetType(), "msg", "alert(' Details Added Successfully!');window.close();window.opener.__doPostBack('ChildWindowPostBack', '');", true);
in parent page:
ASP.NET Syntax (Toggle Plain Text)
this.ClientScript.GetPostBackEventReference(this, string.Empty); if (this.IsPostBack) { string eventTarget = (this.Request["__EVENTTARGET"] == null) ? string.Empty : this.Request["__EVENTTARGET"]; if (eventTarget == "ChildWindowPostBack") { //bind the dropdownlist } } }
Last edited by peter_budo; Apr 25th, 2009 at 9:41 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
If u r query is achieved,mark the thread as solved
Live and Let Live
Live and Let Live
![]() |
Other Threads in the ASP.NET Forum
- Previous Thread: Your login attempt was not successful. Please try again PROBLEM
- Next Thread: Forms Authentication
| Thread Tools | Search this Thread |
.net 2.0 3.5 activexcontrol advice ajax appliances asp asp.net beginner bottomasp.net box browser businesslogiclayer button c# c#gridviewcolumn cac checkbox child class click compatible confirmationcodegeneration content contenttype control countryselector courier css database datagrid datagridview datalist deadlock deployment development dgv dialog dropdownmenu dynamic edit embeddingactivexcontrol feedback fileuploader fill findcontrol flash flv form forms gridview gudi homeedition hosting iframe iis javascript jquery list menu mono mssql multistepregistration nameisnotdeclared novell objects order problem ratings redirect registration relationaldatabases rotatepage search security select serializesmo.table sessionvariables silverlight smartcard sql ssl tracking treeview typeof validatedate validation vb.net virtualdirectory vista visual-studio visualstudio vs2008 web webarchitecture webdevelopment wizard xml xsl





