tags:

views:

170

answers:

3

What is the best way to keep an asp:button from displaying it's URL on the status bar of the browser? The button is currently defines like this:

<asp:button id="btnFind" 
            runat="server" 
            Text="Find Info" 
            onclick="btnFind_Click">
</asp:button>

Update: This appears to be specific to IE7, IE6 and FF do not show the URL in the status bar

A: 

I use FF so never noticed this, but the link does in fact appear in the status bar in IE..

I dont think you can overwrite it :( I initially thought maybe setting the ToolTip (al la "title") property might do it.. Seems it does not..

Looking at the source, what appears is nowhere to be found, so I would say this is a browser issue, I don't think you can do anything in code.. :(

Update

Yeah, Looks like IE always posts whatever the form action is.. Can't see a way to override it, as yet..

Perhaps try explicitly setting it via JS?

Update II

Done some more Googleing. Don't think there really is a "nice" way of doing it.. Unless you remove the form all together and post data some other way..

Is it really worth that much? Generally this just tends to be the page name?

Rob Cooper
A: 

Do you mean LinkButton?

mmattax
This is with the asp:button control, not the LinkButton.
Chris Miller
A: 

I don't see a link, I see this:

javascript:__doPostBack('btn','');

EDIT: Sorry, was looking at a LinkButton, not an ASP:Button. The ASP:Button shows the forms ACTION element like stated.

But, if you are trying to hide the DoPostBackCall, the only way to do that is to directly manipulate window.status with javascript. The downside is most browsers don't allow this anymore.

To do that, in your page_load add:

btnFind.Attributes.Add("onmouseover","window.status = '';");
btnFind.Attributes.Add("onmouseout","window.status = '';");
FlySwat
What browser are you using? I tried in FF and got nothing, IE returned the parent FORM elements ACTION attribute.. I tried manually overriding the onmouse events to no avail.. Have you tested this?
Rob Cooper