Reputation: 8135
I use ASP.NET Master Page to organize reusable site elements and common styling. In other pages, I declare MasterPageFile="~/Site.master"
.
My problem is that I use a CSS file in the master page, I thought that my other pages would be able to use that CSS file without declaring it again, but I couldn't :(
Can anybody tell me what i did wrong?
Upvotes: 0
Views: 207
Reputation: 24093
The child pages that uses that master page have access to to css file. You can assure that by open your child page using your browser and view source. There you'll see the link tag to your css file.
I think the problem is that in your css file you used the element ids. The problem is that wrapping the page with master page changes the ids of the elements.
Chack that.
Upvotes: 1
Reputation: 43523
It probably because the css linked in your master file is using relative path. And the relative path becomes incorrect when your page file uses the master file. You need to make sure the css file's path is relative to the page file.
Upvotes: 0