如何使用内容占位符在主页上应用模板和jquery? [英] How templates and jquery be applied on master page using content place holder?

查看:65
本文介绍了如何使用内容占位符在主页上应用模板和jquery?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请向我发送模板代码如何应用于母版页的整个程序。

Please send me the whole procedure that how code of template is applied on master page.

推荐答案

没有人会指导您完成教学方式..
/>
你必须自己学习

让我告诉你,假设下面是你的模板代码,你必须在主代码中应用它然后检查它。

第1步:您的原始模板

No one will guide you through the teaching way..
you have to learn by yourself
let me brief you supposed that below is your template code ane you have to apply it in master code then just check it.
Step 1:Your Original Template
<!doctype html>
<html lang="en">
<head>
<title>Sample Page</title>
<link rel="stylesheet" type="text/css" href="css/style-min.css">
<script src="js/slider.js"></script>
</head>
<body>
<div class="header"> </div>
<div class="navigation"> </div>
<div class="slider"> </div>
<div class="content"></div>
<div class="footer"></div>
</body>
</html>





步骤2:现在你必须保持所有头部分数据与主页面相同,并且必须仅删除内容地点持有者的内容数据





Step 2 : Now you have to keep the all head section data same as in Master Page and have to remove only content data for Content Place Holder

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>

<!doctype html>
<html lang="en">
<head runat="server">

    <title>Sample Page</title>
    <link rel="stylesheet" type="text/css" href="css/style-min.css">
    <script src="js/slider.js"></script>
    <asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">

            </asp:ContentPlaceHolder>
        </div>
    </form>
</body>
</html>







第3步:您必须在子序列页面的相对内容占位符中添加您的特定代码,您必须在创建新的简单页面时选择母版页。






Step 3: You have to add your particular code in relative Content Place Holder in sub sequence page where you have to select the master page while creating a new simple page.

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
</asp:Content>







就是它。




That's It.


在母版页的head部分添加jquery,但在内容占位符之外,应该用于其他页面特定的脚本



提出具体问题,以便人们更好地帮助
Add jquery within the head section of master page, but outside of the content placeholder, which should be used for additional page specific scripts

Ask a specific issue so people would help out better


这篇关于如何使用内容占位符在主页上应用模板和jquery?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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