Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0 CSS3
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 13-Jul-12 21:40pm
Edited 13-Jul-12 21:54pm
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

use this
<link rel="Stylesheet" type="text/css" href="<PATH of the css file>" />
in the head tag of your .aspx page
  Permalink  
Comments
baskaran chellasamy at 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
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

<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[^]
  Permalink  
Comments
baskaran chellasamy at 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 at 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)

  Print Answers RSS
0 OriginalGriff 365
1 Nirav Prabtani 268
2 Richard Deeming 215
3 CHill60 170
4 _Amy 145
0 OriginalGriff 8,104
1 Sergey Alexandrovich Kryukov 7,045
2 Maciej Los 4,039
3 Peter Leow 3,738
4 CHill60 2,912


Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 14 Jul 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100