Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems with session Variables
Message
 
To
24/10/2006 16:23:27
General information
Forum:
ASP.NET
Category:
Web forms
Miscellaneous
Thread ID:
01163851
Message ID:
01165369
Views:
15
Hi Bonnie.. thanks for your reply.

I dont seem to be able to get these session variables to work !!

I have a Page1 , on click event of a button that calls Page2 as follows:
Session["sesuserid"] = txtUserId.Text;

Page 2 is displayed ok and OnLoad I have:
string struserid;
struserid = (string)Session["sesuserid"];
txtUserId.Text = struserid;

On the txtUserIdText, nothing appears.

Regards,

Gerard








>Gerard,
>
>I'm not an ASP.NET expert, but this should work. Could you post a little more of your code so that it might be easier to spot where you went wrong?
>
>~~Bonnie
>
>
>
>
>>Hi Carl..thanks for your reply.
>>The mis-spelling is just in the hread..the app has the correct spelling but still not working.
>>
>>Regards,
>>Gerard
>>
>>
>>>Note that this line appears to have the Session name spelled incorrectly (it's missing the "y" at the end of "sesCompan"):
>>>
>>>
string MyText = (String)(Session["sesCompan"]);
>>>
>>>
>>>
>>>>Hi.
>>>>I hve two forms, Form1 and Form2
>>>>On a Link Button on Form1 I have:
>>>> Session["sesCompany"] = "Green";
>>>>
>>>>On Form2, I just have one TextBox (TextBox1) and on Load of the form I Have:
>>>> string MyText = (String)(Session["sesCompan"]);
>>>> TextBox1.text = MyText;
>>>>
>>>>But nothing is appearing on the textbox when the form displays !!
>>>>
>>>>Anybody have any ideas on whats happenong.
>>>>regards,
>>>>Gerard
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform