473,569 Members | 2,770 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Passing Data with showModalDialog

Hello,

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

var rValue="oldValu e";
rValue = showModalDialog (test.aspx?,'Na me','dialogHeig ht:400px;
dialogWidth:800 px;');
alert(rValue);
-----------------------------------------------------------
Here is the Code-Snippet from test.aspx

public partial class _Default : System.Web.UI.P age
{
protected void Page_Load(objec t sender, EventArgs e)
{
TxtPLZ.Attribut es.Add("onClick ","javascript:w indow.returnVal ue='1',window.c lose();");
}
}

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

What am I doing wrong?

cheers, andreas
Jul 11 '06 #1
4 2125
Try

TxtPLZ.Attribut es.Add("onclick ","window.retur nValue='1';wind ow.close();");

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

"Andreas Pfiz" <pf**@solid-it.dewrote in message
news:eQ******** ******@TK2MSFTN GP04.phx.gbl...
Hello,

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

var rValue="oldValu e";
rValue = showModalDialog (test.aspx?,'Na me','dialogHeig ht:400px;
dialogWidth:800 px;');
alert(rValue);
-----------------------------------------------------------
Here is the Code-Snippet from test.aspx

public partial class _Default : System.Web.UI.P age
{
protected void Page_Load(objec t sender, EventArgs e)
{

TxtPLZ.Attribut es.Add("onClick ","javascript:w indow.returnVal ue='1',window.c lose();");
}
}

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

What am I doing wrong?

cheers, andreas

Jul 11 '06 #2
Thanks a lot for your answer!

Unfortunately it is the ReturnValue is still "undefined"

"Eliyahu Goldin" <re************ *@monarchmed.co mschrieb im Newsbeitrag
news:eE******** *****@TK2MSFTNG P05.phx.gbl...
Try

TxtPLZ.Attribut es.Add("onclick ","window.retur nValue='1';wind ow.close();");

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

"Andreas Pfiz" <pf**@solid-it.dewrote in message
news:eQ******** ******@TK2MSFTN GP04.phx.gbl...
>Hello,

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

var rValue="oldValu e";
rValue = showModalDialog (test.aspx?,'Na me','dialogHeig ht:400px;
dialogWidth:80 0px;');
alert(rValue );
-----------------------------------------------------------
Here is the Code-Snippet from test.aspx

public partial class _Default : System.Web.UI.P age
{
protected void Page_Load(objec t sender, EventArgs e)
{

TxtPLZ.Attribu tes.Add("onClic k","javascript: window.returnVa lue='1',window. close();");
}
}

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

What am I doing wrong?

cheers, andreas


Jul 11 '06 #3
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" <pf**@solid-it.dewrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
Thanks a lot for your answer!

Unfortunately it is the ReturnValue is still "undefined"

"Eliyahu Goldin" <re************ *@monarchmed.co mschrieb im Newsbeitrag
news:eE******** *****@TK2MSFTNG P05.phx.gbl...
>Try

TxtPLZ.Attribu tes.Add("onclic k","window.retu rnValue='1';win dow.close();");

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

"Andreas Pfiz" <pf**@solid-it.dewrote in message
news:eQ******* *******@TK2MSFT NGP04.phx.gbl.. .
>>Hello,

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

var rValue="oldValu e";
rValue = showModalDialog (test.aspx?,'Na me','dialogHeig ht:400px;
dialogWidth:8 00px;');
alert(rValue) ;
-----------------------------------------------------------
Here is the Code-Snippet from test.aspx

public partial class _Default : System.Web.UI.P age
{
protected void Page_Load(objec t sender, EventArgs e)
{

TxtPLZ.Attrib utes.Add("onCli ck","javascript :window.returnV alue='1',window .close();");
}
}

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

What am I doing wrong?

cheers, andreas



Jul 11 '06 #4
actually there is not much more in my test-environment...m aybe a bug?

"Eliyahu Goldin" <re************ *@monarchmed.co mschrieb im Newsbeitrag
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
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" <pf**@solid-it.dewrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
>Thanks a lot for your answer!

Unfortunatel y it is the ReturnValue is still "undefined"

"Eliyahu Goldin" <re************ *@monarchmed.co mschrieb im Newsbeitrag
news:eE******* ******@TK2MSFTN GP05.phx.gbl...
>>Try

TxtPLZ.Attrib utes.Add("oncli ck","window.ret urnValue='1';wi ndow.close();") ;

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

"Andreas Pfiz" <pf**@solid-it.dewrote in message
news:eQ****** ********@TK2MSF TNGP04.phx.gbl. ..
Hello,

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

var rValue="oldValu e";
rValue = showModalDialog (test.aspx?,'Na me','dialogHeig ht:400px;
dialogWidth: 800px;');
alert(rValue );
-----------------------------------------------------------
Here is the Code-Snippet from test.aspx

public partial class _Default : System.Web.UI.P age
{
protected void Page_Load(objec t sender, EventArgs e)
{

TxtPLZ.Attri butes.Add("onCl ick","javascrip t:window.return Value='1',windo w.close();");
}
}

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

What am I doing wrong?

cheers, andreas



Jul 11 '06 #5

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

Similar topics

2
565
by: Jim M | last post by:
I hate to pass data on the query string. Is there a way to pass data to the serverside vb code using the object in showmodaldialog. var myObject = new Object(); var retVal = new Object(); myObject.calltype = "Edit" retVal = showModalDialog("Test.aspx",myObject,"dialogWidth:700px;dialogHeight:550px;s tatus:0");
1
3993
by: DavidS | last post by:
I have parent.aspx web page from which I call a modal dialog (child.aspx via showmodaldialog). I'd like to populate two text boxes, <asp:TextBox id=txt_HN> on the child form with data from the caller. for parent.aspx..... <script> block function UpdH(title,horse) { var iParms=new Object(); iParms.Name=horse; ....} for child.aspx.......
1
2359
by: Tim_k | last post by:
Hi, I'm using showModalDialog to open a Window and return a user selected variable. Here is the code: retval=window.showModalDialog(sFrameName,window,sFeatures); document.getElementById(sControlName).value=retval; This works fine but I can't figure out to pass a value into the dialogbox I'm creating. I display different data in the...
4
808
by: MW de Jager | last post by:
I want to call ShowModalDialog(...) from my C# code in the code behind page of my aspx page. I do not want to link this to a button, since I want to first do some checking myself before I call the showModalDialog. I also want to receive a result back from the ShowModalDialog when it is closed. My problems are currently these: (1) If I...
1
2159
by: Carlos Alejandro Pérez | last post by:
hi I need to perform this sequence: - a webform A calls another webform B. Webform B should be a modal one - when data is entered in webform B, the user chooses close window - the data must be captured and processed by webform A, if possible, *without* clicking on a button to force this. I know I should use IFrames. Can any1 here give me a...
7
2584
by: mark | last post by:
I have a main form, and i have another form i need to call on a button press, then id like the result of the child form to pass data back to the parent - without losing any data previously entered on the parent - is this possible ? ( my main parent window is starting to get quite cluttered) cheers mark
2
1651
by: ting ting | last post by:
I am using the ASP.net 2.0 and When I load a page, it will auto pop up the Reminder page by following showModalDialog Javascript. It worked fine for the first time, after I amended some data and saved into database. The Reminder page will be closed. However, after closing the Reminder and load the page again, it will pop up the Reminder page with...
6
2610
by: David | last post by:
Hi all, I am opening a webform with showModalDialog. This appears to pop-up fine, though I have a problem... Inside the webform is a treeview control. When the treeview is populated, I am setting the treenode navigateurl to javascript:Click('test')
0
7694
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...
0
7609
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...
0
8118
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...
1
7666
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7964
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...
0
6278
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...
0
3651
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...
0
3636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1208
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.