Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET LinkButton - How to Hide javascript_doPostBack?

<asp:LinkButton ID="cartLink" runat="server" Text="<b>Add to Cart</b>" 
    ToolTip="Add to cart" CommandName="Add" 
        CommandArgument='<%# Eval("ProductID") %>' />

View Source:

    <a id="ContentPlaceHolder1_productsList_cartLink_0" 
        title="Add to cart" 
        href="javascript:__doPostBack(&#39;ctl00$ContentPlaceHolder1$productsList$ctrl0$cartLink&#39;,&#39;&#39;)">
        <b>Add to Cart</b></a>

When hovering over a LinkButton I cannot lose the ugly javascript:_doPostBack(...) link status message that appears at the bottom of the browser.

Is it possible to suppress this?

UPDATE 05-11-2011:

I realize this is default behavior and most times I hardly notice it. However, it's only a problem in IE9 when the status bar is not showing (which is the default). Anyone know of a working hack to fix this?

like image 603
IrishChieftain Avatar asked May 10 '11 03:05

IrishChieftain


1 Answers

If you're referring to the Javascript status message that displays in the bottom left of most browser windows, try setting the onMouseOver value.

<asp:LinkButton ID="cartLink" onMouseOver="JavaScript:window.status='Yo, I'm the Javascript status text!'; return true" onMouseout="JavaScript:window.status=''; return true" runat="server" Text="<b>Add to Cart</b>" ToolTip="Add to cart" CommandName="Add" CommandArgument='<%# Eval("JOBProductIDName") %>' />  

See this page for more info.

like image 70
Dhaust Avatar answered Sep 30 '22 00:09

Dhaust