ASP.NET/C# question

  • Thread starter Thread starter Viktor Popov
  • Start date Start date
V

Viktor Popov

Hi,
I'd like to ask you for using session.
Let's say that we have StartWebForm. A user who has opened it want to Search
the site and he/she click on the link Search.But he/she is not logged on, so
LogInWebPage is openning. After he/she input his/her username and password
and they are correct, he/she goes to SearchWebForm automatically. I don't
know how to do that automatical forward. It happens the same if he/she wants
to input data in the ForumWebForm. How could be accomplished that with
ASP.NET/C#?

Thanks in advance!

Viktor
 
Thanks for the reply!
I've read about form authentication... I store the username and the pass
into DataBase. How could ASP application know if the user is authenticated
or isn't authenticated when he/she would like to use SearchWebForm?

Viktor
 
forms authentication uses a cookie to track if the user is logged in. if
the login ticket is not in the cookie, .net will automatically redirect to
login page. in the web config you can specify which aspx pages require a
login, so your site can have open and restricted pages. there is lots of
documentation on this.

-- bruce (sqlwork.com)
 
OK, Thaks for the reply! But I saw in the examples that username and
password are stored in the Web.Config file. In my case they are in a
DataBase. Does what you are said be accomplished in this situation?

Viktor
 
OK, Thaks for the reply! But I saw in the examples that username and
password are stored in the Web.Config file. In my case they are in a
DataBase. Does what you are said be accomplished in this situation?

A couple minutes on google would of found plenty of examples.

Here's some Psuedo Code


Select Username/Password From Database into DataReader

'Means there is data, user exists
If DataReader.Read Then
FormsAuthentication.RedirectFromLoginPage(Username, False)
Else
Display Invalid Login
End If
 
Victor,

If you'd like I've created an object that allows a user login to be
persisted across all pages of a website, much like the .NET forms
authentication, but it doesn't use cookies or session state. If you'd like
details on the object you may find them on my website,
www.aboutfortunate.com. Just click on the "Code Library" link on the top
right of the page and then click the "Login" button in the menu on the left.

All the code on my site is free.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top