or

|
args.set_cancel(true);
sender._invalid = true;
sender.updateCssClass();
How to get the same behavior through code-behind, so that i can avoid writing JavaScript ?<html xmlns="http://www.w3.org/1999/xhtml"><head id="Head1" runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <cc1:ABLDocumentDomain runat="server"> </cc1:ABLDocumentDomain> <div> <rad:RadAjaxManager ID="ctlAjaxMgr" runat="server"> <ClientEvents OnRequestStart="ABLControls_LockPage();" OnResponseEnd="ABLControls_UnlockPage();" /> <AjaxSettings> <rad:AjaxSetting AjaxControlID="ctlAjaxMgr"> <UpdatedControls> <rad:AjaxUpdatedControl ControlID="ctlCopy" LoadingPanelID="ctlLoadingPanel" /> </UpdatedControls> </rad:AjaxSetting> </AjaxSettings> </rad:RadAjaxManager> <%--Copy From Agency table--%> <table id="tblBoxHolder" cellspacing="2" style="border-right: #a9c6ee 2px solid; padding-right: 0px; border-top: #a9c6ee 2px solid; padding-left: 0px; padding-bottom: 0px; margin: 0px; border-left: #a9c6ee 2px solid; padding-top: 0px; border-bottom: #a9c6ee 2px solid; height: 1px;" width="50%"; align="center"> <tr> <%--Table Header--%> <td align="right" colspan="2" style="height: 10px; text-align: Center; vertical-align: middle; background-color: #a9c6ee; font-weight: bold;"> Copy Spec Sheets From Agency: </td> </tr> <tr> <%--From Agency label and combobox rows--%> <td class="style3"> Rep #: </td> <td style="width: 80%"> <rad:RadComboBox ID="ctlViewFromAgencyRepCombo" runat="server" AutoPostBack="true" AppendDataboundItems = "true" DataSourceID="odsRepNumFromAgency" DataTextField="REP_NUMBER" DataValueField="REP_NUMBER" Skin="ABL_Std" SkinsPath="~/RadControls/ComboBox/Skins" Width="320px" Height="200px" OnSelectedIndexChanged="ctlViewFromAgencyRepCombo_SelectedIndexChanged"> <Items> <rad:RadComboBoxItem Text="-- Select One --" Value="-1" /> </Items> </rad:RadComboBox> </td> </tr> <tr> <%--Copy To Agency table--%> <table id="Table2" cellspacing="2" style="border-right: #a9c6ee 2px solid; padding-right: 0px; border-top: #a9c6ee 2px solid; padding-left: 0px; padding-bottom: 0px; margin: 0px; border-left: #a9c6ee 2px solid; padding-top: 0px; border-bottom: #a9c6ee 2px solid; height: 1px;" width="50%", align="center";> <tr> <td align="right" colspan="2" style="height: 10px; text-align: Center; vertical-align: middle; background-color: #a9c6ee; font-weight: bold;"> Copy Spec Sheets To Agency: </td> </tr> <tr> <%--To Agency label and combobox rows (dependent on selected rep). DataID and binding info is in the codebehind.--%> <td class="style3"> Rep #: </td> <td style="width: 80%"> <rad:RadComboBox ID="ctlViewToAgencyRepCombo" runat="server" AutoPostBack="true" AppendDataboundItems = "true" Skin="ABL_Std" SkinsPath="~/RadControls/ComboBox/Skins" Width="320px" enabled="false" OnSelectedIndexChanged="CopyCheck" Height="200px"> <Items> <rad:RadComboBoxItem Text="-- Select One --" Value="-1" /> </Items> </rad:RadComboBox> </td> </tr> <%--Close and Copy buttons--%> </table> <br /> <br /> <table width="50%", align="center"> <tr> <td align="center"> <asp:Button ID="ctlCopy" runat="server" Text="Copy" Visible="True" style="width: 95px;" enabled="false" OnClick="ctlCopy_CopySpecSheets" /> <asp:Button ID="ctlClose" runat="server" Text="Close" Visible="True" style="width: 95px;" onclientclick="CloseForm()" /> </td> </tr> </table> <rad:AjaxLoadingPanel ID="ctlLoadingPanel" runat="server" Height="75px" MinDisplayTime="1000" Transparency="5" Width="75px"> <asp:Image ID="Image1" runat="server" AlternateText="Loading..." ImageUrl="~/Images_ABL_Std/Grid/loading.gif" /> </rad:AjaxLoadingPanel> </div>