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

VS 2005 Web Application Login Controls

RG
I have set up an application which requires forms autentication using Login
control. Once logged in, there are three pages that user could navigate to.

How do I prevent access to those three pages if the user is not logged in?

Thanks in advance
Dec 14 '05 #1
1 882
It is up to you to permit/refuse access to each page.

Typically, set a cookie or session variable to indicate that the user is
authenticated and test for that cookie/session variable in the page_load
event of each page

<snip from login form>
If loginok then
session("userauthenticated")=true
endif
</snip>

<snip from all other pages>
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Not Session("Authenticated") Then
Server.Transfer("login.aspx")

End If
End Sub
</snip>

HTH

In message <E3**********************************@microsoft.co m>, RG
<RG@discussions.microsoft.com> writes
I have set up an application which requires forms autentication using Login
control. Once logged in, there are three pages that user could navigate to.

How do I prevent access to those three pages if the user is not logged in?

Thanks in advance


--
Chris Petchey
Dec 15 '05 #2

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

Similar topics

3
by: sacred_warrior | last post by:
After I saw Scott Guthrie's ASP.NET 2.0 with VS2005 seminar (which I think was great because I got to see all the cool features of VS 2005), I created a website using VS 2005 with option of File...
3
by: Lumpierbritches | last post by:
I have an application my partner wrote that would allow an autoresponse to any Mapi compliant email that apparently in .Net won't, can someone assist me with fixing this? Here is the code: ...
2
by: RedEye | last post by:
Hello, I have been working on an ASP.NET application for the past 2 weeks and everything has been going fine. I am using the ASP.NET login controls to handle user logins and I'm using SQL 2005...
4
by: Greg P | last post by:
I know this is a long post, please bear with me. I have been working on this all weekend to no avail although I have done a good amount of research (see most pertinent links that I've looked at...
1
by: Gurunadh | last post by:
Hi friends, we have developed a windows desktop application in vb.net 2005 with MS-Access as backend ,our problem is we have to display data from a datagridview to a crystal report,we have...
1
by: Gurunadh | last post by:
Hi friends, we have developed a windows desktop application in vb.net 2005 with MS-Access as backend ,our problem is we have to display data from a datagridview to a crystal report,we have...
3
by: Lee T. Hawkins | last post by:
I am having a number of problems over the last two full days trying to get an ASP.NET 2.0 application to connect to a SQL Server 2005 database... First off, I built this application w/ Visual...
4
by: benjaminkang | last post by:
I'm very new to Coldfusion and action script, but due to job requirements, i got allocated the task of developing a cfm page where the user logs in using the embedded swf file and everything was...
0
by: benjaminkang | last post by:
I'm very new to Coldfusion and action script, but due to job requirements, i got allocated the task of developing a cfm page where the user logs in using the embedded swf file and everything was...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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,...
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
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,...

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.