473,441 Members | 1,904 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,441 software developers and data experts.

Forms authentication puzzle

How do you implement a login control across multiple .aspx pages that allows
access to pages and directories with the application you are designing?

For example, imagine a login control that is located on everypage you go to
until you have logged into the application. Once you have logged in, then
the control goes away and maybe replaced with a list of options that
enables you to do whatever no that your credentials have been varified.

I know how to implement Forms authentication but that is virtual directory
specific. This is more, site specific. Once your credentials are validated,
then you are free to use other parts of an application, etc.

How do you do this with .aspx... It is pretty simple with asp...
Nov 19 '05 #1
3 1281
Hi,

It is really simple with ASP.Net too. For many of my sites I have a little
cell. All of my pages inherit from a page control that I created by
inheriting from System.Web.UI.Page. In the load event of my base page I
check if the user is logged in or not. If they are I place a user control
in the cell that displays specials and what not. If they are not logged in
then I display a user control that lets them log in.

Note that in ASP.Net just like in old ASP, if you are planning this ahead of
time it is a breeze. If you are at the end of the project then it will take
some work. The cool thing is that at the end of the project this is much
easier to implement in ASP.Net than in ASP. Good luck! Ken.

P.S. One of the cool things about using Roles with Forms Authentication is
it lets you do even further customization in that cell. For example Admins
get to see how many users are currently on the web page, Sales Managers can
see how many sales have gone through in the last 24 hours, and so on.
--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.

"branton ellerbee" <bl**@sbcglobal.net> wrote in message
news:Ji****************@newssvr11.news.prodigy.com ...
How do you implement a login control across multiple .aspx pages that allows access to pages and directories with the application you are designing?

For example, imagine a login control that is located on everypage you go to until you have logged into the application. Once you have logged in, then
the control goes away and maybe replaced with a list of options that
enables you to do whatever no that your credentials have been varified.

I know how to implement Forms authentication but that is virtual directory
specific. This is more, site specific. Once your credentials are validated, then you are free to use other parts of an application, etc.

How do you do this with .aspx... It is pretty simple with asp...

Nov 19 '05 #2
Hi,

You said in this reply "All of my pages inherit from a page control that I
created by inheriting from System.Web.UI.Page"

Do you use Visual Studio? When I tried to do this (build my own page
control, inheritiing from weg.ui.page) VS wouoldn't process any pages that
inherited from my control.
It could only handle pages that inherited from web.ui.page (VS2003)

Did you have any problems? If so, how did you solve them?

Thanks,
David

"Ken Dopierala Jr." wrote:
Hi,

It is really simple with ASP.Net too. For many of my sites I have a little
cell. All of my pages inherit from a page control that I created by
inheriting from System.Web.UI.Page. In the load event of my base page I
check if the user is logged in or not. If they are I place a user control
in the cell that displays specials and what not. If they are not logged in
then I display a user control that lets them log in.

Note that in ASP.Net just like in old ASP, if you are planning this ahead of
time it is a breeze. If you are at the end of the project then it will take
some work. The cool thing is that at the end of the project this is much
easier to implement in ASP.Net than in ASP. Good luck! Ken.

P.S. One of the cool things about using Roles with Forms Authentication is
it lets you do even further customization in that cell. For example Admins
get to see how many users are currently on the web page, Sales Managers can
see how many sales have gone through in the last 24 hours, and so on.
--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.

"branton ellerbee" <bl**@sbcglobal.net> wrote in message
news:Ji****************@newssvr11.news.prodigy.com ...
How do you implement a login control across multiple .aspx pages that

allows
access to pages and directories with the application you are designing?

For example, imagine a login control that is located on everypage you go

to
until you have logged into the application. Once you have logged in, then
the control goes away and maybe replaced with a list of options that
enables you to do whatever no that your credentials have been varified.

I know how to implement Forms authentication but that is virtual directory
specific. This is more, site specific. Once your credentials are

validated,
then you are free to use other parts of an application, etc.

How do you do this with .aspx... It is pretty simple with asp...


Nov 19 '05 #3
Hi David,

Instead of posting a bunch of possibilities I thought I would post a link to
a neat article that really goes in depth on the subject:

http://www.devx.com/dotnet/Article/18011

Give that a try. If you have any questions with implementing it just post
them to the group and reference that article. By doing it this way we'll
have a similiar perspective of the code you are using.

Also, this is a good link for C# that has a completely built project you can
download and run:

http://www.codeproject.com/aspnet/page_templates.asp

Good luck! Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.

"David GB" <Da*****@discussions.microsoft.com> wrote in message
news:6E**********************************@microsof t.com...
Hi,

You said in this reply "All of my pages inherit from a page control that I
created by inheriting from System.Web.UI.Page"

Do you use Visual Studio? When I tried to do this (build my own page
control, inheritiing from weg.ui.page) VS wouoldn't process any pages that
inherited from my control.
It could only handle pages that inherited from web.ui.page (VS2003)

Did you have any problems? If so, how did you solve them?

Thanks,
David

"Ken Dopierala Jr." wrote:
Hi,

It is really simple with ASP.Net too. For many of my sites I have a little cell. All of my pages inherit from a page control that I created by
inheriting from System.Web.UI.Page. In the load event of my base page I
check if the user is logged in or not. If they are I place a user control in the cell that displays specials and what not. If they are not logged in then I display a user control that lets them log in.

Note that in ASP.Net just like in old ASP, if you are planning this ahead of time it is a breeze. If you are at the end of the project then it will take some work. The cool thing is that at the end of the project this is much easier to implement in ASP.Net than in ASP. Good luck! Ken.

P.S. One of the cool things about using Roles with Forms Authentication is it lets you do even further customization in that cell. For example Admins get to see how many users are currently on the web page, Sales Managers can see how many sales have gone through in the last 24 hours, and so on.
--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.

"branton ellerbee" <bl**@sbcglobal.net> wrote in message
news:Ji****************@newssvr11.news.prodigy.com ...
How do you implement a login control across multiple .aspx pages that

allows
access to pages and directories with the application you are designing?
For example, imagine a login control that is located on everypage you go
to
until you have logged into the application. Once you have logged in,

then the control goes away and maybe replaced with a list of options that
enables you to do whatever no that your credentials have been varified.
I know how to implement Forms authentication but that is virtual directory specific. This is more, site specific. Once your credentials are

validated,
then you are free to use other parts of an application, etc.

How do you do this with .aspx... It is pretty simple with asp...


Nov 19 '05 #4

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

Similar topics

6
by: Billy Jacobs | last post by:
I have a website which has both secure and non-secure pages. I want to uses forms authentication. How do I accomplish this? Originally I had my web.config file in the root with Forms...
3
by: Kris van der Mast | last post by:
Hi, I've created a little site for my sports club. In the root folder there are pages that are viewable by every anonymous user but at a certain subfolder my administration pages should be...
2
by: Eric | last post by:
I am trying to build an app where the stuff in the root directory is open to all, but anything under the Restricted directory requires you to login and I want to use Forms to do it. I'm having...
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...
7
by: Justin | last post by:
I am trying to password protect a subdirectory using forms authentication. I am using the "Location" tag to specify the directory to be protected. The login.aspx page is in the root directory of...
5
by: V. Jenks | last post by:
Using forms authentication, can I control which pages and/or directories a user would have access to or is that only available with Windows authentication? Thanks!
4
by: =?Utf-8?B?R3V1czEyMw==?= | last post by:
Hi, I created a web site on a remote server. To logon the user must enter a user id and password. The site is uses Forms Authentication. The web config file looks as follows: ...
4
by: Bjorn Sagbakken | last post by:
In a web-application with login creds (user, pwd), these are checked against a user table on a SQL server. On a positive validation I have saved the userID, name, custno and role-settings in a...
5
by: Rory Becker | last post by:
Having now created a Custom MembershipProvider that seems to work correctly with my Logon and ChangePassword controls, I am, as they say, a happy bunny. The next stange is to move on to the...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
1
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...
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...
0
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...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.