473,320 Members | 1,902 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,320 software developers and data experts.

State

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

May 16 '06 #1
6 1040
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.

May 16 '06 #2
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);

May 16 '06 #3
Are you using ASP.NET 2.0 ?

If you are, it's quite simple to use cross-page posting and the PreviousPage property :

http://msdn2.microsoft.com/en-us/library/ms178139.aspx


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
<ro*************@gmail.com> wrote in message
news:11********************@u72g2000cwu.googlegrou ps.com...
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);

May 16 '06 #4
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 !

May 16 '06 #5
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

May 16 '06 #6
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.
ro*************@gmail.com wrote:
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


May 17 '06 #7

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

Similar topics

32
by: Xah Lee | last post by:
is it possible to write python code without any indentation? Xah xah@xahlee.org http://xahlee.org/PageTwo_dir/more.html
4
by: Chad Crowder | last post by:
I've taken a look at this article http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspnet/html/asp12282000.asp which someone posted a month or so ago regarding setting up SQL...
1
by: Johan Nedin | last post by:
Hello! I have a problem with SQLSession state on my ASP.NET pages. SQLSession state behaves very different from InProcess session state, which I think is very bad. I can understand some of...
6
by: Daniel Walzenbach | last post by:
Hi, I have a web application which sometimes throws an “out of memory†exception. To get an idea what happens I traced some values using performance monitor and got the following values (for...
1
by: Neo | last post by:
hi, This is my first post in C++ group, so please be nice to me. Thanks. Also, I will post my first C++ program following. There is a compile error, I cannot figure it out even I can fix it. And...
4
by: Shawnk | last post by:
This post is intended to verify that true value semantics DO NOT EXIST for the Enum class (relative to boolean operations). If this is true then (thus and therefore) you can not design state...
4
weaknessforcats
by: weaknessforcats | last post by:
Design Patterns – State Often computer software operates based on a condition called a state. These states traditionally have been implemented using a switch statement. The cases of the switch...
11
by: tuom.larsen | last post by:
Dear list, I'm writing very simple state machine library, like this: _state = None def set_state(state): global _state _state = state
4
by: laktofil | last post by:
This may seem like an abstract question on behavioral inheritance. Anyway, I'm building a hierarchical state machine in C++ (with gcc for target platform Gentoo Linux). More precisely, I'm using this...
1
by: W Karas | last post by:
Virtual functions could have multiple definitions, for different object states. The prototype of a virtual member function could have an optional reserve word "for" followed by a comma-separated...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.