473,382 Members | 1,329 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

refresh parent window on close showModalDialog?

Is it possible to make the parent window refresh when a modal dialog is
closed? I know I can use

window.opener.location.reload(true);

for a 'normal' window, but this doesn't work for showModalDialog. It is
modal as far as the client is concerned but not the server...

In my app I have a datagrid on the main aspx page, I pop up a modal dialog
to edit a record. On closing the modal dialog I'd like to refresh the
datagrid with the new data.

Simon
Nov 17 '05 #1
2 16096
We use showModalDialog a lot.
As solution we put on parent web form server side button with style =
"display:none"
inside client-side function which calls to showModalDialog we "press" this
button in case showModalDialog returns true:

if(showModalDialog(...))
{
document.all("btnRefresh").click();
}

in server-side event onclcik of this button(I called it "btnRefresh") you do
what you want.(rebind etc...)
HTH

"Simon Storr" <ss****@sdasolutions.com> wrote in message
news:un**************@tk2msftngp13.phx.gbl...
Is it possible to make the parent window refresh when a modal dialog is
closed? I know I can use

window.opener.location.reload(true);

for a 'normal' window, but this doesn't work for showModalDialog. It is
modal as far as the client is concerned but not the server...

In my app I have a datagrid on the main aspx page, I pop up a modal dialog
to edit a record. On closing the modal dialog I'd like to refresh the
datagrid with the new data.

Simon

Nov 17 '05 #2
Nice solution - that will do it nicely :o)

Thanks for your help guys!

Simon

"Anatoly" <an******@gilat.com> wrote in message
news:OQ**************@TK2MSFTNGP12.phx.gbl...
We use showModalDialog a lot.
As solution we put on parent web form server side button with style =
"display:none"
inside client-side function which calls to showModalDialog we "press" this
button in case showModalDialog returns true:

if(showModalDialog(...))
{
document.all("btnRefresh").click();
}

in server-side event onclcik of this button(I called it "btnRefresh") you do what you want.(rebind etc...)
HTH

"Simon Storr" <ss****@sdasolutions.com> wrote in message
news:un**************@tk2msftngp13.phx.gbl...
Is it possible to make the parent window refresh when a modal dialog is
closed? I know I can use

window.opener.location.reload(true);

for a 'normal' window, but this doesn't work for showModalDialog. It is
modal as far as the client is concerned but not the server...

In my app I have a datagrid on the main aspx page, I pop up a modal dialog to edit a record. On closing the modal dialog I'd like to refresh the
datagrid with the new data.

Simon


Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: J P Singh | last post by:
Hi Guys Wonder if someone can help me with this. I have a form where a user clicks a button which gives them a pop up windows to allow them to add the data. The user adds the data and click...
2
by: Raj | last post by:
Hi All, I have a problem with trying to refresh the parent window from child window in order to update data in the parent window. The sequence of events are 1) I click a button in the parent...
6
by: sramruttun | last post by:
hi I open a pop up window using window.showModalDialog. How can I close the parent window after the pop up appears ?
1
by: Pravin | last post by:
Hi, I have a ASP.net webform opened. I want to open a model dialog box on the button click. When the dialog box is opened, the webform is shown blank because the post back is not complete unless...
5
by: Peter | last post by:
1) I have a C# web application and what I am trying to do is create a popup window from a link on the parent window 2) the popup window will have a button and when a user clicks on the button the...
7
by: Ben Schumacher | last post by:
How can I refresh the parent page from a popup window that was created using window.showmodaldialog? I would like to accomplish this using vbscript if possible.
3
by: Opa | last post by:
Hi , I have a form with javasript which launches a popup via the showModalDialog() method. I get the dialog to open, now I am trying to first get a reference to the calling form from the popup...
1
by: Curious Trigger | last post by:
Hi there, programming with Visual Studio 2005 and ASP.NET 2.0 I want to open a modal dialog from Default.aspx. I searched the net and many newsgroups but I couldn't find any solution. First I...
1
by: elizayiu | last post by:
Hi, I need to write a webpage which does the following: - open up a window and pass parameters into it (i.e. need to call showModalDialog() or showModelessDialog()) - contains jscript to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.