allanmark
asked on
Difficulty loading style sheet into ASP.Net sub pages
Greetings all
I have a MasterPage (See attached snippet). I have created a subpage from that and want to add a stylesheet (specfic to this page only, hence I only do it here).
My code:
<asp:Content ID="Content1" ContentPlaceHolderID="Cont entPlaceHo lder1" Runat="Server">
<link rel="stylesheet" type="text/css"
href="CSS_Sheets/DefaultPa geOnly.css " />
<div id="leftnav">
<p>
.....................
It looks Ok to me, but I am getting "Error 1 Cannot switch views: Validation (Internet Explorer 6): Element 'link' cannot be nested within element 'div'. ......
What is the correct and best way to do this?
In advance, thanks!
allanmark
I have a MasterPage (See attached snippet). I have created a subpage from that and want to add a stylesheet (specfic to this page only, hence I only do it here).
My code:
<asp:Content ID="Content1" ContentPlaceHolderID="Cont
<link rel="stylesheet" type="text/css"
href="CSS_Sheets/DefaultPa
<div id="leftnav">
<p>
.....................
It looks Ok to me, but I am getting "Error 1 Cannot switch views: Validation (Internet Explorer 6): Element 'link' cannot be nested within element 'div'. ......
What is the correct and best way to do this?
In advance, thanks!
allanmark
<div id="container" >
<div id="header">
<!-- Header start -->
<h1>Scribblers</h1>
<asp:Image ID="headerPict" runat="server" CssClass="headerPic" ImageUrl="~/Graphics/Book02.jpg" />
<center><ul id='menu'>
<li ><a href='<%=ResolveUrl("Default.aspx")%>' id='menuHome' >Home</a></li>
<li ><a href='<%=ResolveUrl("~/Pages_Story_Script/Stories.aspx")%>' id='menuStories' >Stories</a></li>
</ul>
</center>
<!-- Header end -->
</div>
<div id="body">
<!-- Body start -->
<div id="dummy" style="position:relative; height: 120px"></div>
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
</asp:contentplaceholder>
<!-- Give a little space -->
<div style="height:10px"></div>
<!-- Body end -->
</div>
<div id="footer">
<!-- Footer start -->
<hr align="center" color="Black" width="75%" />
<label class="smallerFontSize">Copyright Scribblers @ 2008</label>
<!-- Footer end -->
</div>
</div>
</form>
</body>
</html>
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Did this:
<head id="Head1" runat="server">
<title>Scribbles(2) Master</title>
<link rel="stylesheet" type="text/css"
href="CSS_Sheets/Scribble. CSS" />
<asp:contentplaceholder id="ccsPlaceHolderr" runat="server" />
</head>
Got this:-
Error 1 Unrecognized tag prefix or device filter 'asp'.
What have I missed?
<head id="Head1" runat="server">
<title>Scribbles(2) Master</title>
<link rel="stylesheet" type="text/css"
href="CSS_Sheets/Scribble.
<asp:contentplaceholder id="ccsPlaceHolderr" runat="server" />
</head>
Got this:-
Error 1 Unrecognized tag prefix or device filter 'asp'.
What have I missed?
ASKER
ThankYou!!
ASKER
What do I have to put in?
Also, won't that style sheet then be available/loaded into all content pages?
oops ... I see that the beginning part of my Master source was chopped off - re-attached below.
allanmark
Open in new window