Click here to Skip to main content
15,884,836 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Everyone.

I'm new to asp.net but I know html etc css very good, how ever I don't understand where I am going wrong in the Visual Web Matrix. This is the link I have got upto - Click me

My main default page has the coding:

ASP.NET
 <%@ Page Title="Home" MasterPageFile="Site.master" %>
<!DOCTYPE html>
<html>
<head>
  <title>ASP Web Forms Demo</title>
</head>

<body>
<asp:Content ID="Content" ContentPlaceHolderID="MainContent" runat="server">
  <h1>Welcome to W3Schools</h1> 
  <h2>Web Site Main Ingredients</h2>
  <p>A Home Page (Default.aspx)</p>
  <p>A Style Sheet (Site.css)</p>
  <p>A Layout File (Site.master)</p>
</asp:Content>
</body>

</html>


Now this is my master page

ASP.NET
<%@ Master Language="VB" %>
<!DOCTYPE html>
<html>
<head id="head" runat="server">
  <title></title>
  <link href="Site.css" rel="stylesheet">
</head>

<body>
<form id="form1" runat="server">
<div id="main">
<asp:ContentPlaceHolder ID="MainContent" runat="server"/>
<p>© <%=DateTime.Now.Year%> W3Schools. All rights reserved.</p>
</div>
</form>
</body>
</html>


I don't understand where I am going wrong, I keep getting a parse error

"Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Only Content controls are allowed directly in a content page that contains Content controls.

Source Error:


Line 1:
Line 2: <!DOCTYPE html>
Line 3: <html>
Line 4: <head>

Source File: /default.aspx Line: 2 "
Posted
Comments
Richard MacCutchan 15-Sep-13 4:10am    
Do you realise that W3Schools is a copyrighted identity?
Dholakiya Ankit 16-Sep-13 2:11am    
ya agree
Dholakiya Ankit 16-Sep-13 2:12am    
If you still want to use this one then you can use iframe attribute of html and then add src="your src to w3schools" :)

1 solution

Just managed to work it out! Think I'm a right dummie!

All i needed to was put

ASP.NET
<asp:content id="Content" contentplaceholderid="MainContent" runat="server" xmlns:asp="#unknown"></asp:content>


Actually around from the to the tag

Glad I solved that one!
 
Share this answer
 

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