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