Passing Data with showModalDialog

A

Andreas Pfiz

Hello,

I have a problem with passing Data between a "classic ASP-Page (VBScript)"
and a ASP.NET 2.0 Page using showModalDialog / window.returnValue
-------------------------------------------------------------
Here is the Code-Snippet from the "caller" page:

var rValue="oldValue";
rValue = showModalDialog(test.aspx?,'Name','dialogHeight:400px;
dialogWidth:800px;');
alert(rValue);
-----------------------------------------------------------
Here is the Code-Snippet from test.aspx

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
TxtPLZ.Attributes.Add("onClick","javascript:window.returnValue='1',window.close();");
}
}

Clicking on the TxtLabel closes the window, but alert(rValue); shows alway
"undefined"

What am I doing wrong?

cheers, andreas
 
A

Andreas Pfiz

Thanks a lot for your answer!

Unfortunately it is the ReturnValue is still "undefined"

Eliyahu Goldin said:
Try

TxtPLZ.Attributes.Add("onclick","window.returnValue='1';window.close();");

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

Andreas Pfiz said:
Hello,

I have a problem with passing Data between a "classic ASP-Page
(VBScript)" and a ASP.NET 2.0 Page using showModalDialog /
window.returnValue
-------------------------------------------------------------
Here is the Code-Snippet from the "caller" page:

var rValue="oldValue";
rValue = showModalDialog(test.aspx?,'Name','dialogHeight:400px;
dialogWidth:800px;');
alert(rValue);
-----------------------------------------------------------
Here is the Code-Snippet from test.aspx

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

TxtPLZ.Attributes.Add("onClick","javascript:window.returnValue='1',window.close();");
}
}

Clicking on the TxtLabel closes the window, but alert(rValue); shows
alway "undefined"

What am I doing wrong?

cheers, andreas
 
E

Eliyahu Goldin

Try

TxtPLZ.Attributes.Add("onclick","window.returnValue='1';window.close();");
 
E

Eliyahu Goldin

What you show here should work. Check other places in the code that can
affect returnValue.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

Andreas Pfiz said:
Thanks a lot for your answer!

Unfortunately it is the ReturnValue is still "undefined"

Eliyahu Goldin said:
Try

TxtPLZ.Attributes.Add("onclick","window.returnValue='1';window.close();");

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

Andreas Pfiz said:
Hello,

I have a problem with passing Data between a "classic ASP-Page
(VBScript)" and a ASP.NET 2.0 Page using showModalDialog /
window.returnValue
-------------------------------------------------------------
Here is the Code-Snippet from the "caller" page:

var rValue="oldValue";
rValue = showModalDialog(test.aspx?,'Name','dialogHeight:400px;
dialogWidth:800px;');
alert(rValue);
-----------------------------------------------------------
Here is the Code-Snippet from test.aspx

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

TxtPLZ.Attributes.Add("onClick","javascript:window.returnValue='1',window.close();");
}
}

Clicking on the TxtLabel closes the window, but alert(rValue); shows
alway "undefined"

What am I doing wrong?

cheers, andreas
 
A

Andreas Pfiz

actually there is not much more in my test-environment...maybe a bug?

Eliyahu Goldin said:
What you show here should work. Check other places in the code that can
affect returnValue.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

Andreas Pfiz said:
Thanks a lot for your answer!

Unfortunately it is the ReturnValue is still "undefined"

Eliyahu Goldin said:
Try

TxtPLZ.Attributes.Add("onclick","window.returnValue='1';window.close();");

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

Hello,

I have a problem with passing Data between a "classic ASP-Page
(VBScript)" and a ASP.NET 2.0 Page using showModalDialog /
window.returnValue
-------------------------------------------------------------
Here is the Code-Snippet from the "caller" page:

var rValue="oldValue";
rValue = showModalDialog(test.aspx?,'Name','dialogHeight:400px;
dialogWidth:800px;');
alert(rValue);
-----------------------------------------------------------
Here is the Code-Snippet from test.aspx

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

TxtPLZ.Attributes.Add("onClick","javascript:window.returnValue='1',window.close();");
}
}

Clicking on the TxtLabel closes the window, but alert(rValue); shows
alway "undefined"

What am I doing wrong?

cheers, andreas
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,782
Latest member
ThomasGex

Latest Threads

Top