Rounded corner button ASP.NET

I want to use a rounded corner button in an asp.net application. Do we have something in ASP.NET 3.5 that helps us make a rounded corner button?

+4
source share
4 answers

Here is the control and css that I use. My button is square, but that's not the point. You can create a rounded image yourself.

alt text

alt text

<asp:LinkButton ID="lbtnSignIn" class="button" runat="server" OnClick="lbtnSignIn_Click"><span>Sign In</span></asp:LinkButton> .button { background: transparent url('../../Images/ButtonLeft.gif') no-repeat top left; display: block; float: left; line-height: 11px; /* 21px (Button Background) = 5px (padding-top) + 11px (font-size) + 5px(padding-bottom) */ height: 21px; /* Button Background Height */ padding-left: 9px; text-decoration: none; font-weight: bold; color: white; font-size: 11px; } a:link.button, a:visited.button, a:active.button { color: white; text-decoration: none; margin-right: 10px; } a.button:hover { background-position: bottom left; } a.button span, a.button span { background: transparent url('../../Images/ButtonRight.gif') no-repeat top right; display: block; padding: 5px 9px 5px 0; /*Set 9px below to match value of 'padding-left' value above*/ } a.button:hover span { background-position: bottom right; color: white; } 
+3
source

You can use the ajax toolkit with a rounded angular expander. Personally, I have never used it in a project. I use css3 radius and just let IE users live with square borders until their browser catches up ( http://www.cssportal.com/css3-rounded-corner )

Here is a link to a sample control expander. http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/RoundedCorners/RoundedCorners.aspx

+3
source

How about applying CSS style to your button?

Code sample, demo, tutorial in Oscar Alexander

Using the code there, you can ensure that all buttons get the style exactly the way you want.

+1
source

As p.cambell told you, tecnique works fine on this link: http://www.oscaralexander.com/tutorials/how-to-make-sexy-buttons-with-css.html

But you must replace the "button" server control with the HyperLink control server, this is because css is applied to the "a" tag.

So, in Visual Studio, draw a button instead, draw HyperLink with Cssclass = "button"

Bye!

+1
source

All Articles