Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB 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 November 18th, 2011, 06:22 PM
Registered User
 
Join Date: Nov 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ch 16: Login control not logging in

In the first Try It Out of Chapter 16, we create a Login with almost no code. So you would think I couldn't screw it up. :)

Yet, when I log in, I get no error message, but I'm not logged in. I go back to the Login page and it says to Log In, not Log Out.

I set DestinationPageUrl to Login.aspx, to see if was the page jump causing the problem, I got the same behavior. It never says Log Out. When I told the control to hide when logged in, it never hid.

I set my IE privacy controls to None, same problem. Firefox has the same behavior.

When I unset my DestinationPageUrl, I do jump to the Default page. That seems to mean I log in, if just for a pico-second.

Here's my Web Config:

<system.web>
<authentication mode="Forms">
<forms timeout="1440" />
</authentication>
...

And here is all of my Login.aspx:

<%@ Page Title="Log in to Planet Wrox" Language="C#" MasterPageFile="~/MasterPages/Frontend.master" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" Runat="Server">
<h1>Log in to Planet Wrox</h1>
<asp:Login ID="Login1" runat="server"
CreateUserText="Sign Up for a New Account at Planet Wrox"
CreateUserUrl="SignUp.aspx">
</asp:Login>
<asp:LoginStatus ID="LoginStatus1" runat="server" />
</asp:Content>


Any Clues?

Thanks in advance

EDIT: OK, this is spooky. I went ahead and did the next Try It Out with the LoginView as opposed to the Login control and everything works fine.

Last edited by jMarvin; November 18th, 2011 at 06:43 PM..
 
Old November 19th, 2011, 05:54 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Maybe your page didn't refresh when you went back to Login.aspx? Try pressing Ctrl+F5 and see if that makes a difference.

Alternatively, add a LoginStatus to default.aspx and see if it correctly shows your logged in status.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old November 19th, 2011, 02:00 PM
Registered User
 
Join Date: Nov 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you,

And I'd like to say how much I appreciate your writing. Very clear, and covers a lot of ground.

John





Similar Threads
Thread Thread Starter Forum Replies Last Post
Connection String Ch 16 DavidN BOOK: Beginning Microsoft Visual Basic 2010 6 November 4th, 2011 04:41 AM
Search ch 13, ch 16 sporik BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143 0 October 27th, 2009 04:44 PM
Ch 16 Replication trondta BOOK: Professional SQL Server 2005 Administration ISBN: 0-470-05520-0 0 October 12th, 2009 07:15 AM
Try it out:Ch 16 Dataset Example flhartley VB.NET 2002/2003 Basics 1 August 28th, 2009 07:00 AM
Ch 16 driver not found dmswdev JSP Basics 1 June 27th, 2003 05:15 AM





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