Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems with session Variables
Message
From
30/10/2006 09:32:21
 
General information
Forum:
ASP.NET
Category:
Web forms
Miscellaneous
Thread ID:
01163851
Message ID:
01165490
Views:
11
Hi Gerard,

>I cut and pasted in your code and it works fine.
>I cant dee anything major different in my code
>(I dont use This. and I use (string) instead of .tostring )
> but I dont think these should matter.


That's why I asked to see your code. There's probably something extra in there (not the this. or the (string) ... you're right that those don't matter) that's affecting how your Pages are running.

>I'll play around with my code and by a process of elimination get to the bottom of it.

Right ... now that you know that it *does* work the way it's supposed to, you should be able to track down what extra stuff you have in there that might be causing the problem. If you still can't find it, post more of your code here and we'll try to figure it out. Otherwise, let us know if you figure it out.

~~Bonnie



>
>
>>I don't know what the problem might be Gerard ... here's what I did and it works just fine:
>>
>>Here's Page1:
>>
>>	public partial class _Default : System.Web.UI.Page
>>	{
>>		protected void Button1_Click(object sender, EventArgs e)
>>		{
>>			Session["MyVar"] = this.TextBox1.Text;
>>			Response.Redirect("Page2.aspx");
>>		}
>>	}
>>
>>
>>Here's Page2:
>>
>>	public partial class Page2 : System.Web.UI.Page
>>	{
>>		protected void Page_Load(object sender, EventArgs e)
>>		{
>>			string bob = Session["MyVar"].ToString();
>>			this.TextBox1.Text = bob;
>>		}
>>	}
>>
>>
>>What did you do differently?
>>
>>~~Bonnie
>>
>>
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform