| | |
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 |
Tag cloud for ASP.NET
.net 2.0 activexcontrol advice ajax alltypeofvideos anathor application asp asp.net bc30451 bottomasp.net browser button c# c#gridviewcolumn checkbox click commonfunctions confirmationcodegeneration courier css dataaccesslayer database datagridview datagridviewcheckbox datalist deadlock development dgv dropdownlist dynamically edit expose feedback fill flash form formatdecimal forms formview google grid gridview homeedition hosting iframe iis javascript jquery list listbox login microsoft mono mouse mssql multistepregistration news numerical objects opera panelmasterpagebuttoncontrols parent project radio registration reportemail richtextbox rotatepage save schoolproject search security silverlight smartcard smoobjects software sql-server sqlserver2005 suse textbox tracking unauthorized validation vb.net video videos view virtualdirectory vista visualstudio web webapplications webdevelopemnt webprogramming webservice xml xsl youareanotmemberofthedebuggerusers





