Saturday, 30 August 2008

ASP.NET LinkButton without JavaScript

If you use ASP.NET LinkButton controls, the client browser must have JavaScript enabled. If JavsScript is disabled, clicking on the link won't cause a postback. To avoid this scenario, use standard Button controls and style them to look like hyperlinks.

<asp:Button runat="server" CssClass="HyperlinkButton" Text="Submit" />

background: none;
border: none;
cursor: pointer;
text-align: left;

text-decoration: underline;


Rem said...

Your blog is very nice...
visit my blog example

Anonymous said...

Exactly what I was looking for. Thanks!

Anonymous said...

:Hover does not work on button

Andrew Gunn said...

I thought it did!? If you send me the CSS and HTML for the button, I'll have a look.

Anonymous said...

Seems to me that hover works on Firefox, but not in Internetexplorer.
I am looking for a way to make the cursor a hand as on a real link, but that doesnt work...