Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
|
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
 
Old December 23rd, 2003, 06:55 AM
Authorized User
 
Join Date: Nov 2003
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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>





 
Old December 23rd, 2003, 07:33 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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.
 
Old December 23rd, 2003, 07:41 AM
Authorized User
 
Join Date: Nov 2003
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Default

...Oops, sorry! For some reason I was using RegisterClientScriptBlock instead.

Everything now works fine. Thanks for your help!

Cheers,
Gary

 
Old December 23rd, 2003, 08:18 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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.
 
Old May 27th, 2007, 08:48 AM
Registered User
 
Join Date: May 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
 
Old June 19th, 2007, 02:36 AM
Authorized User
 
Join Date: Jun 2007
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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)
 
Old July 1st, 2007, 07:55 AM
Registered User
 
Join Date: May 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you!
meantime I arrange without it, but it will help me.







Similar Threads
Thread Thread Starter Forum Replies Last Post
how to return value from modal dialog ajaypsingh Javascript 2 May 16th, 2006 05:14 AM
Scrolling modal dialog to top gp_mk HTML Code Clinic 3 September 15th, 2004 07:04 AM
server control event in modal dialog diyagp General .NET 0 August 26th, 2004 02:57 AM
Modal dialog window eldanh ASP.NET 1.0 and 1.1 Basics 0 August 10th, 2004 02:07 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.