473,382 Members | 1,423 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,382 software developers and data experts.

Specify page?

LL
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..
Nov 17 '05 #1
1 1045
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" <li*******@hotmail.com> wrote in message
news:eO**************@tk2msftngp13.phx.gbl...
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..

Nov 17 '05 #2

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

Similar topics

17
by: Larry Woods | last post by:
I have a custom 404 error page. When I change my site properties in IIS (IIS 5.0, BTW) to point to a file, I still get the original 404 error page. But, then I copied my error page to my root,...
2
by: Matt | last post by:
I have a page1 that opens a window called page2. I want page2 doesn't have title bar, tool bar, address bar. Is it possible to specify in javascript function window_onload() in page2? I don't...
1
by: MrMike | last post by:
Hi. I have an aspx page which displays data on about the top 1/3 of the page, and the remaining 2/3 of the page is blank. The page is formatted so that my users can print the page to...
4
by: www.MessageMazes.com | last post by:
Greetings, I'm working on a collection of free puzzle pages that serve as a feed to sale pages. My question is whether I can specify that some images load before others? If you visit...
3
by: Dabbler | last post by:
What is the best way to have a FormView page open on a specific row selected from a GridView? I'm passing the primary key in the url as in detailview.aspx?mode=edit&pk=42 I'm using an...
27
by: Chris Tomlinson | last post by:
Hi, is there any way to specify the sequence in which images load on a web page? More specifically, here is what we need to achieve: Image1 starts loading first and the browser does not...
2
by: winstontuck | last post by:
I have different web pages that I want to automatically default to either landscape or portrait when printing, depending on the page. Can this be done with javascript.
3
by: thomas | last post by:
How to specify application default web page in web.config? I mean, default web page, not a login page. Is it possible? Tomasz
2
by: vikramp | last post by:
Hi, I am trying to learn new membership/roles features of ASP.NET 2.0. When we setup forms authentication and specify deny users="?" under authorization, the application asks for login. My...
3
jamesd0142
by: jamesd0142 | last post by:
For reasons i wont go into (they'll bore you...) i need to have a link on our system that opens up a web page, I dont have frontpage or simular products installed, so im likely to use a text editor...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

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.