Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Checking Session value

Reply
Thread Tools

Checking Session value

 
 
tofu.captain
Guest
Posts: n/a
 
      12-08-2006
I have a bunch of administrative ASPX pages that requires me to check
for a Session value. I have a Masterpage.master file that all these
ASPX pages use, that checks this. The problem is that the codebehind
for each of those ASPX pages runs before the codebehind in the
Masterpage file.

I run my check in the Masterpage as:
protected void Page_Load(object sender, EventArgs e)
{
if (Session["foo"] != null)
// Load page
else
Response.Redirect("Login.aspx");
}

Each of those ASPX pages uses the Session value. Is my only option to
put the Session check in each of the ASPX pages instead of the
Masterpage file?

 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      12-08-2006
you could just use the builtin authentication code in asp.net. turn on
web authentication, set the admin pages as requiring authentication and
you're done.

-- bruce (sqlwork.com)

tofu.captain wrote:
> I have a bunch of administrative ASPX pages that requires me to check
> for a Session value. I have a Masterpage.master file that all these
> ASPX pages use, that checks this. The problem is that the codebehind
> for each of those ASPX pages runs before the codebehind in the
> Masterpage file.
>
> I run my check in the Masterpage as:
> protected void Page_Load(object sender, EventArgs e)
> {
> if (Session["foo"] != null)
> // Load page
> else
> Response.Redirect("Login.aspx");
> }
>
> Each of those ASPX pages uses the Session value. Is my only option to
> put the Session check in each of the ASPX pages instead of the
> Masterpage file?
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Session Timeout problems-web.confg session state and IIS session s =?Utf-8?B?Um9iSEs=?= ASP .Net 4 04-11-2007 04:52 PM
How to get session value at where out of asp.net process domain?(session ID is known) ocean ASP .Net Security 2 10-18-2005 02:21 AM
Checking old value with new value before setting. - Java 0 06-07-2005 06:15 AM
Session State - What does it take to establish one single ASP.NET session per "browser session" Jeff Smythe ASP .Net 3 01-02-2004 04:10 AM
How can I "know" the difference between a session timed out and a session that did session.abort? Jazzis ASP General 2 09-23-2003 07:16 AM



Advertisments