473,790 Members | 2,481 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

window.showModa lDialog and ASP.NET

I'm not quite sure if the problem I'm having is a restriction of
showModalDialog or if there is a way around it.

The web app I am working requires the user to select a record from a list.
I pop this list (generated by a second page) in a second window. When the
user selects a record on the datagrid, I close the second window and submit
the calling page.

If I try to use showModalDialog , the dialog pops up just fine and everything
is rendered correctly. However, as soon as the page posts back a new browser
window is opened with what appears to be the response for the post back.

Is there a way around this behavior?
Nov 18 '05 #1
3 7229
This is done by design. Soon you gonna discover that JScript window.history
doesn't exist in modal dialog, too :)
The only way around this prob is to place iFrame inside of a simple static
html page and make the source of that iframe your aspx page. Then it'll post
correctly.

For example:

Simple HTML page - /SIMPLE_HTML_PAG E.html:

<html>
<head>
<script language="javas cript">
function InitFrame(){doc ument.all.frCon tainer.src =
window.dialogAr guments;}
</script>
</head>
<body onload="InitFra me();">
<iframe id="frContainer " frameborder="0" height="100%"
width="100%"></iframe>
</body>
</html>
JScript function (simplified) on your "base" page which has "onclick" to
open modal dialog:

function openDamnDialog( url)
{
var returnedValue =
window.showModa lDialog("/SIMPLE_HTML_PAG E.html","/URL_OF_ASPX_PAG E_THAT_NEEDS_TO _USE_DIALOG.asp x","help:no;dia logWidth:500px; dialogHeight:40 0px;resizable:y es;status:no;sc roll:no;"));
if(returnedValu e)
{
doSomethig();
//Submit the page if you want
formBlah.submit ();
}
}
Call this JScript method from your "base" page. Implement some JScript
return value on your aspx list, if you need to. Basically, there is nothing
difficult about this.

Regards,
Kikoz

"Paul K" <Pa***@discussi ons.microsoft.c om> wrote in message
news:E2******** *************** ***********@mic rosoft.com...
I'm not quite sure if the problem I'm having is a restriction of
showModalDialog or if there is a way around it.

The web app I am working requires the user to select a record from a list.
I pop this list (generated by a second page) in a second window. When the
user selects a record on the datagrid, I close the second window and
submit
the calling page.

If I try to use showModalDialog , the dialog pops up just fine and
everything
is rendered correctly. However, as soon as the page posts back a new
browser
window is opened with what appears to be the response for the post back.

Is there a way around this behavior?

Nov 18 '05 #2
Put

<base target="_self">

in the <head> section

Eliyahu

"Paul K" <Pa***@discussi ons.microsoft.c om> wrote in message
news:E2******** *************** ***********@mic rosoft.com...
I'm not quite sure if the problem I'm having is a restriction of
showModalDialog or if there is a way around it.

The web app I am working requires the user to select a record from a list.
I pop this list (generated by a second page) in a second window. When the
user selects a record on the datagrid, I close the second window and submit the calling page.

If I try to use showModalDialog , the dialog pops up just fine and everything is rendered correctly. However, as soon as the page posts back a new browser window is opened with what appears to be the response for the post back.

Is there a way around this behavior?

Nov 18 '05 #3
Toda raba!
Nov 18 '05 #4

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

Similar topics

1
4157
by: Gilles T. | last post by:
Hi! I have a popup window open with the showModalDialog function: window.showModalDialog('dialog.aspx',window,"status:no; resizable:yes; dialogWidth:900px; dialogHeight: 700px;"); and in dialog.aspx, I need to print the page with javascript function window.print but this function don't work with the showModalDialog window. Why?
2
16148
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 showModalDialog. It is modal as far as the client is concerned but not the server... In my app I have a datagrid on the main aspx page, I pop up a modal dialog to edit a record. On closing the modal dialog I'd like to refresh the
6
5409
by: Scott Lee | last post by:
I am displaying an ASP.Net generated form in a popup opened with window.showModalDialog. The form contains DropDownList controls. The first ddl is populated via databinding to a datatable, has its AutoPostBack set to true and has its SelectedIndexChanged event being handled in codebehind. The event fires as it should populating two more ddls. The problem is, the two ddls appear empty. I have used a javascript alert to look at the...
1
3578
by: John | last post by:
Hi, I'm having a problem opening / downloading csv files when called from a page opened with window.showModalDialog( ). To isolate this problem, I've written 3 files (see below). 1. main.htm allows the user to open the page containing the link in a regular window or one opened via window.showModalDialog( ) 2. modal.htm provides a link to the aspx which generates the csv 3. csv.aspx generates a csv file
2
4397
by: John | last post by:
Hi, I posted this earlier in microsoft.public.dotnet.framework.aspnet, but didn't get a response, so I thought I'd try here. Basically, I'm having a problem opening / downloading csv files when generated from within a page opened with window.showModalDialog( ) ( IE6 ). To isolate this problem, I've written 3 files (see below). 1. main.htm allows the user to open the page containing the link in a
9
4657
by: Stan B | last post by:
I create a popup window by calling window.showModalDialog Popup window has Ok button with this code attached: === string Script = "<script language=JavaScript>" + "{" + "window.close();" + "}" + "</script>";
1
2720
by: elizayiu | last post by:
Hi, I need to write a webpage which does the following: - open up a window and pass parameters into it (i.e. need to call showModalDialog() or showModelessDialog()) - contains jscript to support drag and drop objects from itself to the popup window - wait for user response in popup window and return results back to the parent window (i.e. calling showModalDialog() is preferred)
4
4576
by: =?Utf-8?B?Sm9hbyBSZWdv?= | last post by:
Hello, Using asp.net 2.0, C# and IE7 I'm using window.showModalDialog to open a modal window on the client from Javascript. I have to include this line in the < HEAD html of the modal window: <base target=_selfbecause whenever that page posted back, it would spawn off a new window!! This is the beaviour in IE7.
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9512
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10413
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10200
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9986
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9021
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7530
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5422
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3707
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.