在母版页中使用jquery
亲爱的程序员们好 我在母版页中使用jquery时遇到了一个愚蠢的问题,我希望调用母版页本身的函数,而不是母版页的相关页。 这是我的主页的标题在母版页中使用jquery,jquery,asp.net,master-pages,Jquery,Asp.net,Master Pages,亲爱的程序员们好 我在母版页中使用jquery时遇到了一个愚蠢的问题,我希望调用母版页本身的函数,而不是母版页的相关页。 这是我的主页的标题 <%@ Master Language="C#" AutoEventWireup="true" CodeFile="CMS_master.master.cs" Inherits="CMS_master" %> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="s
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="CMS_master.master.cs" Inherits="CMS_master" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
<link href="css/Exclusive_fonts.css" rel="stylesheet" />
<link href="Content/bootstrap.min.css" rel="stylesheet" />
<link href="css/CMS_Style.css" rel="stylesheet" />
<script src="<%ResolveUrl("~/Scripts/jquery-3.1.1.min.js"); %>" type="text/javascript">
window.alert("a");
</script>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
窗口警报(“a”);
挫折在于jquery和javascripts代码无法识别和呈现。
我知道有些问题可能已经回答了这个问题,但没有一个对我有用。你在脚本标签上打了两个错。您忘记了
=
符号并删除了代码>在末尾
<script src="<%= ResolveUrl("~/Scripts/jquery-3.1.1.min.js") %>" type="text/javascript"></script>
这在html中呈现为src=“/Scripts/jquery-3.1.1.min.js”
无法发现任何错误,可能错误在使用此选项的页面上master@Aristos使用页面只有两个空内容占位符