473,769 Members | 7,320 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Let the user authentication work at the BasePage, is it suitable?

Hi,all,
Now I let every .aspx page inherited from BasePage, and let the
authentication work at there.
sample code:
if (session["user"]=="")
{
//Redirect to login page
Response.Redire ct ("login.aspx ");
}

is this method right? and suitable for the .NET development's habit?

Because this method is study from my traditional ASP development.(li kes
included a authentication page in every ASP pages)

And now I prepare to used this style
"FormsAuthentic ation.RedirectF romLoginPage" authentication mode to do the
auth module.Any special things I need to take care?

And any suggestion are appreciated.

Thank you very much.

Benny Ng

Nov 19 '05 #1
2 1191
If you are using forms authentication and all pages in the application
require a user to be logged in, set the following up in your web.config
in the authentication section.

<configuratio n>
<system.web>
<authenticati on mode= "Forms">
<forms name=".SITEAUTH " loginUrl="Login .aspx" />
</authentication>
</system.web>
</configuration>

information about forms authentication can be found at
http://samples.gotdotnet.com/quickst...formsauth.aspx.

-Darren Kopp

Nov 19 '05 #2
Ah..Yes. I saw this before. Now i goto checkout this article.Thank you very
much.

Benny Ng

<da********@gma il.com> wrote in message
news:11******** *************@g 14g2000cwa.goog legroups.com...
If you are using forms authentication and all pages in the application
require a user to be logged in, set the following up in your web.config
in the authentication section.

<configuratio n>
<system.web>
<authenticati on mode= "Forms">
<forms name=".SITEAUTH " loginUrl="Login .aspx" />
</authentication>
</system.web>
</configuration>

information about forms authentication can be found at
http://samples.gotdotnet.com/quickst...formsauth.aspx.

-Darren Kopp

Nov 19 '05 #3

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

Similar topics

1
2896
by: Ghazan Haider | last post by:
Is there a way for a PHP script to know which machine/user is accessing the script? The html headers at best show the client machine name/IP but not the user. so... Can AciveX be used to see who is logged in? Can COM etc be used?
12
2814
by: Google Mike | last post by:
You know, while working on my moonlight corporation's LAMP project at home this weekend, I couldn't help but wonder if people writing similar projects are solving similar problems with having to complete the project by building an installer and building the user/group administration piece of it. The thought came to me that it would be great if LAMP developers, whether they used MySQL or PostgreSQL, could just simply write the project to...
5
2390
by: Matthew Louden | last post by:
I wrote ASP.NET application that access SQL Server database. When I run the application, it yields "Login failed for user '<COMPUTER_NAME>\ASPNET'" error message. I then did the following, but still didn't work. Any ideas?? 1. In IIS console, right click the virtual directory 2. click directory security tab 3. click edit button on anonymous access 4. click browse button
5
3112
by: Dave Kolb | last post by:
Is there any other solution for an ASPNET application to access network resources other than running as SYSTEM, using delegation (a nightmare to get to work) or the COM+ solution? I cannot seem to impersonate a user and obtain network credentials using the DuplicateTokenEx call with appropriate parameters even though the call seems to not fail. I check my identity has changed but can only still do local commands. I would consider...
1
1461
by: Rob Teegarden | last post by:
I have a class called BasePage that inherits System.Web.UI.Page All my aspx pages inherit a class called BasePage On each page I have a web user control called ClientInfo In the BasePage I get the Client ID (CID) from the querystring, I want to be able to access CID from the web user control ClientInfo.
0
1318
by: Joe | last post by:
I've a web form that inherits from a BasePage. There is a user control on the web form. Does anyone thinks it's a problem if I've my BasePage loading a user control and my web form loading a different user control. I'm more worry on the sequence as which user control gets loaded first. The user control I've on the web form depends on the user control on the BasePage to load first. Most of the time, it seems everything is ok (BasePage...
11
3958
by: Ted | last post by:
I have figured out how to use MS SQL Server Management Studio for SQL Server 2005, including how to create users. At my client's offices, on my own LAN (a one man office with two computers in a peer to peer LAN - machines running the professional edition of WXP), and on my colleagues computers (stand alone notebooks), SQL Server was installed allowing both local and remote connections, and support for both Windows and SQL Server...
2
2082
by: mark4asp | last post by:
This is a simplified version of my site. There are Premium users who have access to the Premium directory. Anyone else attempting to access it should be logged and then redirected to the Premium.aspx - which explains the advantages of being a Premium member and provides examples of content. The default page for site visitors is "News/Default.aspx" but only those with cookies set should go there otherwise visitors need to login to...
4
2330
by: =?iso-8859-1?q?Eir=EDkur_Fannar_Torfason?= | last post by:
I'm wrestling with a problem that I'm hoping someone can help me with. I have a web application written in VS.2003 and running on version 1.1 of the .NET Framework on XP pro and Windows server 2003 that connects to a SQL server database and authenticates itself using windows authentication. The web application is configured to impersonate a local user account that has been granted access to the database. Here's the impersonation snip...
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10216
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
10049
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
7413
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
5309
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...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3965
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
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.