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:
<forms timeout="1440" />
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 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"
<asp:LoginStatus ID="LoginStatus1" runat="server" />
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..