Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to stop postback in image button
    primarykey
    data
    text
    <p>How to avoid the post back in Image button.I tried this way but on clicking the image button my text box is not showing.</p> <p>My issue is ->image button is doing a postback on each click .For avoiding that i tried to use java script as below.On click of button i want to show a <strong>textbox</strong> which have lot of functionalities in TextBox1_TextChanged event.But it is not working...</p> <pre><code>&lt;asp:ImageButton ID="ImageButton1" runat="server" OnClientClick="return ValidNum();" onClick="ImageButton1_Click" Height="52px" ImageUrl="search1.png" style="margin-right: 0px" Width="126px" /&gt; &lt;script&gt; function ValidNum() { return false; } &lt;/script&gt; </code></pre> <p>And in code behind i have</p> <pre><code> Protected Sub ImageButton1_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click TextBox1.Visible = True End Sub </code></pre> <p><strong>EDIT</strong> Now i changed my code as below but-BC30456: 'return' is not a member of 'ASP.about_aspx' ERROR is showing</p> <pre><code> &lt;asp:ImageButton ID="ImageButton1" runat="server" OnClientClick="return ValidNum();" onClick="return showBox();" Height="52px" ImageUrl="~/search1.png" style="margin-right: 0px" Width="126px" /&gt; &lt;script&gt; function showBox() { var theControl = document.getElementById("&lt;%=Textbox1.ClientID %&gt;"); theControl.style.display = ""; } </code></pre> <p></p> <pre><code>&lt;script&gt; function ValidNum() { return false; } &lt;/script&gt; </code></pre> <p>Thank You</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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