Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 10th, 2004, 05:04 PM
Authorized User
 
Join Date: Nov 2003
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Default Forms Authentication

Hi,
In Web.config I'm using
<authentication mode="Forms">
      <forms name="NoLimitEnginAuth" loginUrl="login.aspx" protection="All" path="/" />
</authentication>

and in a Web User Control is
<A href='Login.aspx?URL="Catalog.aspx"'>

This works and gets to the Login.aspx page, in which a button click handler finally has:
                    FormsAuthentication.RedirectFromLoginPage(customer Id, RememberLogin.Checked);

I want the server to send the Catalog.aspx page, but it only looks for a default.aspx page which does not exist.

MS help says "RedirectFromLoginPage redirects, based on the contents of the URL key in the Query String, or to Default.aspx ..... "

What am I doing wrong? How can the user be redirected to the Catalog.aspx page from the Login.aspx page using Forms Authentication?



Sandra MacGregor
__________________
Sandy
 
Old January 11th, 2004, 04:07 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You don't need to explicitly create URL's to the login page. If a user is not authenticated, .net will redirect them to the login page automatically and generate the right query string parameter name for you. But either way you do it the right parameter name is "ReturnUrl".

Peter
------------------------------------------------------
Work smarter, not harder.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Forms Authentication thetway Classic ASP Basics 1 August 18th, 2005 05:55 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.