PC Review


Reply
Thread Tools Rate Thread

RedirectFromLoginPage, but somewhere else

 
 
=?Utf-8?B?TWljaGHFgiBKYW51c3pjenlr?=
Guest
Posts: n/a
 
      23rd Mar 2004
Is there any possibility to redirect user (after having authenticated him
to some custom aspx page, not the original that he requested and whic
caused him to be shown the logon screen

now, I call

if(IsAuthenticated(user,password)

FormsAuthentication.RedirectFromLoginPage(user,false)


I would like however, that I could call something like that

if(IsAuthenticated(user,password)

MarkUserAsAuthenticated(user) //attach some cookie or something.
RedirectToCustomURL(user,false);//goto custom page, not necesserily the original that redirected the user her

//the above two lines are currently merged into one (formsAuth.RedirectFrom..()
//but this does not allow me to tell where the user should go..


Thanks for hel
MichaƂ
 
Reply With Quote
 
 
 
 
Martin Dechev
Guest
Posts: n/a
 
      23rd Mar 2004
Hi, Michal Januszczyk,

You can call FormsAuthentication.SetAuthCookie(string, bool) and then simply
Response.Redirect the user where you want to.

Hope this helps
Martin
"Michal Januszczyk" <(E-Mail Removed)> wrote in message
news:8C363A26-47F8-45FD-B762-(E-Mail Removed)...
> Is there any possibility to redirect user (after having authenticated him)
> to some custom aspx page, not the original that he requested and which
> caused him to be shown the logon screen ?
>
> now, I call :
>
> if(IsAuthenticated(user,password))
> {
> FormsAuthentication.RedirectFromLoginPage(user,false);
> }
>
>
> I would like however, that I could call something like that:
>
> if(IsAuthenticated(user,password))
> {
> MarkUserAsAuthenticated(user) //attach some cookie or something..
> RedirectToCustomURL(user,false);//goto custom page, not necesserily the

original that redirected the user here
>
> //the above two lines are currently merged into one

(formsAuth.RedirectFrom..())
> //but this does not allow me to tell where the user should go..
> }
>
> Thanks for help
> Michal



 
Reply With Quote
 
 
 
 
Marina
Guest
Posts: n/a
 
      23rd Mar 2004
You can just call good old fashioned Response.Redirect and redirect them to
wherever you want. No one says you have to call RedirectFromLoginPage.

I think the user already has to have been marked as authenticed before
RedirectFromLoginPage, or else that would fail. That method is just a
convenient way to redirect them to their originally requested URL, I dont'
believe it actually does anything to mark the user as authenticated.

"Michal Januszczyk" <(E-Mail Removed)> wrote in message
news:8C363A26-47F8-45FD-B762-(E-Mail Removed)...
> Is there any possibility to redirect user (after having authenticated him)
> to some custom aspx page, not the original that he requested and which
> caused him to be shown the logon screen ?
>
> now, I call :
>
> if(IsAuthenticated(user,password))
> {
> FormsAuthentication.RedirectFromLoginPage(user,false);
> }
>
>
> I would like however, that I could call something like that:
>
> if(IsAuthenticated(user,password))
> {
> MarkUserAsAuthenticated(user) //attach some cookie or something..
> RedirectToCustomURL(user,false);//goto custom page, not necesserily the

original that redirected the user here
>
> //the above two lines are currently merged into one

(formsAuth.RedirectFrom..())
> //but this does not allow me to tell where the user should go..
> }
>
> Thanks for help
> Michal



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataGridView does not save last change even I CommitEdit; But if I click somewhere else, it saves! Ryan Liu Microsoft C# .NET 0 25th Mar 2008 01:38 PM
How to change what directory tfs "get latest version" saves to? I made it desktop the first time it prompted me but want to change the directory to somewhere else.. DR Microsoft VB .NET 4 10th Jan 2008 09:39 AM
How to change what directory tfs "get latest version" saves to? I made it desktop the first time it prompted me but want to change the directory to somewhere else.. DR Microsoft Dot NET 1 9th Jan 2008 01:18 AM
How to change what directory tfs "get latest version" saves to? I made it desktop the first time it prompted me but want to change the directory to somewhere else.. DR Microsoft C# .NET 1 8th Jan 2008 10:09 PM
Readonly kind of variable declared somewhere by defined somewhere else? John Dalberg Microsoft C# .NET 11 26th Apr 2007 09:26 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:11 AM.