Note that there are some explanatory texts on larger screens.

plurals
  1. POajax update panel - imagebutton and button behaving differently?
    text
    copied!<p>I have an ajax panel (actually it' a Rad Ajax Panel - the behavior is similar to an Ajax Update Panel with everything in the ContentTemplate section and no Triggers), with an image button (asp:ImageButton) and a button (asp:Button).</p> <p>I notice that they behave differently - the image button advances to postback (Page_Load and Button_Click server functions), when the button doesn't!</p> <p>How can I achieve this behavior with the Button too? (Replacing the Button with an ImageButton solved the problem... Is there a way to maintain the Button and have the ImageButton's behavior?)</p> <hr/> <p>This is what my code looks like (two buttons, two click functions, and two client click functions):</p> <pre><code>&lt;telerik:RadScriptManager ID="RadScriptManager1" runat="server"&gt; &lt;/telerik:RadScriptManager&gt; &lt;div style="width: 800px;"&gt; &lt;telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1"&gt; &lt;telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"&gt; &lt;script type="text/javascript"&gt; function validateSave() { // ... return true; } function validateAdd() { // ... return true; } &lt;/script&gt; &lt;/telerik:RadScriptBlock&gt; &lt;asp:Panel ID="Panel1" runat="server" Visible="false"&gt; &lt;fieldset&gt; &lt;legend&gt;New item&lt;/legend&gt; &lt;%--..........--%&gt; &lt;asp:ImageButton ID="Button4" runat="server" ImageUrl="~/App_Themes/ThemeDefault/images/add.gif" OnClientClick="return validateAdd();" OnClick="Button4_Click" /&gt; &lt;/fieldset&gt; &lt;%--..........--%&gt; &lt;asp:Button ID="Button2" runat="server" OnClientClick="return validateSave();" Text="Save" ToolTip="Save" OnClick="Button2_Click" /&gt; &lt;/asp:Panel&gt; &lt;/telerik:RadAjaxPanel&gt; &lt;telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"&gt; &lt;/telerik:RadAjaxLoadingPanel&gt; &lt;/div&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload