State

R

rrgouvea

Hi *.* !

I would like to transfer some values (state) from one page to
another, but I have a problem...

My pages are called after clicking the dynamic menu item from
the page, so I don't know the page to call using "Server.Transfer"
method.

Is there any way to set the Context to be automatic
transfered ? Any other sugestions ?

Roberto
 
R

rjl

I would add the data to session, then remove the data from session
after you the transferred page is loaded. if it is not a lot of data,
say a simple string or int, just append it to the url.
 
R

roberto.rigotto

I have tested and It doesn't work.
If I use the Session or QueryString methods, I need to specify the next
page too....

Please see mmy example to help me:

I) Using SESSION:

Page 1:
-----------
Session["VarA"] = "1";
// Response.Redirect("???.aspx"); <-- If not executed, the
session doesn't go to next page.

Page 2, 3 or 4:
----------------------
string str = Session["VarA"].ToString() // Null


II) Using QUERY STRING:

Using query string the same problem occurs, because I need to
specify the next page:

Response.Redirect("????.aspx?VarA=" + txtValue.Text);
 
R

roberto.rigotto

I found what the problem !!!

I was using the "cookieless" option and somehow it was forcing me to
use Response.Redirect or Server.Trasnfer.

Web.config:
<sessionState cookieless="true"></sessionState>

After removing this entry, the SESSION started working just great !

Thanks !
 
R

roberto.rigotto

Juan,

I found the problem !

I was using the cookieless option in web.config file and somehow it was
interfering...

Web.config:
<sessionState cookieless="true"></sessionState>

After removing this line from web.config file, I didn´t need to use
Response.Redirect command anymore !

Thank you,
Roberto
 
R

rjl444

Just a note. you could do query string because at tun time, you will
know the page (i.e, ????). use this as a variable as well.

Glad it is working.
 

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

Top