473,383 Members | 1,762 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,383 software developers and data experts.

How to close modal dialog from ASP.NET page

1)There is a simple AS.NET page with only ONE button - "Ok"

2) There is a html page where i call the ASP.NET page described above
and run it in new instance of IE using window.showModalDialog(...)

3) How to close this ModalDialog when user press button OK on the ASP.NET
page

Please, provide sample code
Thanks
Nov 18 '05 #1
3 5558
You need client side javascript: window.close()

"pTsy" <pt******@bna.com> wrote in message
news:e0**************@TK2MSFTNGP15.phx.gbl...
1)There is a simple AS.NET page with only ONE button - "Ok"

2) There is a html page where i call the ASP.NET page described above
and run it in new instance of IE using window.showModalDialog(...)

3) How to close this ModalDialog when user press button OK on the ASP.NET
page

Please, provide sample code
Thanks

Nov 18 '05 #2
Would you provide sample code for
client side and server please
Thanks
Paul
"Marina" <so*****@nospam.com> wrote in message
news:ek*************@tk2msftngp13.phx.gbl...
You need client side javascript: window.close()

"pTsy" <pt******@bna.com> wrote in message
news:e0**************@TK2MSFTNGP15.phx.gbl...
1)There is a simple AS.NET page with only ONE button - "Ok"

2) There is a html page where i call the ASP.NET page described above
and run it in new instance of IE using window.showModalDialog(...)

3) How to close this ModalDialog when user press button OK on the ASP.NET page

Please, provide sample code
Thanks


Nov 18 '05 #3
Hi,

You can either do this:

btnOK.Attributes.Add("onclick", "window.close(); return false;")

Or, if you need to post back to the Modal page before closing it you can do
this:

Response.Write("<script language='javascript'>window.close();</script>")

Remember, when you post back to a Modal page you must put: <BASE
target="_self"> in the <head> section of the HTML on that page. Good luck!
Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight

"pTsy" <pt******@bna.com> wrote in message
news:e0**************@TK2MSFTNGP15.phx.gbl...
1)There is a simple AS.NET page with only ONE button - "Ok"

2) There is a html page where i call the ASP.NET page described above
and run it in new instance of IE using window.showModalDialog(...)

3) How to close this ModalDialog when user press button OK on the ASP.NET
page

Please, provide sample code
Thanks

Nov 18 '05 #4

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

Similar topics

2
by: Simon Storr | last post by:
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...
2
by: Ricky K. Rasmussen | last post by:
Hi NG, We have a rather large ASP.NET application that uses popups to display various dialogs to the user. In our work we've come over a rather annoying "bug": If we open a modal dialog using...
2
by: Guadala Harry | last post by:
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...
8
by: william | last post by:
Hi All, I have a question about closing a dialog box. The thing is: I have two ASP.NET pages. From one page, I open another page as window.showModalDialog. THere is a button on the second page. On...
2
by: anil kumar via .NET 247 | last post by:
(Type your message here) hi, i am using save & cancel webform button my webpage to with somevalidations , when i am trying to save my content it is savedthat time i need a popup msg like ur 'data...
2
by: Jacky Chau | last post by:
I have a modal dialog opened using window.showModalDialog. When that modal dialog closes, it causes the parent form to postback. Is there any way to stop it from forcing the parent page to...
2
by: Samy | last post by:
Hi There, I have a user control with buttons on it which I use on a aspx page (parent page). On a button click, a modal dialog(aspx page) opens up and the user enters some info in the modal dialog...
1
by: dan.c.roth | last post by:
oForm.Close() vs this.Close() in a modal dialog. oFrom.Close() calls Form.Dispose() but this.Close() ,say in the click event of the Form, does not. I can think of the reason for this but is...
11
by: VK | last post by:
In the continuation of the discussion at "Making Site Opaque -- This Strategy Feasible?" and my comment at http://groups.google.com/group/comp.lang.javascript/msg/b515a4408680e8e2 I have...
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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: 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.