locked
Post Backs are not working in IIS 7.5 RRS feed

  • Question

  • User1297132655 posted

    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 NOT 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

    Tuesday, August 20, 2013 1:26 AM

Answers

  • User1297132655 posted

    Hi Folks,

    Problem has now been solved, for reason unknown to anyone, default IIS7.0/7.5 is not configured with the Role ASP.Net, I ended up fluking a reference back to => http://www.iis.net/configreference/system.webserver/asp which indicated that for asp, you need to install the asp role, I noted inthe screen shot displayed that ASP.NET also wasn't selected, So I followed the steps provided in the reference and added the ASP.NET Role, and lo and behold postbacks are working.

    Now it's it's beyond my meager talents to explain why on first page load everything ran ok, including DB Access, Gridview population etc etc, but a postback was ignored.

    My only saving grace is that our 'Infrastructure Experts' who supply, build & configure our servers also did not now about this.

    Cheers

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 20, 2013 11:01 PM

All replies

  • User289622470 posted

    Hi,

      Can you check the browser console and see what is happening on button click.?

    Thanks,

    Tuesday, August 20, 2013 3:09 AM
  • User1297132655 posted

    Hi Romy, Thank you for taking the time to respond, wasn't sure exactly what you meant by Browser Console. My Dev PC's out of action today so Fiddler wasn't availble but I fired up Fixfox's (21) Web Console and grabbed the Postback Request & Response Headers from there, but I don't think they tell us anything, except that nothings comming back from IIS7.

    Something I should have included yesterday is the Original (pre-Postback/first load) HTML/Source

    IIIS6

    <!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="/wEPDwUKMTIyOTk0NzExOQ9kFgJmD2QWAgIDD2QWAgIBD2QWAgIBDw8WAh4EVGV4dAUPRmlyc3QgUGFnZSBMb2FkZGRkExUCQoYfIutnEZexFGuB/qt2rk2uYsWE5G3AXgstCNA=" />
    </div>
    
    <div class="aspNetHidden">
    
    	<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWAgLfkrXOCgLNs/TsCdo4NXFzd8TX9JBRBfcpdE7TUQQYkQGMub2smovGFVT6" />
    </div>
        <div>
            <div>
                <h1>
                    Master Header</h1>
            </div>
            
        <div>
            <h2>
                Page Header</h2>
        </div>
        <div>
            Stage :-
            <span id="MasterBody_lblLabel">First Page Load</span>
        </div>
        <div>
            <input type="submit" name="ctl00$MasterBody$btnButton" value="Post Back" id="MasterBody_btnButton" />
        </div>
    
        </div>
        </form>
    </body>
    </html>

    IIS7

    <!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="/wEPDwUKMTIyOTk0NzExOQ9kFgJmD2QWAgIDD2QWAgIBD2QWAgIBDw8WAh4EVGV4dAUPRmlyc3QgUGFnZSBMb2FkZGRk4B2KdA2KiuoaYqORLha0OCGEtctbfKqX7tY72hn3VcY=" />
    </div>
    
    <div class="aspNetHidden">
    
    	<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWAgLsz7T+BgLNs/TsCQayRH9OsrjblRD+mzur6oZlrQY33OGsInEuJOEsDaFM" />
    </div>
        <div>
            <div>
                <h1>
                    Master Header</h1>
            </div>
            
        <div>
            <h2>
                Page Header</h2>
        </div>
        <div>
            Stage :-
            <span id="MasterBody_lblLabel">First Page Load</span>
        </div>
        <div>
            <input type="submit" name="ctl00$MasterBody$btnButton" value="Post Back" id="MasterBody_btnButton" />
        </div>
    
        </div>
        </form>
    </body>
    </html>

    Identical except for the __VIEWSTATE & __EVENTVALIDATION, which would be expected comming from different Servers.

    Request/Response Headers from Firefox Web Console.

    IIS6 Postback Request Header

    User-Agent:Mozilla/5.0 (Windows NT 5.1; rv:21.0) Gecko/20100101 Firefox/21.0
    Referer:http://myIIS6Server.myIntranet.myDomain.com/TestDummy/Default.aspx
    Host:myIIS6Server.myIntranet.MyDomain.com
    Connection:keep-alive
    Accept-Language:en-au,en;q=0.5
    Accept-Encoding:gzip, deflate
    Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

    IIS6 Postback Response Header

    X-Powered-By:ASP.NET
    X-AspNet-Version:4.0.30319
    Vary:Accept-EncodingTransfer-Encoding:chunked
    Server:Microsoft-IIS/6.0
    MicrosoftOfficeWebServer:5.0_Pub
    Date:Tue, 20 Aug 2013 23:05:33 GMT
    Content-Type:text/html; charset=utf-8
    Content-Encoding:gzip
    Cache-Control:private

    IIS7 Postback Request Header

    User-Agent:Mozilla/5.0 (Windows NT 5.1; rv:21.0) Gecko/20100101 Firefox/21.0
    Referer:http://myIIS75Server.myIntranet.myDomain.com/TestDummy/Default.aspx
    Host:myIIS75Server.myIntranet.myDomain.com
    Connection:keep-alive
    Accept-Language:en-au,en;q=0.5
    ccept-Encoding:gzip, deflate
    Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

    IIS7 Postback Response Header

    X-Powered-By:ASP.NET
    Server:Microsoft-IIS/7.5
    Date:Tue, 20 Aug 2013 23:04:34 GMT
    Content-Length:0

    This is pretty much the exact same result on IE6 on Win XP, Firefox21 on WinXP, Chrome on WinXP, IE8 on Win2K8SP1, IE9 on Win7(Ent), Firefox21 on Win7(Ent), Chrome on Win7(Ent)

    Tuesday, August 20, 2013 8:19 PM
  • User1297132655 posted

    Hi Folks,

    Problem has now been solved, for reason unknown to anyone, default IIS7.0/7.5 is not configured with the Role ASP.Net, I ended up fluking a reference back to => http://www.iis.net/configreference/system.webserver/asp which indicated that for asp, you need to install the asp role, I noted inthe screen shot displayed that ASP.NET also wasn't selected, So I followed the steps provided in the reference and added the ASP.NET Role, and lo and behold postbacks are working.

    Now it's it's beyond my meager talents to explain why on first page load everything ran ok, including DB Access, Gridview population etc etc, but a postback was ignored.

    My only saving grace is that our 'Infrastructure Experts' who supply, build & configure our servers also did not now about this.

    Cheers

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 20, 2013 11:01 PM