We're having some issues with an application migration from .netFx2 on IIS6 into .netFx4.0 on IIS7, application is up, user authentication, db connectivity & navigation are all working, but "NONE" of the pages are processing post backs, despite spending
several hours now stripping things out and checking every IIS Setting we can find. I decided to created a basic (very) C# Web (forms) Application, containing only a Single Master Page & Default.aspx, with just a single Button to update a label, but not even
that is working in IIS7.
We've already ruled out => http://www.asp.net/whitepapers/aspnet4/breaking-changes as being relevant in this case.
Full Test App Code is below, all IIS6 & 7 Settings are defaults,i.e not customised or altered in any way (Save for enabling .NetFx4 on IIS6)
Master.Master
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Master.master.cs" Inherits="TestDummy.Master" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><title></title></head><body><form id="form1" runat="server"><div><div><h1>
Master Header</h1></div><asp:ContentPlaceHolder ID="MasterBody" runat="server"></asp:ContentPlaceHolder></div></form></body></html>
Master.Master.cs
using System;
namespace TestDummy
{
public partial class Master : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
Default.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true"
CodeBehind="Default.aspx.cs" Inherits="TestDummy.Default" %><asp:Content ID="PageBody" ContentPlaceHolderID="MasterBody" runat="server"><div><h2>
Page Header</h2></div><div>
Stage :-<asp:Label ID="lblLabel" runat="server" Text="First Load"></asp:Label></div><div><asp:Button ID="btnButton" runat="server" Text="Post Back"
onclick="btnButton_Click"/></div></asp:Content>
Default.aspx.cs
using System;
using System.Web.UI;
namespace TestDummy
{
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
lblLabel.Text = "First Page Load";
}
}
protected void btnButton_Click(object sender, EventArgs e)
{
lblLabel.Text = "Page has posted back!";
}
}
}
Web.config
<?xml version="1.0"?><!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
--><configuration><system.web><compilation debug="true" targetFramework="4.0" /></system.web></configuration>
Postback source from IIS6
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title></title></head><body><form method="post" action="Default.aspx" id="form1"><div class="aspNetHidden"><input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTIyOTk0NzExOQ9kFgJmD2QWAgIDD2QWAgIBD2QWAgIBDw8WAh4EVGV4dAUVUGFnZSBoYXMgcG9zdGVkIGJhY2shZGRknpMx2Ho6Y4B8ugNq3lDniamBZ4IDr2Co1pv9x2r9zn0=" /></div><div class="aspNetHidden"><input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWAgLZoM2oBQLNs/TsCdS0FGgnv8TM13t0ZPRA7n1Hvl+AfuyeWchEz4PfYoZ3" /></div><div><div><h1>
Master Header</h1></div><div><h2>
Page Header</h2></div><div>
Stage :-<span id="MasterBody_lblLabel">Page has posted back!</span></div><div><input type="submit" name="ctl00$MasterBody$btnButton" value="Post Back" id="MasterBody_btnButton" /></div></div></form></body></html>
Postback Source from IIS7
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML><HEAD><META content="text/html; charset=windows-1252" http-equiv=Content-Type></HEAD><BODY></BODY></HTML>
We're not exactly experts in IIS7, but have been working with IIS & asp.net for sometime now and are completely complexed as to what could be casuing this.
Any assistance would eb appreciated.
Thanks