0

I am working on a private project for a client updating their CSS. This is built in asp. I am trying to build a submit button that is expandable much like this: http://www.oscaralexander.com/tutorials/how-to-make-sexy-buttons-with-css.html

The problem is the link looks like this:

<asp:Button runat="server" ID="SearchButton" CssClass="SearchButton" Text="" CausesValidation="false" OnClick="SearchButton_Click"/>

There are no A tags for me to do what is in the tutorial on the link about. They primarily run in IE 7 and 8 so I need to use images to accommodate this instead of CSS3.

Any insight?

Thanks very much :)

J

2 Answers2

1

You have a couple of options here.

First, even though the site is in Asp.net, you can still use standard client-side code. That would mean your html would end up looking very close to the tutorial. However, since the button is calling server-side code, you would need to handle that as a javascript event. This answer explains how to do that.

Second, you can do it in the existing attributes of the <asp:button> control. You can do all the styling from that tutorial as part of the CSS Class that you are creating, and in many cases with<asp:...> controls, you can also add the style="..." attribute. That said, I do not know off-hand if the style="..." attribute works on the <asp:button> control.

Community
  • 1
  • 1
Jeffrey Blake
  • 9,659
  • 6
  • 43
  • 65
  • I was able to add full image behind the live text however the word search will change based on the language option for the customer using it. This is where it needs to be expandable. – user1208105 May 09 '12 at 16:05
0

I think you can use the style exactly same if you use a linkbutton

<asp:LinkButton CssClass="button" ID="LinkButton1" runat="server" 
  onclick="LinkButton1_Click"><span>Bring world peace</span></asp:LinkButton>
huMpty duMpty
  • 14,346
  • 14
  • 60
  • 99
  • Unfortunately the Text="" tag inside of the asp code pulls in the text for the item. I did remove that for the example.. – user1208105 May 09 '12 at 19:23