I have a asp:Button, I used css styles with cssClass property in asp:Button
, but those styles are not working. When I use asp:LinkButton
those styles are working well.I don't want any themes or skins for styles.
This is my asp page:
<asp:Button CssClass="smallButton" Text="Sign In" runat="server" ID="submit"></asp:Button>
This is my CSS:
.smallButton
{
//styles
}
When I change asp:Button to asp:LinkButton
<asp:LinkButton Text="Sign In" runat="server" ID="submit" CssClass="smallButton"></asp:LinkButton>
or
<span class="smallButton"><asp:LinkButton Text="Sign In" runat="server" ID="submit"></asp:LinkButton></span>
styles are working well. Only problem with the asp:Button control
nobody wants to go to the clutter of using a class, try this:
Intellisense won't suggest it but it will get the job done without throwing errors, warnings, or messages. Don't forget the capital S in Style
If you have a button in asp.net design page like "Default.asp" and you want to create CSS file and specified attributes for a button,labels or other controller. Then first of all create a css page
now you have a css page now write these code in your css page(StyleSheet.css)
StyleSheet.css
Default.asp
{
}