开发者

Inline jquery script to a separate js file with asp.net master pages

开发者 https://www.devze.com 2022-12-10 17:41 出处:网络
Hai guys, How to include inline jquery scripts used in an aspx to a separate js fi开发者_JAVA技巧le with asp.net master pagesYour masterpage can have a script link to the core Jquery file:

Hai guys, How to include inline jquery scripts used in an aspx to a separate js fi开发者_JAVA技巧le with asp.net master pages


Your masterpage can have a script link to the core Jquery file:

<html>
<head runat="server" >
    <title>Master page title</title>
    //link to Jquery script
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
    <asp:contentplaceholder id="Head" runat="server" />
</head>
<body>
.
<asp:contentplaceholder id="Main" runat="server" />
.
</body>

ASPX page can have other script links specific to the page only

<% @ Page Language="C#" MasterPageFile="~/Master.master" Title="Content Page 1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Head" Runat="Server">
    //other scripts specific to this page only
    <script type="text/javascript" src="js/jquery.plugin.abc.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Main" Runat="Server">
    Main content.
</asp:Content>

0

精彩评论

暂无评论...
验证码 换一张
取 消