Session Variables

26 views
Skip to first unread message

crocboy25

unread,
Jan 21, 2011, 1:57:49 PM1/21/11
to Community for ASP.NET MVC
Group,

I am having trouble setting and getting session variables in VB.NET
MVC on our server. Currently on my local machine I set them using
this approach in my global.asax.vb page:

While reader.Read()
If CInt(reader(0).ToString) > 0 Then
Session("superadmin") = "yes"
Else
Session("superadmin") = "no"
End If
End While

and call them this way in an aspx page:

<% If Session("superadmin") = "yes" Then %>
blah blah blah
<% end if %>

Locally this works fine.

However, once I move this code to our web server, the session variable
never seems to be accessable once the global finishes executing...

Anyone have any advice for this situation? I need to set the session
variable from the start to dictate priveledges and so forth...
annoying that is works localy but never on the server.

Thanks in advance.

Lee W.

Dan Cary

unread,
Jan 26, 2011, 1:26:09 PM1/26/11
to c4...@googlegroups.com
Lee,

Sorry my reply couldn't be more elaborate. Hers is link that might help. 


You do have theframework installed on the server correct? 

Here is some example code on how my co-worker used the session.

 HttpContext.Current.Session[CjdGlobal.UserInformation] = this.accountLogic.GetUserInfo(userName)

Other than this, I am not sure what to tell you without spending some time researching.

Cheers, Dan

--
You received this message because you are subscribed to the "Community for ASP.NET MVC" group.

To post to this group, send email to c4...@googlegroups.com

To unsubscribe from this group, send email to
c4mvc+un...@googlegroups.com
For more options, visit this group at
http://CommunityForMvc.Net

Reply all
Reply to author
Forward
0 new messages