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

Modal dialogs causes loss of Session

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 the javascript command
window.showModalDialog() we loose the current Session if a new window is
opend from within the modal one (using the window.open() method). The
"funny" thing is that this only occurs if another instance of IE has been
opend prior to the one serving the dialog.

Let me give an example:

1.
Open an instance of IE and navigate to www.google.com.

2.
Open a new instance of IE and navigate to the ASP.NET page included at the
end of this post (served through an IIS).

3.
Click the link "1. Open new modal dialog", and a modal dialog containing the
page is displayed.

4.
Click the link "2. Open new window" from the new modal dialog and a new
window
containing the page is displayed.

5.
Notice that a new session is used when displaying the last page/window.

Can anyone tell me if this is a bug, or how to work around it?

Thanks for your Time,
Ricky
--- start of ASP.NET Page ---
<%@ Page Language="C#" EnableSessionState="true" %>
<script runat="server">
void Page_Load(object sender, EventArgs e)
{
//Ensure that the Session is used
Session["SessionDate"] = DateTime.Now;

//Write the IsNewSession to output
Literal1.Text = Session.IsNewSession.ToString();
}
</script>
<html>
<head>
<title>Test page</title>
<script language="javascript">
function openWindow()
{
window.open('<%= Request.Url.ToString() %>');
}
function openDialog()
{
window.showModalDialog('<%= Request.Url.ToString() %>');
}
</script>
</head>
<body>
<form runat="server">
IsNewSession: <asp:Literal id="Literal1"
runat="server"></asp:Literal>
<br />
<a onclick="openDialog()" href="#">1. Open new modal dialog</a>
<br />
<a onclick="openWindow()" href="#">2. Open new window</a>
</form>
</body>
</html>
--- end of ASP.NET Page ---

Nov 18 '05 #1
2 4920
Hi Ricky,

As for the Session Lost problem you mentioned, based on my research, it
does be a known issue of the IE browser. When we open a window(via
window.open) from a ModalDialog page, the sessionId won't be the same as
its opener page but is the same with the page in the first instance of IE.
This is caused by the MOdelDialog has broken the SessionId's integrity.
This issue haven't been fixed yet, so currently we have to avoid open new
window from MOdalDialog page. And I'd apologize for any inconvenience it
has bring you.
Thanks.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #2
Thanks for your reply Steven.

I'm sorry to know that it is a known issue, since this really complicate
things in our application.

I guess the odds of Microsoft fixing this bug must be very small since it
appears that the IE browser is no longer a priority of Microsoft. Otherwise
they'd probably have made a new version long time ago to keep up with the
w3c standards.

Thanks for all you time,
Ricky
Nov 18 '05 #3

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

Similar topics

2
by: Bjoern Obermeyer | last post by:
Hi, I am writing an application with a JFrame as the main window and several dialogs to gain user input. The problem arises when another window (from a differnent apllication) hides my...
2
by: RobJUK66 | last post by:
have a 3rd party .Net dll that wraps a set of further unmanaged dll's. The ..Net DLL basically uses pinvoke to wrap the calls. The low level dlls provide an API to talk to a complex device which...
3
by: Andrew Baker | last post by:
OK this has me perplexed, puzzled and bamboozled! I have a remoting service which I displayed a message box in. I then wondered what would happen if a client made a call to the service while the...
2
by: cassidyc | last post by:
Hi, I was wondering if anyone has come accross this issue? And if they have any solutions I have that can create new copies of itself Form1 as = new form1(); af.show(); This form can also...
10
by: Guadala Harry | last post by:
I have a modal dialog that currently does all of the following except item 4. 1. lets users select a graphic from a list of thumbnails (and when selected, displays the full-size image in a...
1
by: wendy | last post by:
I have got a problem while using the modal dialogs. In my code I need to open a modal dialog from the parent page and I need to enter some values in the dialog and save it. It takes the values...
2
by: sthrudel | last post by:
Hi! I'm working on a web application in Asp.net and what I would like to have is a cross borwser modal dialog which accepts user's input. I would like to catch what the user clicked on the...
5
by: Laurahn | last post by:
Hi: i'm using modal window (showmodelessdialog) on asp. when the object is created i used session variables. After the object is closed the data is remaining on the modal window when is open...
1
by: Mike | last post by:
Hello, I have a Windows form that opens a modal dialog window. From there I can open yet another modal dialog window so I can grab some info to pass back to the first dialog. Both need to be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.