Search code examples
c#asp.netwebformsdopostback

how to: get rid of __doPostBack from link buttons?


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


Solution

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