Click here to Skip to main content
16,020,714 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to call this css on asp button
button.greyroundedbtn span {
background: transparent url(../images/btn_left.png ) no-repeat scroll left top;
color: #000000;
font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px;
}
Posted
Updated 5-May-11 1:25am
v2
Comments
ZeeroC00l 5-May-11 7:24am    
You mean to say, on button click you want the css file to be imported/included ?
kumar_rajeev7 6-May-11 4:44am    
no, i want to call given class in asp button as class="name of class" but the given class does not completety call,i.e.picture on button does not come as we specify the path of image in class
ZeeroC00l 6-May-11 5:39am    
What do you mean by "does not completely call" and "does not come as we specify the path of image in class" ?
You need to make your points more clear..
Sandeep Mewara 5-May-11 7:27am    
not clear

1 solution

Hi,

If you want to change the Style Sheet attached to a page on button click then i would suggest you make use of a small JS function. That should do the trick for you.

Link To the CSS
HTML
<link id="defaultStyle" href="styleSheet1.css" media="all" type="text/css" rel="stylesheet" />


Add this to your javascript Module.
Java
function changeStyleSheet( styleSheetName ){
    document.getElementById( "defaultStyle" ).href= styleSheetName ;
    } 


<input type="button" value="styleSheetName.css"  onclick="changeStyleSheet( this.value )" />


BR//
Harsha
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900