views:

142

answers:

2

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

+7  A: 

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;" and onmouseout ="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.

Greg
when you say "style a button to look like a link", do you mean use a <asp:Button instead of <asp:LinkButton? then this "__doPostBack" text would be gone?
b0x0rz
Yes, that's what I meant. You don't see anything when you hover over an asp:Button, and clicking it will still post back. Plus you have the benefit of not relying of javascript.
Greg
+2  A: 

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.

Ed B
thnx for the name tip. i like to have these long names for development, but maybe they can be changed before deployment :)
b0x0rz