473,396 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

is the best way - postback login change

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
Jun 16 '07 #1
2 1765

"kal" <ak*@noplace.comwrote in message
news:6j***************@newsfe6-win.ntli.net...
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

Jun 16 '07 #2
Hi,

If you are using .NET 2.0 framework, have a look at LoginView Control:

<asp:LoginView ID="LoginView1" Runat="server">
<AnonymousTemplate>
User is not logged in.<br />
Add <asp:Login /control here.
</AnonymousTemplate>
<LoggedInTemplate>
User is logged in.<br />
</LoggedInTemplate>
</asp:LoginView>

For more info:
http://msdn2.microsoft.com/en-us/lib...loginview.aspx

Regards,
Mital
http://mital.kakaiya.com
On Jun 16, 7:45 pm, "kal" <a...@noplace.comwrote:
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

Jun 16 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jiho Han | last post by:
What is the best way to check whether the page is simply a postback or the form has been submit with the intention of doing something? In the olden days, I used to check for a form field name...
0
by: Anonieko Ramos | last post by:
ASP.NET Forms Authentication Best Practices Dr. Dobb's Journal February 2004 Protecting user information is critical By Douglas Reilly Douglas is the author of Designing Microsoft ASP.NET...
6
by: Brian Miller | last post by:
I've been constructing an ASP.Net application using the 1.1 framework, and have been using Web Matrix for development purposes. Now that my application is near completion, I wanted to see if I can...
2
by: johngilmer | last post by:
I have a login page and it appears just fine (login.aspx). There are a couple of links on the page which use javascript to bring up modal dialogs of other aspx pages, and they work fine. But if I...
6
by: Andrew Willett | last post by:
I have a web form that is a child of a Master Page. It is a login form for forms authentication. When you fill in the username and password box and press ENTER it doesnt process any of the...
5
by: Ben Dewey | last post by:
This is a repost, But I have some new information. I have a server that is configured for .NET 1.1 and 2.0. For some reason all my postback events for aren't firing when using .NET 1.1. Under...
3
by: James Thomas | last post by:
I have an issue with the login process on my site since the upgrade to ASP .NET 2.0 (from 1.1). I have the standard textbox and button for logging and my own custom login process. I'd like to...
0
by: it98pol | last post by:
I have a webapplication that mixing Forms Authentication with Windows Authentication and using the new membership providers in ASP.NET 2.0. If a user comes from the Intranet a pick the users email...
5
by: rockdale | last post by:
Hi, all: I have a website with its own login page. Now one of my clients want their employees log into my website from their website. They want to have their login page (look and feel are...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.