ASP.NET LinkBut​​ton - 如何隐藏javascript_doPostBack? [英] ASP.NET LinkButton - How to Hide javascript_doPostBack?

查看:76
本文介绍了ASP.NET LinkBut​​ton - 如何隐藏javascript_doPostBack?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

查看来源:

    <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>

当鼠标悬停在LinkBut​​ton上时,我不能丢失丑陋的javascript_doPostBack(...)链接状态消息显示在浏览器底部。

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

是否可以取消此操作?

UPDATE 05-11-2011:

我意识到这是默认行为,而且大多数时候我几乎没有注意到它。但是,当状态栏未显示时(默认情况下),这只是IE9中的问题。有人知道一个工作黑客来解决这个问题吗?

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?

推荐答案

如果您指的是底部显示的Javascript状态消息在大多数浏览器窗口左侧,尝试设置 onMouseOver 值。

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") %>' />  

参见此页面了解更多信息。

这篇关于ASP.NET LinkBut​​ton - 如何隐藏javascript_doPostBack?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆