Error on adding [removed] to master page

2019-08-30 05:38发布

I have a Master page that have these ContentPlaceHolder:

<asp:ContentPlaceHolder ID="title" runat="server">
    </asp:ContentPlaceHolder>
<asp:ContentPlaceHolder ID="contentTitle" runat="server" ></asp:ContentPlaceHolder>
        <asp:ContentPlaceHolder ID="content" runat="server">
        </asp:ContentPlaceHolder>

when I add these codes for jquery in<head> part of master page:

<script type="text/javascript" src="script/jquery-2.0.1.min.js" />
<link href="script/jquery.contextMenu.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="script/jquery.contextMenu.js" />

and create new aspx file that use that master page ;

<%@ Page Title="" Language="C#" MasterPageFile="~/Default.Master"    AutoEventWireup="true" CodeBehind="Bed.aspx.cs" Inherits="Zhotel.Lists.Bed" %>
<asp:Content ID="Content1" ContentPlaceHolderID="title" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentTitle" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="content" runat="server">
</asp:Content>

when I want to view Design part of file it show me this error:

enter image description here

and when I remove script tags then no more this error occurs.

How can I use script tag that this error not shown?

2条回答
老娘就宠你
2楼-- · 2019-08-30 06:27

Add </script> to end of jquery definition, like this:

<script src="script/jquery-2.0.1.min.js" type="text/javascript"></script>
<script src="script/jquery.contextMenu.js" type="text/javascript"></script>  
查看更多
兄弟一词,经得起流年.
3楼-- · 2019-08-30 06:29

place your scripts outside of contentplaceholder 'title' in head section and make sure that your page has correct reference to your masterpage and also make sure that you are placing the contentplaceholders in their appropriate places

查看更多
登录 后发表回答