开发者

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=&开发者_StackOverflowquot;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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜