locked
Post Backs are not working in IIS 7.5 (take 2) RRS feed

  • Question

  • User1776304924 posted

    I have an app at .NET 4.51, that works on my development envirnment (VS 2013, testing locally on IIS 7 and connecting to SQL Server 2008 R2).

    I moved it to our test webserver box (windows 2008 R2, IIS 7.5) and it does not work (i.e. I think it is a postback problem).  If I load  a page, it displays data drawn from the

    database. If I click a botton, the page just sits there, entered data gone from input fields. The inserted code illustrates what I mean ( pauge_load works, click button and notin happens.

    The application pool is set to "Integrated" managed pool; if I set it to "Classic", it works. (All apps, including this one in production, running with .NET 3.5, work.

       Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
    
            Dim strSQL As String
            Dim objConnection As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("SUPPORT").ConnectionString)
            If objConnection.State = ConnectionState.Closed Then
                objConnection.Open()
            End If
    
            strSQL = "select TASK_SEQUENCE from SUBSCRIBERS where SUBSCRIBER='ON' "
            
            Dim objCommand As SqlCommand = New SqlCommand(strSQL, objConnection)
           
            Label1.Text = objCommand.ExecuteScalar
            
            objConnection.Close()
            
        End Sub
    
        Protected Sub btnSubmit_Click1(sender As Object, e As EventArgs)
                Dim strSQL As String
                Dim objConnection As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("SUPPORT").ConnectionString)
                If objConnection.State = ConnectionState.Closed Then
                    objConnection.Open()
                End If
    
                strSQL = "select PROJECT_SEQUENCE from SUBSCRIBERS where SUBSCRIBER='ON' "
            
                Dim objCommand As SqlCommand = New SqlCommand(strSQL, objConnection)
            
                Label1.Text = objCommand.ExecuteScalar
            
                objConnection.Close()
        End Sub
    </script>
    
    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <form id="form1" runat="server" >
    
        The value is:<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>:
        
        <asp:Button ID="btnSubmit" runat="server" Text="Button" OnClick="btnSubmit_Click1"  />
        
    </form>
    Thursday, June 19, 2014 2:37 PM

Answers