is the best way - postback login change

K

kal

Hi,

I have a login control in a master frame.
In the page_load event handler i check
to see if a user is logged in or not and then
display their name or the login control.

This runs every time a new page is loaded.
Is this an efficient way to do this?

even if i use !ispostback it runs because
navigation isnt posting back.

Thanks for advice

Kal
 
T

ThatsIT.net.au

kal said:
Hi,

I have a login control in a master frame.
In the page_load event handler i check
to see if a user is logged in or not and then
display their name or the login control.

This runs every time a new page is loaded.
Is this an efficient way to do this?

even if i use !ispostback it runs because
navigation isnt posting back.

Thanks for advice

Kal


try putting your code in the global.asax file use the session onstart sub

if loggedIn <> true then
response.redirect("login.aspx")
end if

now in your login page include

Session.Abandon()


Now if any one tries to navigate to one of your pages without being logged
in they will be directed to the login page, if they are logged in they will
not be tested again
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top