Sign In  Sign Up Live-Chat

Modal Popup Window Problem

Last post 10-09-2005, 12:51 PM by ijoubert. 2 replies.
Sort Posts: Previous Next
  •  10-08-2005, 1:33 PM 33249

    Modal Popup Window Problem

    I am trying to use a modal/child window to present a form for editing a record. 

    Scenario:

    The parent window contains a datagrid with summary rows.  When the user selects a row, a child window presents an editable form with a save button (which also closes the child window). 

    Code Extract:

    XLib.OpenPopup(Me, "<url of child window>", 700, 700, True, "Child Window Title")

    The popup part works fine BUT, it appears that the popup window is somehow created in a separate session context, or that the session authentication information is somehow lost.

    The initial child window opens just fine and displays the content without a problem.  Whenever I do anything that triggers a postback on the child window (e.g. click a button, change a radiobutton with a server-side event handler, etc.) the application throws me back to the login page.

    It only happens with the OpenPopup method.  I changed the call to use the OpenWindow method and the problem disappeared, but so did my ability to display the window as a modal window.

    We need to display the window as a modal child and we need to have it remain under the same authenticated session.  What am I missing, or is this a bug?

     
  •  10-09-2005, 12:11 AM 33257 in reply to 33249

    Re: Modal Popup Window Problem

    Dear ijoubert ,

    Thank you for your post!

    The problem roots in a quirk of IE. While IE is processing the Form.Submit routine in modal dialog window, it'll open a new window and may create this window with another session context by default.

    To avoid this problem, you can try the directive:

    <base target="_self">

    that needs to be put in the popup page between the <HEAD> and </HEAD> tags.

    For some low version of IE doesn't support this tag, another way to prevent this problem is using frameset to wrap the popup page as below:

    1. create an intermedial page as following:

    [IntermedialPage.aspx example]

     <%@ Page language="c#" Codebehind="IntermedialPage.aspx.cs" AutoEventWireup="false" Inherits="ASPXpand.SessionDemo.IntermedialPage" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >

    <html>
      <head>
        <title>IntermedialPage</title>
        <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
        <meta name="CODE_LANGUAGE" Content="C#">
        <meta name=vs_defaultClientScript content="JavaScript">
        <meta name=vs_targetSchema content="
    http://schemas.microsoft.com/intellisense/ie5">
      </head>
    <frameset rows="0,*">
        <frame src="about:blank">
        <frame src="YourPopUp.aspx">
      </frameset>

    </html>

    2. Popup the IntermedialPage.aspx in XLib.OpenPopup routine instead of YourPopUp.aspx.

    By the way, our developers are discussing this issue for finding another more flexible solution, we'll include it into the next release if we got any.

    Thank you again for sharing your experience with Aspose's products, please feel free to let us know if you have any problem.


    Dean Deng
    Lead Developer
    Aspose Guangzhou Team
    About Us
    Contact Us
     
  •  10-09-2005, 12:51 PM 33274 in reply to 33257

    Re: Modal Popup Window Problem

    Thanks for the prompt response.  The <base....> statement solved the problem. The application is being developed for internal use and everyone is on IE6+ so old browsers won't be a problem.
     
View as RSS news feed in XML