By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,993 Members | 1,883 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,993 IT Pros & Developers. It's quick & easy.

RegisterStartupScript Fails in Modal Dialog

P: n/a
I have a frameset aspx page that enables users to upload photos. One
frame/page shows a thumbnail list of prevously-uploaded images, and the
other frame/page includes the controls that enable selecting and uploading
additional photos. After uploading a file, the list of thumbnail images
needs to get refreshed to show the newly uploaded picture. This is
accomplished by using the following code:

string scriptString = "<script
language=JavaScript>parent.thumbFrame.location.rel oad(true)</script>";
if(!this.IsClientScriptBlockRegistered("clientScri pt")){
this.RegisterStartupScript("clientScript", scriptString);

This setup works great - but only as long as the frameset is opened by
itself (i.e., not as a modal dialog). When the frameset is opened as a modal
dialog (from client-side JavaScript using window.showModalDialog()), the
page in thumbFrame does not reload. It is as if the JavaScript registered
through RegisterStartupScript is not executed on the client.

How can I get the thumbFrame to reload when the frameset has been opened as
a modal dialog?

Thanks!

Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Guadala Harry wrote:
I have a frameset aspx page that enables users to upload photos. One
frame/page shows a thumbnail list of prevously-uploaded images, and the
other frame/page includes the controls that enable selecting and uploading
additional photos. After uploading a file, the list of thumbnail images
needs to get refreshed to show the newly uploaded picture. This is
accomplished by using the following code:

string scriptString = "<script
language=JavaScript>parent.thumbFrame.location.rel oad(true)</script>";
if(!this.IsClientScriptBlockRegistered("clientScri pt")){
this.RegisterStartupScript("clientScript", scriptString);

This setup works great - but only as long as the frameset is opened by
itself (i.e., not as a modal dialog). When the frameset is opened as a modal
dialog (from client-side JavaScript using window.showModalDialog()), the
page in thumbFrame does not reload. It is as if the JavaScript registered
through RegisterStartupScript is not executed on the client.

How can I get the thumbFrame to reload when the frameset has been opened as
a modal dialog?

Thanks!


I don't know the technical reason this occurs, but I've overcome it by
having the modal dialog consist of only an IFRAME, which then contains
the real aspx page.
Nov 18 '05 #2

P: n/a
I will be happy to use an IFrame if that is necessary. AS a followup
question: I thought I read somewhere that IFrames were being "phased out".
Is there anything to that - or was that just someone's biased *opinion*
against IFrames?

-G

"John Hann" <jovinhan@SPAM_FREEyahoo.com> wrote in message
news:uH**************@TK2MSFTNGP10.phx.gbl...
Guadala Harry wrote:
I have a frameset aspx page that enables users to upload photos. One
frame/page shows a thumbnail list of prevously-uploaded images, and the
other frame/page includes the controls that enable selecting and uploading additional photos. After uploading a file, the list of thumbnail images
needs to get refreshed to show the newly uploaded picture. This is
accomplished by using the following code:

string scriptString = "<script
language=JavaScript>parent.thumbFrame.location.rel oad(true)</script>";
if(!this.IsClientScriptBlockRegistered("clientScri pt")){
this.RegisterStartupScript("clientScript", scriptString);

This setup works great - but only as long as the frameset is opened by
itself (i.e., not as a modal dialog). When the frameset is opened as a modal dialog (from client-side JavaScript using window.showModalDialog()), the
page in thumbFrame does not reload. It is as if the JavaScript registered through RegisterStartupScript is not executed on the client.

How can I get the thumbFrame to reload when the frameset has been opened as a modal dialog?

Thanks!


I don't know the technical reason this occurs, but I've overcome it by
having the modal dialog consist of only an IFRAME, which then contains
the real aspx page.

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.