473,804 Members | 2,127 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1777

"kal" <ak*@noplace.co mwrote 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.redire ct("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:LoginVie w ID="LoginView1 " Runat="server">
<AnonymousTempl ate>
User is not logged in.<br />
Add <asp:Login /control here.
</AnonymousTempla te>
<LoggedInTempla te>
User is logged in.<br />
</LoggedInTemplat e>
</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.c omwrote:
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
4278
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 used for the submit button: <input type="submit" name="saverecord" value="push me to save"> Then I'd retrieve it using something like:
0
4253
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 Applications and owner of Access Microsystems. Doug can be reached at doug@accessmicrosystems.com. --------------------------------------------------------------------------------
6
2920
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 set up my pages for access directly via localhost (not using the WebMatrix server). My login page loads, and any validation controls on the page work fine, so I know it's recognizing the ASP.Net code there, however, when I try to log on, the...
2
3794
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 cause login.aspx to postback (there is a dropdown and a button which both cause a postback), it doesn't work and returns a page with the error message "the page cannot be found". I have deployed this exact package on many different servers and...
6
2511
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 VB.NET code it sits there doing nothing. I've tried some of the solutions on the internet but they don't work - I think it might have something to do with the fact I'm using a Master Page...? PLEASE HELP! This is driving me nuts!!
5
875
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 IIS in ASP.NET tab, if i switch to 2.0 then the events fire correctly, but my code is not set up for that so i get some random errors. And when i switch back to 1.1 my events still don't fire Anyone know why my post backs are not firing in 1.1?
3
1316
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 continue using this as it works fine (usually) and meets my needs exactly. Anyway, When a user logs in successfully, everything is fine. When an invalid user name and password is entered, I inform the user of this using a javascript alert(). This...
0
990
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 from AD and looks if the user exist as a user in my application, if the user exist I do a ”FormsAuthentication.RedirectFromLoginPage(UserName, false);” The problem is that a loose postback if I use the automatic login, but I have postback if I login...
5
2708
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 different and hosted on another web server) and then send the user id and pwd to my login page. What is the best to do this? Pass the user id and pwd on the url is not a solution since everybody will see the user's credential.
0
10595
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10343
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10341
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10089
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7634
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5530
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4308
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.