zoukankan      html  css  js  c++  java
  • 第五章母版页

    ***模板页

    1. 可以无限极嵌套。

    2. 可以设置默认内容,不是 每个contentPlaceholder 都有对应的content 进行重写。

    ***模板页中的URL

    服务器端控件的相对URL是相对于模板页的URL

    HTML控件是相对内容内容页的URL。

    对于以上解决方法:

    1.服务器端控件和HTML控件互换。

    2.使用绝对URL

    3.在模板页中进行重新解析相对URL。

    ***Web配置文件中注册模板页

    <System.web>

    <pages masterPageFile="../sim.master"/>

    <System.web>

    ***修改模板页内容

    1. 在内容页中page指令中Titile属性。(模板页中head必须是服务器端控件)

    在内容页中使用page.head进行编程设定。

    Code

    ***暴露模板页属性

    1. 在模板页设置public属性。

    2. 在内容页中使用master.<>进行访问。

    3. 使用FindControl来修改模板页中的目标控件。

    ***动态加载模板页

    Code


    ***为多个内容页动态加载模板页

    可以新建一个基类

     

    Code
  • 相关阅读:
    【wikioi】1014 装箱问题
    石子合并
    我的Linux对拍脚本
    【搬运工】NOIP吧置顶贴
    [LeetCode] 237. Delete Node in a Linked List 删除链表的节点
    [LeetCode] 316. Remove Duplicate Letters 移除重复字母
    [LeetCode] 82. Remove Duplicates from Sorted List II 移除有序链表中的重复项 II
    [LeetCode] 83. Remove Duplicates from Sorted List 移除有序链表中的重复项
    [LeetCode] 80. Remove Duplicates from Sorted Array II 有序数组中去除重复项 II
    [LeetCode] 26. Remove Duplicates from Sorted Array 有序数组中去除重复项
  • 原文地址:https://www.cnblogs.com/cpsing/p/1318260.html
Copyright © 2011-2022 走看看