473,406 Members | 2,439 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,406 software developers and data experts.

Concept behind ASP.NET user LOGIN application?

im migrating from asp to asp.net. im a bit confused about form
authentication in ASP.NET ...

in ASP if I wanted to create a login application I would simply query the db
for the username and password entered in a form and if a count of 1 was
returned i would set cookies and redirect and so on.

I could do this in ASP.NET, but is this what is supposed to be done? because
in my ASP.NET unleashed book I dont see any examples of a login app except
an entire chapter on form authentication and its a little confusing.

What is the most proper concept behind creating a login in ASP.NET?

thanks
omar
Nov 17 '05 #1
5 6438
Jos
omar wrote:
im migrating from asp to asp.net. im a bit confused about form
authentication in ASP.NET ...

in ASP if I wanted to create a login application I would simply query
the db for the username and password entered in a form and if a count
of 1 was returned i would set cookies and redirect and so on.

I could do this in ASP.NET, but is this what is supposed to be done?
because in my ASP.NET unleashed book I dont see any examples of a
login app except an entire chapter on form authentication and its a
little confusing.

What is the most proper concept behind creating a login in ASP.NET?


Logging in is a process that has 2 parts: authentication (who is logging
in?)
and authorization (what is this person allowed to do?).

ASP.NET can take care of the authorization part with the aid of
configuration files. The idea is to indicate in web.config who
has which rights to a certain folder. No more code is needed.
If the user is not yet logged in, he or she is redirected to a login
page automatically.

The only thing you still have to do is make the login page and do
the authentication, but there are a few useful functions in ASP.NET
that make it very easy, such as:
FormsAuthentication.RedirectFromLoginPage.

--

Jos
Nov 17 '05 #2
Omar,
What u r doing also can be implemented in .net, But not many want to do
that, What u can do is Check the DB for Login and password and set up a
session just like the classical ASP.
If u want an example let me know I have one.
Regards
Khan Imran
"omar" <om****@REMOVEoptonline.net> wrote in message
news:uN**************@TK2MSFTNGP12.phx.gbl...
thanks,
but what about when your users are stored in a database and you want to give access to certain pages not folders necessarily.

In asp we would create a session or cookie upon login and give access to a
page by seeing if the session or cookie existed. is this not really the
proper way in asp.net?

thank you
omar

Nov 17 '05 #3
Omar,
What u r doing also can be implemented in .net, But not many want to do
that, What u can do is Check the DB for Login and password and set up a
session just like the classical ASP.
If u want an example let me know I have one.
Regards
Khan Imran
"omar" <om****@REMOVEoptonline.net> wrote in message
news:uN**************@TK2MSFTNGP12.phx.gbl...
thanks,
but what about when your users are stored in a database and you want to give access to certain pages not folders necessarily.

In asp we would create a session or cookie upon login and give access to a
page by seeing if the session or cookie existed. is this not really the
proper way in asp.net?

thank you
omar

Nov 17 '05 #4
Hey Omar, I ran in to the same thing the first time I
wanted to move from a classic ASP solution to ASP.NET.
There's some really cool functionality and some decent
examples out there. Here's one I created just to show
some possible configuration settings in the web.config
file:

http://www.simpleasp.net/DesktopDefault.aspx?tabid=42

This example is using Forms based Authentication and URL
based Authorization.

Another good basic example is here:

http://www.15seconds.com/issue/020220.htm

In my simple example, I put the user name and password in
the config file. Not something I'd do in a production
app. You can use your login page to verify the user name
and password against a database like you are doing now in
ASP. Once you do this, you can use the methods exposed by
the FormsAuthentication class to set an authentication
cookie (note that ASP.NET does all the cookie work for
you. You don't have to write any code).

Good luck!
-----Original Message-----
"Khan Imran" <im*******@htmt.soft.net> wrote in message
news:uu**************@TK2MSFTNGP12.phx.gbl...
Omar,
What u r doing also can be implemented in .net, But not many want to do that, What u can do is Check the DB for Login and password and set up a session just like the classical ASP.
thanks khan, when u say "What u r doing also can be

implemented in .net, Butnot many want to do that" are you referring to doing it the classical ASPway, checking the db and setting sessions?

thank you,
omar
.

Nov 17 '05 #5
Hey Omar, I ran in to the same thing the first time I
wanted to move from a classic ASP solution to ASP.NET.
There's some really cool functionality and some decent
examples out there. Here's one I created just to show
some possible configuration settings in the web.config
file:

http://www.simpleasp.net/DesktopDefault.aspx?tabid=42

This example is using Forms based Authentication and URL
based Authorization.

Another good basic example is here:

http://www.15seconds.com/issue/020220.htm

In my simple example, I put the user name and password in
the config file. Not something I'd do in a production
app. You can use your login page to verify the user name
and password against a database like you are doing now in
ASP. Once you do this, you can use the methods exposed by
the FormsAuthentication class to set an authentication
cookie (note that ASP.NET does all the cookie work for
you. You don't have to write any code).

Good luck!
-----Original Message-----
"Khan Imran" <im*******@htmt.soft.net> wrote in message
news:uu**************@TK2MSFTNGP12.phx.gbl...
Omar,
What u r doing also can be implemented in .net, But not many want to do that, What u can do is Check the DB for Login and password and set up a session just like the classical ASP.
thanks khan, when u say "What u r doing also can be

implemented in .net, Butnot many want to do that" are you referring to doing it the classical ASPway, checking the db and setting sessions?

thank you,
omar
.

Nov 17 '05 #6

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

Similar topics

3
by: Tom | last post by:
Hi I have a web application using asp.net and c#. User has to login to the application with his username and pwd. However, I do not allow other user uses the same username and pwd to login, i.e....
1
by: omar | last post by:
im migrating from asp to asp.net. im a bit confused about form authentication in ASP.NET ... in ASP if I wanted to create a login application I would simply query the db for the username and...
17
by: tshad | last post by:
Many (if not most) have said that code-behind is best if working in teams - which does seem logical. How do you deal with the flow of the work? I have someone who is good at designing, but...
3
by: Don | last post by:
I'm using FROMS authentication and want to automate the login. Right now I force the user to manually log in. I would like to detect the users network userName and if they have an account I will...
6
by: Andrew Chalk | last post by:
My application attempts to connect to an SQL Server database as name ASPNET and Login Name SERVERNAME/ASPNET in response to these commands: SqlConnection myConnection = new SqlConnection("Data...
0
by: clintonG | last post by:
I applied aspnet_regsql to SQL2K which was working fine throughout Beta 2 development. After installing Visual Studio and SQL Express RTM my application has blown up. Logging in to the application...
21
by: axlq | last post by:
Someone please tell me if I've discovered a PHP bug. I'm sitting in front of several computers on my home network, behind a NAT firewall/router. I am testing my web site on these different...
6
by: MuZZy | last post by:
Hi, I am looking to find a way to get currently logged in user's object GUID without querying ActiveDirectory. For example, when i log in to my laptop from home, I'm not on the office network so...
8
by: Brett | last post by:
I wrote an ASP.NET application that queries a SQL Server database (on a different box from the web server) and displays the result in a GridView. The datasource for the GridView is a SQLDataSource....
5
by: Mr. X. | last post by:
Hello. In Visual Studio 2008, there is on the toolbox -login -login, which create a login form. On that form there is a LoginButton, which click on it is evented on the "default.aspx.vb"...
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: 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: 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
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
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,...
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
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
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...

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.