asp:button click event not firing when project run from iis 6.1

376 views Asked by At

When I run a project from visual studio 2012 an asp:button that I am using works correctly. However when I publish the project to IIS 6.1 the button's click event handler is not getting called. I have attached visual studio to the running process on the server and confirmed that the postback is firing but the click handler never gets called.

Below is my web.config along with the page and code behind.

Default.aspx

<%@ Page Language="VB" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="BIR_Injuries._Default" %>

<!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>
    <link rel="Stylesheet" type="text/css" href="Styles/main.css" />
</head>
<body>
    <form id="form1" runat="server">
    <div id="wrap">
        <div id="divFields" runat="server">
            <hr />
            <telerik:RadTextBox ID="rtb_ID" Visible="false" runat="server"></telerik:RadTextBox>
            <table cellspacing="3" cellpadding="3" border="0">
                <tr>
                    <td valign="top">&nbsp;</td>
                    <td valign="top">
                        <asp:button id="RadButton1" runat="server" text="Submit" AutoPostBack="true" CausesValidation="false" OnClick="RadButton1_Click"></asp:button>
                    </td>
                </tr>
            </table>
        </div>
        <div id="divSent" runat="server">
            <p>Your injury assessment has been submitted. <asp:HyperLink ID="hlSendAnother" runat="server" NavigateUrl="~/Default.aspx" Text="Send another"></asp:HyperLink>.</p>
        </div>
    </div>
    </form>
</body>
</html>

Default.aspx.vb

Imports Telerik.Web.UI
Imports System.Net
Imports System.Net.Mail
Imports System.Data.SqlClient
Imports System.Configuration

Partial Class _Default

    Inherits System.Web.UI.Page

    Public Testing As Boolean = False

    Protected Sub Default_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
        divSent.Visible = False
        If Request.QueryString("iid") IsNot Nothing Then
            rtb_ID.Text = Request.QueryString("iid")
        Else
            rtb_ID.Text = Guid.NewGuid.ToString
        End If
        If Testing Then
            rtb_Event.Text = "Test"
            rdp_Date.SelectedDate = "01/01/2001"
            rtb_Email.Text = "[email protected]"
            rtb_RespondingAT.Text = "Responding AT"
        End If
    End Sub


    Protected Sub RadButton1_Click(sender As Object, e As EventArgs) Handles RadButton1.Click
        Page.Validate()
    End Sub
End Class

web.config

<?xml version="1.0"?>
<configuration>
    <configSections>
        <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
            <section name="BIR_Injuries.My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
        </sectionGroup>
    </configSections>
    <connectionStrings>
    <!--<add name="birinjury" providerName="System.Data.SqlClient" connectionString="Data Source=smcdevprtl01;Initial Catalog=BaylorInjuryForm_Dev;User ID=birinjury;Password=#password#;" />-->
    <add name="birinjury" providerName="System.Data.SqlClient" connectionString="Data Source=10.9.5.111;Initial Catalog=BaylorInjuryForm;User ID=birinjury;Password=#password#;"/>
    </connectionStrings>
    <appSettings>
        <add key="Telerik.Skin" value="WebBlue"/>
        <add key="Telerik.ScriptManager.TelerikCdn" value="Disabled"/>
        <add key="Telerik.StyleSheetManager.TelerikCdn" value="Disabled"/>
        <add key="EmailFrom" value="[email protected]" />
        <add key="EmailCC" value="[email protected]" />
        <add key="EmailTo" value="[email protected]" />
        <add key="SMTPServer" value="172.23.0.71" />
    </appSettings>
    <system.web>
        <customErrors mode="Off"/>
        <compilation debug="true" strict="false" explicit="true" targetFramework="4.0">
        </compilation>
        <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
            <controls>
                <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI"/>
            </controls>
        </pages>
        <httpHandlers>
            <add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false"/>
            <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false"/>
            <add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false"/>
            <add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false"/>
            <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false"/>
        </httpHandlers>
        <httpModules>
            <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule"/>
            <add name="RadCompression" type="Telerik.Web.UI.RadCompression"/>
        </httpModules>
        <httpRuntime maxRequestLength="5120" executionTimeout="120"/>
    </system.web>
    <system.webServer>
        <validation validateIntegratedModeConfiguration="false"/>
        <modules runAllManagedModulesForAllRequests="true">
            <remove name="RadUploadModule"/>
            <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" preCondition="integratedMode"/>
            <remove name="RadCompression"/>
            <add name="RadCompression" type="Telerik.Web.UI.RadCompression" preCondition="integratedMode"/>
        </modules>
        <handlers>
            <remove name="ChartImage_axd"/>
            <add name="ChartImage_axd" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" preCondition="integratedMode"/>
            <remove name="Telerik_Web_UI_SpellCheckHandler_axd"/>
            <add name="Telerik_Web_UI_SpellCheckHandler_axd" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" preCondition="integratedMode"/>
            <remove name="Telerik_Web_UI_DialogHandler_aspx"/>
            <add name="Telerik_Web_UI_DialogHandler_aspx" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" preCondition="integratedMode"/>
            <remove name="Telerik_RadUploadProgressHandler_ashx"/>
            <add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" preCondition="integratedMode"/>
            <remove name="Telerik_Web_UI_WebResource_axd"/>
            <add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode"/>
        </handlers>
        <security>
            <requestFiltering>
                <requestLimits maxAllowedContentLength="5242880"/>
            </requestFiltering>
        </security>
    </system.webServer>
</configuration>
1

There are 1 answers

0
TheAlbear On

Two small things I can recommend to try remove the AutoPostBack="true" from the button and give the form a action attribute.

As IIS 6 can have an issue if the action is not set or it is set to action='#'