467,132 Members | 1,139 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,132 developers. It's quick & easy.

About ASP.NET (v2) Authentication...

Hello,

I use ASP.NET v2. But i think it's the same (if it is..)
for 1.1!
So, i wanna know if it's possible (like php) to use
sessions AND/OR cookies authentication but not 1 or 0, not
show the page or go login.aspx.
I want to have a page with design and others things and put
this code (like PHP):

if( user authed (cookies, sessions))
{
show "You are authed, click here to play"
}
else
{
show "You are not authed, please login! Click here"
}

But not: if(logged) {show all} else {go(login.aspx)}...

If i use the system with Web.config it's 1 or 0 so it's not
what i want.
What i want : depending on the state of the visitor, show a
different code but in the same page!

Regards.
Nov 18 '05 #1
  • viewed: 885
Share:
1 Reply
"Mr.KisS" <an*******@discussions.microsoft.com> wrote in message
news:29*****************************@phx.gbl...
Hello,

I use ASP.NET v2. But i think it's the same (if it is..)
for 1.1!
So, i wanna know if it's possible (like php) to use
sessions AND/OR cookies authentication but not 1 or 0, not
show the page or go login.aspx.
I want to have a page with design and others things and put
this code (like PHP):

if( user authed (cookies, sessions))
{
show "You are authed, click here to play"
}
else
{
show "You are not authed, please login! Click here"
}

But not: if(logged) {show all} else {go(login.aspx)}...

If i use the system with Web.config it's 1 or 0 so it's not
what i want.
What i want : depending on the state of the visitor, show a
different code but in the same page!


Request.IsAuthenticated will tell you whether the current request is
authenticated. If you use roles-based security, you can also use things like
User.IsInRole("Admin"). See
HOW TO: Implement Role-Based Security with Forms-Based Authentication in
Your ASP.NET Application by Using Visual Basic .NET
(http://support.microsoft.com/default...b;en-us;306238)
--
John Saunders
johnwsaundersiii at hotmail
Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.