This is a migrated thread and some comments may be shown as answers.

Decorated button not firing server side event in IE6

4 Answers 60 Views
FormDecorator
This is a migrated thread and some comments may be shown as answers.
Waylon Campbell
Top achievements
Rank 1
Waylon Campbell asked on 25 Sep 2009, 04:47 PM
I have a decorated button on a page with UseSubmitBehavior="false", an OnClientClick event, and an onclick event.  The button will not fire the server side event if the user is using IE6.  The code below has 2 buttons.  The first button is decorated, although the text color is not correct, and should fire a client and server event but does not fire the server event.  The second button is not decorated and works as expected.

Everything works in IE7 or higher, but unfortunately I have some users that must use IE6.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="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
</head> 
<body> 
    <form id="form1" runat="server"
        <asp:ScriptManager ID="scriptman" runat="server"></asp:ScriptManager> 
        <telerik:RadFormDecorator ID="RadFormDecorator1" Runat="server" Skin="Web20" DecoratedControls="Buttons" DecorationZoneID="decorationZone" /> 
        <div id="decorationZone"
            <asp:Button ID="btnSubmit1" runat="server" Text="Submit"  
                UseSubmitBehavior="false" OnClientClick="SubmitOnlyOnce(this, false)"  
                onclick="btnSubmit1_Click" /> 
        </div> 
        <div>                 
            <asp:Button ID="btnSubmit2" runat="server" Text="Submit"  
                onclick="btnSubmit2_Click"   
                UseSubmitBehavior="false" OnClientClick="SubmitOnlyOnce(this, false)"  /> 
        </div>                 
            <br />                 
            <asp:Label ID="lblMsg" runat="server"></asp:Label>                               
        </div>   
    </form> 
     
    <script type="text/javascript"
        function SubmitOnlyOnce(control, validatorsExist) { 
            var msg = "Please wait..."
            var btn = $get(control.id); 
 
            if (validatorsExist) { 
                if (Page_ClientValidate()) { 
                    Telerik.Web.UI.RadFormDecorator.set_enabled(btn, false); 
                    control.value = msg
                } 
            } 
            else { 
                Telerik.Web.UI.RadFormDecorator.set_enabled(btn, false); 
 
                control.value = msg
            } 
        }    
    </script> 
</body> 
</html> 
 


4 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 26 Sep 2009, 08:41 AM
Hi Waylon,

The reason for this behavior is that the when set_enabled() is set to false (as a second parameter) it disables the original button - in such case IE6 will not continue with the postback, which is the expected behavior.
Could you please tell us what is the exact scenario? Changing the text and disabling the button is usually used only when there is Ajax involved - e.g. in such case, you want to prevent the users from clicking the button multiple times. If this is the real scenario, I suggest using the client events of the RadAjaxManager and to disable the button after the Ajax request is initiated. If you want to keep your current setup however, the only way to overcome that is not to disable the button with set_enabled() in your code and to just change the text.


Kind regards,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Waylon Campbell
Top achievements
Rank 1
answered on 28 Sep 2009, 02:26 PM
I am trying to prevent the users from clicking the button twice.  In this particular case, the user clicks a button to initiate server side processing and validation.  The user is then redirected to another page server side.  Will the AjaxManager allow for this scenario? 

I'm new to the Telerik controls but it looks like you have to define the controls to updated with the AjaxManger.  Does this mean that I would need to define all of the controls on my page in the AjaxManager?

If as you say the button is disabled and IE6 does not continue with the postback, why does the non-decorated button work as I need it to?
0
Accepted
Georgi Tunev
Telerik team
answered on 01 Oct 2009, 11:19 AM
Hi Waylon,

I see that I did not provide enough information in my previous response - sorry about that. What I meant was that the problem is actually in IE6 and it seems to be fixed in the newer versions of the browser - the code that we are using for disabling the buttons with RadFormDecorator is the same in all browsers.
As for your second question, yes, you could use RadAjaxManager in such scenario. For convenience I attached a small sample that shows a possible implementation - I added the alert for demo purposes only, so you can remove it.


All the best,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Waylon Campbell
Top achievements
Rank 1
answered on 01 Oct 2009, 05:34 PM
Thanks Georgi.  That's exactly what I needed.
Tags
FormDecorator
Asked by
Waylon Campbell
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Waylon Campbell
Top achievements
Rank 1
Share this question
or