Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Specify page?

Reply
Thread Tools

Specify page?

 
 
LL
Guest
Posts: n/a
 
      11-05-2003
Hi,

If the return key does not exist, RedirectFromLoginPage redirects to
Default.aspx. How to set it up, so if the return key dones not exist, will
retirect to mypage.aspx?

Thansk..


 
Reply With Quote
 
 
 
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      11-05-2003
The only time there is not a redirect page is when the user types in the
logon page. And, yes, this one has bit me on the butt, as well.

You can test for the Redirect URL by two means:

1. FormsAuthentication.GetRedirectUrl
Will have to have auth cookie set prior to this
2. Request["ReturnURL"]
If no URL is set, you can redirect.

Something like:

if(FormsAuthentication.Authenticate(name,password) )
{
if(Request["ReturnURL"] != null)
{
FormsAuthentication.RedirectFromLoginPage(name,fal se);
}
else
{
FormsAuthentication.GetAuthCookie(name, false);
Response.Redirect("redirectPage.aspx");
}

}
else
{
// TODO: What if user not authenticated
}

You will have to tweak this to your use. You will probably want to test for
redirect URL on first request and set a variable based on this value, as I
am not sure it will work in the button_click event, as shown. I have not
tested this code, so it is simply a road map to a potential methodology.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************** ********************
Think Outside the Box!
************************************************** ********************
"LL" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> If the return key does not exist, RedirectFromLoginPage redirects to
> Default.aspx. How to set it up, so if the return key dones not exist, will
> retirect to mypage.aspx?
>
> Thansk..
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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
specify multiple tabs at startup? Todd M. Goin Firefox 1 05-18-2005 08:41 PM
NC Verilog and specify block query Anshul Bansal VHDL 1 03-14-2005 07:15 AM
How do I specify additional headers in TB raindog Firefox 3 09-13-2004 10:25 PM
How to specify default value to a variable of unconstrained type INSIDE a VHDL procedure ? Pankaj VHDL 2 08-23-2004 04:36 AM
Howto specify taget library for VHDL objects? Valentin Tihomirov VHDL 8 11-07-2003 12:21 AM



Advertisments