7

I want a hyperlink that looks like a standard button. I have tried using a LinkButton but can't get it to look like a button. It always seems to stay looking like a hyperlink. I don't want to set an image to do this.

Any ideas?

Azhar
  • 20,500
  • 38
  • 146
  • 211
Mr Cricket
  • 483
  • 3
  • 10
  • 14

4 Answers4

9

Use css for this... like

<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;
}
abatishchev
  • 98,240
  • 88
  • 296
  • 433
Azhar
  • 20,500
  • 38
  • 146
  • 211
5

you can do it through 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; }
Adeel
  • 19,075
  • 4
  • 46
  • 60
1

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

thelost
  • 6,638
  • 4
  • 28
  • 44
0

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;" is used to remove underling: Removing underline with href attribute

Community
  • 1
  • 1
Andrej Adamenko
  • 1,650
  • 15
  • 31