如何:从链接按钮中删除 __doPostBack?
例如:
这段代码:
<asp:LinkButton ID="SignInLinkButton" runat="server" CssClass="SignInLinkButton" TabIndex="3" OnClick="AuthorizeUser">SignIn</asp:LinkButton>
在状态栏中显示为链接:
javascript:__doPostBack('ctl00$ctl00$GlobalPageContentPlaceHolder$ManagePageContentPlaceHolder$SignInLinkButton','')
有机会摆脱这种丑陋吗?还是有更好的方法来做到这一点,不会产生这种疯狂?
我搜索过,但没有找到答案,所以链接也很酷。 谢谢
for example:
this code:
<asp:LinkButton ID="SignInLinkButton" runat="server" CssClass="SignInLinkButton" TabIndex="3" OnClick="AuthorizeUser">SignIn</asp:LinkButton>
shows this as link in status bar:
javascript:__doPostBack('ctl00$ctl00$GlobalPageContentPlaceHolder$ManagePageContentPlaceHolder$SignInLinkButton','')
is there a chance o get rid of this ugliness? or is there a better way of doing this, that does not generate this insanity?
i searched, but did not find an answer, so links are also cool.
thnx
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在浏览器状态中显示文本鼠标悬停在 LinkButton 上时的栏
基本上,您需要添加
onmouseover="window.status='text to display in status bar'; return true;"
和onmouseout ="window .status=''; return true;"
链接。本文向您展示了如何做到这一点,甚至为您制作了一个自定义控件。或者,您可以将按钮设置为看起来像链接(如果您只想删除文本)。
这是一个示例,但可能还有其他示例方法。
Displaying Text in the Browser's Status Bar When Mousing Over a LinkButton
Basically you need to add
onmouseover="window.status='text to display in status bar'; return true;"
andonmouseout ="window.status=''; return true;"
to the link. The article shows you how to do it, and even makes a custom control for you.Alternatively, you can style a button to look like a link (if you just want to get rid of the text).
Here's one example of doing it, but there might be other methods.
按照格雷格说的做,但也要重命名您的内容占位符以使其更小。
这些长名称被添加到页面上每个控件的名称前面。
当您有很多控制权时,它们会不必要地占用带宽。
我的名字总是长 3 个字母。
Do what Greg says, but also rename your contentplaceholders to make them smaller.
Those long names are prepended to the name of each control on the page.
They take up bandwidth unnecessarily when you have a lot of controls.
I always name mine 3 letters long.