MSDN help dialogArguments example desn't work

Discussion in 'ASP .Net' started by DM, Dec 14, 2003.

  1. DM

    DM Guest

    This example copied from MSDN help does not work on any of my PC's. When
    the dialog opens, itdisplays a blank page. I'm trying to create a dialog
    that calls a function in the page that opened it but am not having any luck.
    Any ideas?

    =================================================================
    The following example shows how to retrieve information passed into a modal
    dialog window using the dialogArguments property. This example consists of
    two snippets of code, which correspond to two different files. One file
    launches the modal window and the other file stores the code for the modal
    window.

    This file launches the modal window and sends an object to that modal
    window.

    Hide Example

    <HTML>
    <HEAD>
    <SCRIPT>
    function fnLaunch()
    {
    var aForm;
    aForm = oForm.elements;
    var myObject = new Object();
    myObject.firstName = aForm.oFirstName.value;
    myObject.lastName = aForm.oLastName.value;
    // The object "myObject" is sent to the modal window.
    window.showModalDialog("modalDialogSource.htm", myObject,
    "dialogHeight:300px; dialogLeft:200px;");
    }
    </SCRIPT>
    </HEAD>
    <BODY>
    <BUTTON onclick="fnLaunch();" >Launch The Window</BUTTON>
    <FORM ID= "oForm">
    First Name:
    <INPUT TYPE="text" NAME="oFirstName" VALUE="Jane">
    <BR>
    Last Name:
    <INPUT TYPE="text" NAME="oLastName" VALUE="Smith">
    </FORM>
    </BODY>
    </HTML>
    This file (modalDialogSource.htm), stores the code for the modal window. The
    object sent to this modal window is retrieved using the dialogArguments
    property.

    Hide Example

    <HTML>
    <HEAD>
    <SCRIPT>
    var oMyObject = window.dialogArguments;
    var sFirstName = oMyObject.firstName;
    var sLastName = oMyObject.lastName;
    </SCRIPT>
    <title>Untitled</title>
    </head>
    <BODY STYLE="font-family: arial; font-size: 14pt; color: Snow;
    background-color: RosyBrown;">

    First Name:
    <SPAN STYLE="color:00ff7f">
    <SCRIPT>
    document.write(sFirstName);
    </SCRIPT>
    </SPAN>
    <BR>
    Last Name:
    <SPAN STYLE="color:00ff7f">
    <SCRIPT>
    document.write(sLastName);
    </SCRIPT>
    </SPAN>
    </BODY>
    </HTML>
     
    DM, Dec 14, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rogers
    Replies:
    1
    Views:
    373
    Vadivel Kumar
    Jan 18, 2005
  2. =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?=

    window.dialogArguments in .net - order of page load

    =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?=, Mar 8, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    4,233
    Eliyahu Goldin
    Mar 8, 2005
  3. =?Utf-8?B?Tml5YXpp?=

    ASP.NET web.config MSDN Example

    =?Utf-8?B?Tml5YXpp?=, Dec 6, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    5,039
    =?Utf-8?B?Tml5YXpp?=
    Dec 7, 2005
  4. gerry
    Replies:
    1
    Views:
    1,270
    gerry
    Dec 31, 2005
  5. yoramo
    Replies:
    2
    Views:
    129
    yoramo
    Jan 6, 2005
Loading...

Share This Page