 |
| HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

December 23rd, 2003, 06:55 AM
|
|
Authorized User
|
|
Join Date: Nov 2003
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
It appears just below the <form> tag :-
<body ....>
<form .....>
<script language=JavaScript>window.showModalDialog ('frmSubject.aspx', null, 'dialogHeight:350px;dialogWidth:700px;center:yes;h elp:no;scroll:no;status:no')</script>
|
|

December 23rd, 2003, 07:33 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Right, I thought so.
From what I can see, the dialog *is* blocking the rendering of the parent page. As soon as the browser sees your dialog instruction, it opens a new window, and waits with downloading / rendering the parent page until you close the dialog.
Apparently, you're not using the RegisterStartUpScript, are you??
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

December 23rd, 2003, 07:41 AM
|
|
Authorized User
|
|
Join Date: Nov 2003
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
...Oops, sorry! For some reason I was using RegisterClientScriptBlock instead.
Everything now works fine. Thanks for your help!
Cheers,
Gary
|
|

December 23rd, 2003, 08:18 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Great. Glad it worked out.
RegisterClientScriptBlock will dump the JavaScript somewhere on the page (depending on when and how you access it).
RegisterStartUpScript, as it name implies, sends a block of code that will execute on the client "startup" of the page. IMO. ASP.NET does this a little dirty by placing the code at the end of the page, before the closing </form> tag, but works as expected, as you found out.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

May 27th, 2007, 08:48 AM
|
|
Registered User
|
|
Join Date: May 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi,
I am new here.
I just want to ask how can I get the answer from a Modal Dialog which has Yes/No buttons, when I call it using:
Response.Write("<script>window.showModalDialog('fr mSubject.aspx', null,'dialogHeight:350px;dialogWidth:700px;center: yes;help:no;scroll:no;status:no');</script>");
Thanks,
Moria
|
|

June 19th, 2007, 02:36 AM
|
|
Authorized User
|
|
Join Date: Jun 2007
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Dear moriayi
window object has a property named 'returnValue'. You can set this property in your popup window (like window.returnValue = 'Yes') and use it in your parent window (as return value of 'showModalDialog' method)
|
|

July 1st, 2007, 07:55 AM
|
|
Registered User
|
|
Join Date: May 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thank you!
meantime I arrange without it, but it will help me.
|
|
 |