在W3 Schools教程中使用ASP.NET?语法错误? [英] Using ASP.NET in W3 Schools Tutorial? Syntax Error?

查看:149
本文介绍了在W3 Schools教程中使用ASP.NET?语法错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.

我是asp.net的新手,但我知道html等CSS非常好,但是我不明白我在Visual Web Matrix中出了什么问题.这是我链接到的链接-点击我

我的主要默认页面的代码如下:

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:

 <%@ 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

<%@ 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>



我不明白我要去哪里哪里,我不断收到解析错误

解析器错误

说明:在解析服务于此请求所需的资源期间发生错误.请查看以下特定的解析错误详细信息,并适当地修改您的源文件.

解析器错误消息:在包含内容控件的内容页面中,仅直接允许内容控件.

源错误:


第1行:
第2行:<!DOCTYPE html>
第3行:< html>
第4行:< head>

源文件:/default.aspx行:2"



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 "

推荐答案

就设法解决了!认为我是正确的傻瓜!

我只需要放下

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

All i needed to was put

<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!


这篇关于在W3 Schools教程中使用ASP.NET?语法错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆