如何在子页面的母版页中添加多个contentplaceholder [英] how are to add multiple contentplaceholder in masterpage with in child page

查看:335
本文介绍了如何在子页面的母版页中添加多个contentplaceholder的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在子页面的母版页中添加多个contentplaceholder,
如何使用mywebproject添加下载母版
什么是编码

how are to add multiple contentplaceholder in masterpage with in child page ,
how to add download masterpage with mywebproject
what is coding

推荐答案

您应该问的问题是,在具有母版页的asp.net中进行编程的基础知识是什么.
1)如果要使用多个内容占位符,则只需在Visual Studio中打开母版页设计器,然后将现有内容占位符定义复制/粘贴到希望新占位符所在的位置.您只需要给它一个新的ID.
2)在从母版页继承的子页中,只需将内容放入所选的占位符即可.
3)如果使用Visual Studio,请使用IDE内置的部署工具将文件部署到需要的任何位置.
如果您需要一些更具体的答案,请提出更具体的问题.
The question you should ask is what are the basics of programming in asp.net with master pages.
1) If you want multiple content placeholders, then just open the master page designer in Visual Studio and copy/paste an existing content placeholder definition where you want the new placeholder to be. You just have to give it a new id.
2) In your child pages that inherit from the master page, you simple have to place content into the placeholder of choice.
3) If you use Visual Studio, use the deployment tool built into the IDE to deploy the files to wherever they need to go.
If you need some more specific answers, please ask more specific questions.


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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ContentPlaceHolder id="ContentPlaceHolder1"  runat="server">

        </asp:ContentPlaceHolder>
    </div>
    <asp:ContentPlaceHolder ID="ContentPlaceHolder2" runat="server">
    </asp:ContentPlaceHolder>
    </form>
</body>
</html>


这篇关于如何在子页面的母版页中添加多个contentplaceholder的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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