|
-
Jun 2nd, 2008, 11:09 AM
#1
Thread Starter
Addicted Member
[RESOLVED] [2005] Persisting Session Variable?
I am currently developing an application and I am using session variables to move data across my pages.
However, I have run into a problem. On my login page, I declare
Code:
me.session("typeofuser")=cboUserType.Text"
I am also sending another variable, "CurrentUser", in the same session variable.
My problem is that when I move to another page, it's as if the next page cannot pick up the typeofuser variable.
For example, on the Page_load of page2, I enable a different label based on the type of user. At this point, the variable is acknowledged and I get the correct label to show on the page.
However, when I attempt to use the variable in subsequent procedures on page2, the variable is not picked up. For instance, I use this in a seperate sub called "LoadFormContents":
Code:
if me.session("typeofuser") = "Admin" then
Adminbutton.Enabled = True
Elseif me.session("typeofuser") = "User" then
adminbutton.enabled = false
Else
adminbutton.enabled=false
When I step through the code, the first two if statements return false, as if the session variable doesn't even exist.
Anyone have this problem before? I know I'm probably missing something simple.
If my post helped you, please rate it!
Languages: VB/ASP.NET 2005, C# 2008,VB6
Databases: Oracle (knowledge not currently in use), DB2
FROM Customers
WHERE We_Know_What_We_Want <> DB.Null
SELECT *
0 rows returned
-
Jun 2nd, 2008, 11:51 AM
#2
Thread Starter
Addicted Member
Re: [2005] Persisting Session Variable?
NVM....
Evaluation actually works now, even though I didn't change anything. Wow.
If my post helped you, please rate it!
Languages: VB/ASP.NET 2005, C# 2008,VB6
Databases: Oracle (knowledge not currently in use), DB2
FROM Customers
WHERE We_Know_What_We_Want <> DB.Null
SELECT *
0 rows returned
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|