Welcome, Guest. Please login or register.
Did you miss your activation email?
Pages: [1]   Go Down
  Print  
Author Topic: Sessions  (Read 1130 times)
0 Members and 1 Guest are viewing this topic.
Arkie
Javaforums.net Admin
Senior Member
*

Reputation: 16
Developer @ Javaforums.net
Offline Offline
Posts: 2593
Referrals: 13

WWW Awards
« on: March 28, 2009, 10:04:47 AM »

Sessions in .NET (asp/c#) are pretty easy to create:

Loginpage:

Code
GeSHi (csharp):
  1. Session.Add("Person_ID", listPerson[0].Person_ID);
Created by GeSHI 1.0.7.20

Another page:

Code
GeSHi (csharp):
  1.      if (Session["Person_ID"] != null){}
Created by GeSHI 1.0.7.20

this is a simple session check that will check if a Person_ID is not null,

If the Person_ID is null, however you can redirect the user to the loginpage with this:

Code
GeSHi (csharp):
  1.        else
  2.        {
  3.            Response.Redirect("~\\LoginPage.aspx");
  4.        }
Created by GeSHI 1.0.7.20
Logged

Java and .NET developer

To students: It doesn't matter how hard you've studied; the material won't be on the exam anyway.

Fan of http://www.retardedweblogger.com
Oh man, too much stuff to do in so little time.

http://img222.imageshack....707/arkietomatoesmall.jpg
Blizzcon 2k9 Grubby and Cassandra Ng engaged ! <3
Triple D, eerste Denken Dan Doen
Pages: [1]   Go Up
  Print  
 
Jump to:  

Your Ad Here