How to get any asp: LinkButton to look like a button

I need a hyperlink that looks like a standard button. I tried using LinkButton, but can't make it look like a button. It seems to always look like a hyperlink. I do not want to set an image for this.

Any ideas?

+4
source share
4 answers

you can do it via css.

<asp:LinkButton ID="linkButton" CSSClass="btn" runat="server"></asp:LinkButton> 

also define the following class in your css.

 .btn{ text-decoration:none; border:1px solid #000; } 
+4
source

Use css for this ... e.g.

 <asp:LinkButton ID="LnkButtion" CssClass="buttonClass" runat="server" Text="Button" /> 

Here you can specify your own colors.

 .buttonClass { padding: 2px 20px; text-decoration: none; border: solid 1px Green; background-color: #ababab; } .buttonClass:hover { border: solid 1px Black; background-color: #ffffff; } 
+5
source

<asp:Button OnClick="submit" Text="Submit" runat="server" />

+1
source

This worked for me:

 <a href="mypage.aspx?param1=1" style="text-decoration:none;"> <asp:Button PostBackUrl="mypage.aspx?param1=1" Text="my button-like link" runat="server" /> </a> 

style="text-decoration:none;" used to remove underload: Remove underscore with href attribute

0
source

All Articles