Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Professional
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional 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
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 21st, 2006, 12:51 AM
Registered User
 
Join Date: Jun 2006
Location: , , India.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to pop up a web form as a modal dialog box??

Hi,
  I've two webforms. When a condition is satisfied, I need to pop up a webform as a modal dialog box where the user can enter some text.After submitting this child form, the user had to be redirected to some other webform. Inorder to catch the text,I've used a session variable.
What I've worked is......
In html page, I've written
<script language="javascript">
function giveReason(w,h)
         {
         wleft = (screen.width-w) / 2;
         wtop = (screen.height-h) / 2;
         imgwindow1=window.open("HiReason.aspx","imgwindow1 ","width="+w+",height="+h+",left="+wleft+",top="+w top+"status:Yes;");
          imgwindow1.focus();
            }
</script>

And I've called the above script function in codebehind page as...
 jstr = "<script language='JavaScript'> giveReason(500,170);</script>"
                        Page.RegisterClientScriptBlock("reasonKey", jstr)

After that...
In child form,

Dim strjscript As String = ""
        strjscript = "<script language=javascript>"
        strjscript &= "window.opener.Home.Text1.focus();"
        strjscript &= "window.close();"
        strjscript = strjscript & "</script" & ">"
        RegisterClientScriptBlock("close", strjscript)


Home is some other webbform's id.
While running this,I'm getting the error.... "imgwindow1 is null or not an object. poop up window is blocked"

Any suggestions?? Thanks in advance....

-Priya
  #2 (permalink)  
Old June 21st, 2006, 01:30 AM
Friend of Wrox
Points: 1,935, Level: 17
Points: 1,935, Level: 17 Points: 1,935, Level: 17 Points: 1,935, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2004
Location: United Kingdom
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi

I have checked your code, and its working at my end. It seems that your code is breaking from some other point. Please let us know the exact events where you are calling these line of codes.

PS: You can also contact me on messenger if its urgent roshanmanu2001@yahoo.com


Regards
Mike
  #3 (permalink)  
Old June 27th, 2006, 07:01 AM
Authorized User
 
Join Date: Mar 2005
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi ,

I think you can use this
showModalDialog(dialog,varArgIn,varOptions).
Try this out!!!

Regards,
Pramod.

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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
Modal Dialog window Problem anandham Javascript 7 February 16th, 2005 06:08 PM
Scrolling modal dialog to top gp_mk HTML Code Clinic 3 September 15th, 2004 07:04 AM
Modal dialog window eldanh ASP.NET 1.0 and 1.1 Basics 0 August 10th, 2004 02:07 PM



All times are GMT -4. The time now is 05:56 PM.


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