Hey guys,
I’m in dire need of help as my head is about to explode… I’ve dealt with loads of faulty forms in my development time and there’s usually a typo or a reference error or the like… but In this case… I can’t find it! What makes this even more strange is that the form works flawlessly in FireFox and even Google Chrome, however as soon as I fire at it in any version of Internet Explorer (I’ve tried 9, 8 and 6-compatability so far) it simply refreshes the form without the functionality (in this case, logging in)…
The code for my form is pretty straight forward:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="login.ascx.cs" Inherits="LoginUC" %>
<style type="text/css">
.formholder { overflow:hidden; width:800px;}
.formrow { padding:5px 0; clear:both; float:left; width:100%; clear:both; }
.formleft { float:left; width:30%; margin:0; line-height:20px; font-size:1.4em; padding:8px 0 0 0; }
.formright { float:right; width:59%; }
.formrow input[type=text], .formrow input[type=password] { padding:6px; width:250px; }
.formrow input[type=submit], .formrow input[type=button] { padding:3px 7px; cursor:pointer; }
.formrow select { padding:6px; width:255px; }
.formrow label.error { margin:0 0 0 10px;}
p.formerror { font-weight: bold;color: red;}
</style>
<asp:Literal ID="litError" runat="server" />
<asp:Login RenderOuterTable="false" ID="ctlLogin" runat="server" OnLoginError="OnLoginError" onloggedin="OnLoggedIn" RememberMeSet="True" VisibleWhenLoggedIn="False">
<LayoutTemplate>
<div id="login">
<div class="formholder">
<div class="formrow">
<div class="formleft"><label>Username</label></div>
<div class="formright">
<asp:TextBox ID="UserName" CssClass="textbox required" ToolTip="Enter username" runat="server"></asp:TextBox>
</div>
</div>
<div class="formrow">
<div class="formleft"><label>Password</label></div>
<div class="formright">
<asp:TextBox ID="Password" CssClass="textbox required" ToolTip="Enter password" runat="server" TextMode="Password" />
</div>
</div>
<div class="formrow">
<div class="formleft"> </div>
<div class="formright">
<asp:CheckBox ID="RememberMe" runat="server" Text="Keep me logged in" />
</div>
</div>
<div class="formrow">
<div class="formleft"> </div>
<div class="formright">
<asp:Button ID="LoginButton" CssClass="loginButton" runat="server" CommandName="Login" Text="Login" />
</div>
</div>
</div>
</div>
</LayoutTemplate>
</asp:Login>
With the CommandName=“Login” being the crucial part I suppose… This is a simple form I created, but I have tried with the standard Visual Studio 2010 Drag-and-Drop login form control, with the same result!
I’m starting to think it might be something code-unrelated? I’m running the site on Windows Server 2008 R2 x64 - ISS 7 and .NET 4.0 Classic
Has anyone experienced anything similar or know what to do? Help would be very much appreciated! This is doing my head in…
Thanks in advance!
EDIT: I’ve tried writing the codebehind myself (and partly from a guide) to take care of the login myself, however the exact same thing happens…
This is my codebehind file (Note: I am using the CMS Umbraco membership provider (pretty much identical to ASP.NET membership) hence the Member class instead of the User class.
With this, Mozilla still works flawlessly, IE redirects to the SuccessfulLoginPage upon successful validation, but still does not log the user in…
Any thoughts?
Code-behind:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using umbraco;
using umbraco.cms.businesslogic.member;
public partial class LoginUC : UserControl
{
// Macro Parameters
public int SuccessfulLoginPage { get; set; }
// Error format
private const string ErrorFormat = "<p class=\\"formerror\\">{0}</p>";
// If there is an error logging in, this method will fire and put the error in the error lit
protected void OnLoginError(object sender, EventArgs e)
{
litError.Text = string.Format(ErrorFormat, ctlLogin.FailureText);
}
// This fires once the user has successfuly logged in
protected void OnLoggedIn(object sender, EventArgs e)
{
// ** OPTIONAL! **
// You can do some custom logic here to check if user is banned or something similar
// Get the user
var m = Member.GetMemberFromLoginName(ctlLogin.UserName);
// ** OPTIONAL! **
// Send the user to the correct authenticated page, once successfully logged in
Response.Redirect(library.NiceUrl(SuccessfulLoginPage));
}
}