473,230 Members | 1,414 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,230 software developers and data experts.

transfering variables with CONTEXT

I'm using context to transfer variables from 1 page to another.
But, with more than 2 pages it fails.

Ex:
page1.aspx:
Context.Items.Add("customername", customername.text)
Server.Transfer("page2.aspx")

page2.aspx:
response.write(Context.Items("customername")) => returns the customername
of page1
Context.Items.Add("test", Context.Items("customername"))
Server.Transfer("page3.aspx")

page3.aspx:
response.write(Context.Items("test")) => returns nothing, how comes??
THX for help.
Nov 19 '05 #1
4 2090
You have to again add to the Context.

Context is limited to one page.
--
Cheers,
Gaurav Vaish
http://mastergaurav.org
http://mastergaurav.blogspot.com
---------------------

Nov 19 '05 #2
that's what I did.
I just gave it another name.

on page1:
Context.Items.Add("customername", customername.text)

on page2:
Context.Items.Add("test", Context.Items("customername"))

on page3:
response.write(Context.Items("test"))

THX
"MasterGaurav" <ga**********@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
You have to again add to the Context.

Context is limited to one page.
--
Cheers,
Gaurav Vaish
http://mastergaurav.org
http://mastergaurav.blogspot.com
---------------------

Nov 19 '05 #3
here

page1.aspx:
Context.Items.Add("customername", customername.text)
Server.Transfer("page2.aspx")

page2.aspx:
response.write(Context.Items("customername")) => returns the customername
of page1

OK

but
---------- Context.Items.Add("test",
ontext.Items("customername")) ---------
Context.Items("customername") will not be there after page load. so keep
this value in a ViewState or a hidden val then pass that value.
"nicholas" <mu********@hotmail.com> wrote in message
news:Oe**************@TK2MSFTNGP09.phx.gbl...
I'm using context to transfer variables from 1 page to another.
But, with more than 2 pages it fails.

Ex:
page1.aspx:
Context.Items.Add("customername", customername.text)
Server.Transfer("page2.aspx")

page2.aspx:
response.write(Context.Items("customername")) => returns the customername of page1
Context.Items.Add("test", Context.Items("customername"))
Server.Transfer("page3.aspx")

page3.aspx:
response.write(Context.Items("test")) => returns nothing, how comes??
THX for help.

Nov 19 '05 #4
ok! I didn't know that it was only available in the page load.
thx a lot

"dinil" <di*****@eostek.com> wrote in message
news:ew**************@TK2MSFTNGP14.phx.gbl...
here

page1.aspx:
Context.Items.Add("customername", customername.text)
Server.Transfer("page2.aspx")

page2.aspx:
response.write(Context.Items("customername")) => returns the customername of page1

OK

but
---------- Context.Items.Add("test",
ontext.Items("customername")) ---------
Context.Items("customername") will not be there after page load. so keep
this value in a ViewState or a hidden val then pass that value.
"nicholas" <mu********@hotmail.com> wrote in message
news:Oe**************@TK2MSFTNGP09.phx.gbl...
I'm using context to transfer variables from 1 page to another.
But, with more than 2 pages it fails.

Ex:
page1.aspx:
Context.Items.Add("customername", customername.text)
Server.Transfer("page2.aspx")

page2.aspx:
response.write(Context.Items("customername")) => returns the

customername
of page1
Context.Items.Add("test", Context.Items("customername"))
Server.Transfer("page3.aspx")

page3.aspx:
response.write(Context.Items("test")) => returns nothing, how comes??
THX for help.


Nov 19 '05 #5

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

Similar topics

10
by: Andy Fish | last post by:
Hi, can anybody put forward a sensible argument javascript's behaviour of creating a new global variable whenever I assign to a previously undeclared variable. I can't beleive this is just for...
2
by: Niyazi | last post by:
Hi, I have BIG question and I gues it is the BEST question. I have a problem that I am guessing the best solution is to create some sort ..NET Services. This Service(s) must check every...
28
by: Mr. Ed | last post by:
This should be easy, but I can't immediately see what the answer is... I have some code which needs to be re-entrant. It also needs to create a unique identifier. The obvious way to create a...
1
by: Steve Remer | last post by:
My application (relevant code snippets below) originally used Session variables in order to maintain state from page to page. After being unable to solve the mystery of why those variables were...
2
by: Piotr Karwatka | last post by:
Hi! I have a little problem an qeustion. In .NET Windows Forms I can do something like that: - i have forms - Form1 Form2, on first form i have TextBox1 control on 2nd form I have Button1...
2
by: nicholas | last post by:
When I transfer variables from 1 page to another I add the variables in the querystring. So, in the script of my asp-button I put for ex.: response.redirect("thenewpage.aspx?myvar=<%=...
1
by: Shahid Juma | last post by:
Hi, This may be a very trivial answer but I was wondering if it possible to have a ASP.NET page and on a user click, it transfers to another page. Rather than redirecting to the new page, I want...
2
by: Rob Long | last post by:
Hi there Is there any way to access private variables directly from within a priviliged function? I have a situation where the priviliged function's execution context contains variables of the...
26
by: optimistx | last post by:
A variable in global scope var a1 = 'contents of global variable a1'; can be references (with some limitations) as window; // or window.a1; // or even window;
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.