Click here to Skip to main content
15,941,828 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hai friends
i have web page which is derived from the master page.In that web page i placed asp.net menu control.how can i use external css file to this menu control .I am assigning css file to the menu control in the cssclass property.but it doesnt work fine and how can use external css file to the derived web page.please help me.
thank you
Posted
Updated 13-Jul-12 21:54pm
v2

use this
<link rel="Stylesheet" type="text/css" href="<PATH of the css file>" />
in the head tag of your .aspx page
 
Share this answer
 
Comments
baskaran chellasamy 14-Jul-12 4:04am    
yes.i have applied.but it does not work fine.
what i have done is
css file name:content.css
i have applied this to the derived webpage(like main.aspx)at contentplaceholder which id=head.
<link rel="stylesheet" type="text/css" href="~/content.css" />
but still it doesnt work
<link rel="stylesheet" type="text/css" href="~/content.css" /> but still it doesnt work
Sounds like it is relative path issue. At times, after deployment the path referenced as a source for images, stylesheets, etc is not correctly formed. This leads to no file found at the location referred because of which images don't download or style-sheets does not get applied.
You would need to make sure that the path is correct such that file is found and used.

I would suggest you to use this Tip and resolve the path correctly before setting the source of the file: Resolving Paths in a Multi-Folder WebSite[^]
 
Share this answer
 
Comments
baskaran chellasamy 14-Jul-12 4:30am    
sorry for my another question regarding with this.
The style is appeared in the menu control at designing time but it disappear at when running the application. please let me know what would be the problem for this issue.
thanks
Sandeep Mewara 14-Jul-12 6:40am    
Is the previous issue resolved? If so, you should mark this as an answer for future reference.

About mismatch in design & runtime, you cannot help it. It's by design and will be as is.

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