4

The following code working fine for my working environment. But for my client, 'Onclick 'event doesn't fire. If we remove UseSubmitBehavior='false' and OnclientClick event from the page ,it is working fine for them. My Question is what is the cause of this problem. Is its because of browser settings or something? I dont know why its not firing. Please help me.

 <asp:ToolkitScriptManager  ID="ToolkitScriptManager1" AsyncPostBackTimeout="10000"
    runat="server">
</asp:ToolkitScriptManager>
<asp:Panel ID="Panel1"  runat="server">
    <table>
        <tr>
            <td align="left">
                UserName:
                <asp:TextBox ID="tbUserName" Width="150px" runat="server" ></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvUser" runat="server" ErrorMessage="Required" ControlToValidate="tbUserName"
                    ValidationGroup="validate"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td align="left">
                Password:
                <asp:TextBox Width="150px" ID="tbPassword" 
                    runat="server" TextMode="Password" ></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvPassword" runat="server" ErrorMessage="Required"
                    ControlToValidate="tbPassword" ValidationGroup="validate"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr id="rowCaptcha" runat="server">
            <td>
                <table style="margin-left: 30px">
                    <tr>
                        <td>
                            <telerik:radcaptcha errormessage="Please enter valid code" validatedtextboxid="tbRadcaptcha"
                                captchatextboxlabelcssclass="textBox" id="RadCaptcha1" captchaaudiolinkbuttontext=""
                                enablerefreshimage="true" captchaimage-renderimageonly="true" validationgroup="group"
                                runat="server"></telerik:radcaptcha>

                        </td>
                    </tr>
                    <tr>
                        <td align="left">
                            <asp:Label ID="Label5" runat="server"  Text="Type the above code in text box"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td align="left">
                            <asp:TextBox runat="server" ValidationGroup="group" ID="tbRadcaptcha"></asp:TextBox>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td align="left">
                <br />
                <asp:Button ID="btLogin" runat="server" Style="margin-left: 80px" UseSubmitBehavior="false"
                    OnClientClick="this.disabled=true" ValidationGroup="group" Text="Login" OnClick="btLogin_Click" />
            </td>
        </tr>
    </table>
</asp:Panel>

EDIT: This code is working fine for ie8,ie9 and ie10 in our local environment. But for my client this is not working who used ie8 and ie10(they don't use ie9). Is there any settings changed in their browser? Advance Thanks...

Suresh
  • 466
  • 2
  • 9
  • 26

1 Answers1

1

Yes, there might be client side issues caused by server side .NET frameworks which are not "up to date".

See for example : http://www.hanselman.com/blog/BugAndFixASPNETFailsToDetectIE10CausingDoPostBackIsUndefinedJavaScriptErrorOrMaintainFF5ScrollbarPosition.aspx

You should ask your client for the HTML source code of the page.

Ensure that :

  • it contains a call to __dopostback concatenated to your this.disabled=true from the onclick event
  • the generated code for the __dopostback function is the same on your working environment with the same browser
  • if it differs, your client might have missed some updates
jbl
  • 15,179
  • 3
  • 34
  • 101
  • +1 Thanks jbl. Its really helpful for me.Im not going to change the browser definition files. I just going to remove 'Usesubmitbehaviour' and 'OnClientClick'. But I will use your fix to my next project. Thanks again. – Suresh Feb 14 '13 at 11:22
  • For ie8 and ie10, the above code working fine in our environment. But it is not working my client who is used ie8 and ie10. I dont know the exact cause. Please help me. – Suresh Feb 14 '13 at 12:12
  • @Suresh could this be a problem of compatibility mode, activated or not ? – jbl Feb 14 '13 at 14:34
  • Yes their browser running with compatabile mode. Is this a problem? – Suresh Feb 16 '13 at 03:44