| | |
How to transfer values between ASP.NET pages
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Feb 2005
Posts: 3
Reputation:
Solved Threads: 0
Hi everyone, here's my problem.
I have 3 web forms. WebForm1 contains a tab control "UltraWebTab1" with just 2 tabs.
First tab displays Target URL WebForm2.
Second tab displays Target URL WebForm3.
WebForm2 contains a label lblSourceLabel with a text value of '123'.
WebForm3 contains a label lblTargetLabel with a null value.
My goal is to transfer the lblSourceLabel value to lblTargetLabel upon tab change from tab1 to tab2. I'm using JavaScript, ASP.NET and Infragistics.
Here's my code, but it's not working. What am I doing wrong?
function sendValue()
{
// Get reference to UltraWebTab
var ultraTab = igtab_getTabById("UltraWebTab1");
if (ultraTab == null)
return;
//
// Get reference to 1st tab (WebForm2 )
var tab = ultraTab.Tabs[0];
// Get reference to 2nd tab (WebForm3)
var tab1 = ultraTab.Tabs[1];
//
var source = tab.findControl("lblSourceLabel ");
var target = tab1.findControl("lblTargetLabel");
target.value = source.value;
}
I have 3 web forms. WebForm1 contains a tab control "UltraWebTab1" with just 2 tabs.
First tab displays Target URL WebForm2.
Second tab displays Target URL WebForm3.
WebForm2 contains a label lblSourceLabel with a text value of '123'.
WebForm3 contains a label lblTargetLabel with a null value.
My goal is to transfer the lblSourceLabel value to lblTargetLabel upon tab change from tab1 to tab2. I'm using JavaScript, ASP.NET and Infragistics.
Here's my code, but it's not working. What am I doing wrong?
function sendValue()
{
// Get reference to UltraWebTab
var ultraTab = igtab_getTabById("UltraWebTab1");
if (ultraTab == null)
return;
//
// Get reference to 1st tab (WebForm2 )
var tab = ultraTab.Tabs[0];
// Get reference to 2nd tab (WebForm3)
var tab1 = ultraTab.Tabs[1];
//
var source = tab.findControl("lblSourceLabel ");
var target = tab1.findControl("lblTargetLabel");
target.value = source.value;
}
You can do it with the Session and Application objects...but it's better if you use Cookies or GET/POST methods.
Since I am not at home, but at work which has limited resources, I hope this helps till I get chance to look at this problem more closely.
Here is a some links to passing values around with Javascript that may help!
LINK 1
LINK 2

Here is a some links to passing values around with Javascript that may help!
LINK 1
LINK 2

•
•
•
•
Originally Posted by omnis
Hi everyone, here's my problem.
I have 3 web forms. WebForm1 contains a tab control "UltraWebTab1" with just 2 tabs.
First tab displays Target URL WebForm2.
Second tab displays Target URL WebForm3.
WebForm2 contains a label lblSourceLabel with a text value of '123'.
WebForm3 contains a label lblTargetLabel with a null value.
My goal is to transfer the lblSourceLabel value to lblTargetLabel upon tab change from tab1 to tab2. I'm using JavaScript, ASP.NET and Infragistics.
Here's my code, but it's not working. What am I doing wrong?
function sendValue()
{
// Get reference to UltraWebTab
var ultraTab = igtab_getTabById("UltraWebTab1");
if (ultraTab == null)
return;
//
// Get reference to 1st tab (WebForm2 )
var tab = ultraTab.Tabs[0];
// Get reference to 2nd tab (WebForm3)
var tab1 = ultraTab.Tabs[1];
//
var source = tab.findControl("lblSourceLabel ");
var target = tab1.findControl("lblTargetLabel");
target.value = source.value;
}
•
•
Join Date: Jan 2006
Posts: 275
Reputation:
Solved Threads: 11
in answer the original question your page references were incorrect. you have to get a reference to the calling page from the Server.Request object. Cast that to a Page object then findcontrol for your tabs. This is better than javascript as it is all done on the server. There are plenty of articles on how to get the calling page.
The alternative is to use session objects etc as mentioned above. The best way is to pass the information in as a query so when you redirect from one page to the other grab the labels value and pass it to the next page in the request eg www.yoursite.com/newpage?labelvalue='the value you just grabbed'
This will guarantee the value will get there (no relying on cookies being turned on etc) and easy to get at the other end
The alternative is to use session objects etc as mentioned above. The best way is to pass the information in as a query so when you redirect from one page to the other grab the labels value and pass it to the next page in the request eg www.yoursite.com/newpage?labelvalue='the value you just grabbed'
This will guarantee the value will get there (no relying on cookies being turned on etc) and easy to get at the other end
![]() |
Similar Threads
- How to Open Vidio In Asp.Net Pages (ASP.NET)
- Running ASP.NET pages on a Linux Server (ASP.NET)
- how to run asp.net pages using apache (ASP.NET)
- transfer data from an asp .net page into a javasscript script (ASP.NET)
- Javascript:How to transfer values between ASP.NET pages (JavaScript / DHTML / AJAX)
Other Threads in the ASP.NET Forum
- Previous Thread: Passing An Connecting String
- Next Thread: Get a Session state from a Query
| Thread Tools | Search this Thread |
.net 2.0 3.5 activexcontrol advice ajax appliances asp asp.net beginner bottomasp.net box browser businesslogiclayer button c# c#gridviewcolumn cac checkbox child class click compatible confirmationcodegeneration content contenttype control countryselector courier css database datagrid datagridview datalist deadlock deployment development dgv dialog dropdownmenu dynamic edit embeddingactivexcontrol feedback fileuploader fill findcontrol flash flv form forms gridview gudi homeedition hosting iframe iis javascript jquery list menu mono mssql multistepregistration nameisnotdeclared novell objects order problem ratings redirect registration relationaldatabases rotatepage search security select serializesmo.table sessionvariables silverlight smartcard sql ssl tracking treeview typeof validatedate validation vb.net virtualdirectory vista visual-studio visualstudio vs2008 web webarchitecture webdevelopment wizard xml xsl





