1

我需要帮助如何修复我的代码中的错误。当我编译代码时告诉我错误验证(XHTML 1.0 过渡):元素“html”不能嵌套在元素“div”中。如果有人知道,请帮助我?

 <%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ManageUsers.aspx.cs" Inherits="probazaadmin.ManageUsers" %>
    <asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
    <title>Untitled Page</title>
    </head>
    <body>
    <form id="form2" runat="server"></form>
    <div>Users Account Management</div>
    <p></p>
    <b>- The total registered users is: <asp:Literal runat="server" ID="lblTotalUsers" /><br />
    - The total online users at this moment: <asp:Literal runat="server" ID="lblOnlineUsers" /></b>
    <p></p>
    In order to display all users whose name begins with letter click on the link letter:
    <p></p>

    <asp:Repeater runat="server" ID="rptAlphabetBar"
    OnItemCommand="rptAlphabetBar_ItemCommand">
    <ItemTemplate><asp:LinkButton ID="LinkButton1" runat="server" Text='<%# Container.DataItem %>'
    CommandArgument='<%# Container.DataItem %>' />&nbsp;&nbsp;
    </ItemTemplate>
    </asp:Repeater>
    <p></p>
    Use the below feature to search users by partial username or e-mail:
    <p></p>

    <asp:DropDownList runat="server" ID="ddlUserSearchTypes">
    <asp:ListItem Text="UserName" Selected="true" />
    <asp:ListItem Text="E-mail" />
    </asp:DropDownList>
    contains
    <asp:TextBox runat="server" ID="txtSearchText" />
    <asp:Button runat="server" ID="btnSearch" Text="Search"
    OnClick="btnSearch_Click" />
    </body></html>
    </asp:Content>
4

2 回答 2

3

您的代码显示您是:

    <%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master"....
  1. 使用母版页(HTML 声明所在的位置)

    <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    
  2. 使用内容页面占位符来添加整个 HTML 文档——你不应该这样做。

    • 如前所述,母版页是 HTML 声明所在
    • ASP.net 内容部分仅用于内容。
于 2012-05-07T23:38:16.893 回答
0

你的代码应该是这样 <%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ManageUsers.aspx.cs" Inherits="probazaadmin.ManageUsers" % > 用户账户管理

- 注册用户总数为:
- 目前在线用户总数:

要显示名称以字母开头的所有用户,请单击链接字母:

<asp:Repeater runat="server" ID="rptAlphabetBar"
OnItemCommand="rptAlphabetBar_ItemCommand">
<ItemTemplate><asp:LinkButton ID="LinkButton1" runat="server" Text='<%# Container.DataItem %>'
CommandArgument='<%# Container.DataItem %>' />&nbsp;&nbsp;
</ItemTemplate>
</asp:Repeater>
<p></p>
Use the below feature to search users by partial username or e-mail:
<p></p>

<asp:DropDownList runat="server" ID="ddlUserSearchTypes">
<asp:ListItem Text="UserName" Selected="true" />
<asp:ListItem Text="E-mail" />
</asp:DropDownList>
contains
<asp:TextBox runat="server" ID="txtSearchText" />
<asp:Button runat="server" ID="btnSearch" Text="Search"
OnClick="btnSearch_Click" />
</asp:Content>
于 2016-02-10T12:00:26.193 回答