在解决方案里创建了一个新建网站,在其右键下添加一个模板后,
准备使用模板的,在添加新建项里突然没有“使用模板页的web窗体”,
顿时感觉悲剧。。。

解决方法:
模板页代码---LYFMaterPage.Master--------------------------------------------------------------------------------
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="LYFMaterPage.master.cs" Inherits="WebApplication1.LYFMaster.LYFMaterPage" %>

<!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></title>
<asp:ContentPlaceHolder ID="headScriptLYF" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">

</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
模板页后台代码---LYFMaterPage.Master.cs---------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication1.LYFMaster
{
public partial class LYFMaterPage : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{

}
}
}
模板页设计代码-------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </自动生成>
//------------------------------------------------------------------------------

namespace WebApplication1.LYFMaster {

public partial class LYFMaterPage {

/// <summary>
/// headScriptLYF 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.ContentPlaceHolder headScriptLYF;

/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;

/// <summary>
/// ContentPlaceHolder1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.ContentPlaceHolder ContentPlaceHolder1;
}
}
-----------------------------------------------------------------------------------------------------------------
网页代码---WebForm1.aspx---------------------------------------------------------------------------------------------
<%@ Page Title="" Language="C#"
MasterPageFile="~/LYFMaster/LYFMaterPage.Master" 此句就是当前网页使用的模板
AutoEventWireup="true"
CodeBehind="WebForm1.aspx.cs"
Inherits="WebApplication1.LYFwebPage.WebForm1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="headScriptLYF" runat="server">
注意: ContentPlaceHolderID="headScriptLYF" 的值就是模板页中ID的值
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
</asp:Content>
--------------------------------------------------------------------------------------------------------------

LYF模板连接.txt的更多相关文章

  1. [20170824]11G备库启用DRCP连接.txt

    [20170824]11G备库启用DRCP连接.txt --//参考链接:http://blog.itpub.net/267265/viewspace-2099397/blogs.oracle.com ...

  2. jdbc 模板 连接

    package itcast; import java.sql.Connection;import java.sql.DriverManager;import java.sql.ResultSet;i ...

  3. 使用ABP EntityFramework连接MySQL数据库

    ASP.NET Boilerplate(简称ABP)是在.Net平台下一个很流行的DDD框架,该框架已经为我们提供了大量的函数,非常方便与搭建企业应用. 关于这个框架的介绍我就不多说,有兴趣的可以参见 ...

  4. Web Api2 用户认证模板解析---本地用户

    本文我们将把关注Visual Studio用户认证模板中的 本地用户名/密码帐号特性.他们将其分为了两部分:帐户控制器具备如创建帐号和修改密码等功能:另一部分是在OAuth2认证服务器中进行的认证.我 ...

  5. HTML模块化:使用HTML5 Boilerplate模板

    HTML5 Boilerplate 是一个由 Paul Irish(Google Chrome 开发人员.jQuery 项目成员.Modernizr 作者.yayQuery 播客主持人)主导的“前端开 ...

  6. Java 前端模板引擎学习:thymeleaf 模板引擎

    模板引擎接口 ITemplateEngine 一.后台数据与外部数据 1.处理后台数据 $表达式是个变量表达式,用于处理在  request parameters and the request, s ...

  7. 给zabbix添加percona监控模板

    简单说明一下给zabbix添加的percona的监控模板. 在percona官方网站有说明怎么安装,这里记录下步骤.首先搭建好的zabbix环境. 监控插件连接 : 链接:https://pan.ba ...

  8. 按照已有的模板打印小票<二> ——调用windows打印机打印 可设置字体样式

    按照已有的模板打印小票<二> ——调用windows打印机打印 可设置字体样式 之前写过一篇文章<按照已有的模板输出一(如发票)>,是关于如何给已有的模板赋值.在项目的实践过程 ...

  9. Meteor模板

    Meteor模板使用三个顶级标签.前两个是 head 和 body 标签.这些标签和在普通的HTML中做的工作一样.第三个标签 template.这是我们将HTML连接到JavaScript的地方. ...

随机推荐

  1. MocorDroid编译工程快速建立编译环境

    function sprdLunch(){    declare -a arrProj    arrProj=`find out/target/product -name previous_build ...

  2. Java定时任务器

    java定时任务,每天定时执行任务.以下是这个例子的全部代码. public class TimerManager { //时间间隔 private static final long PERIOD_ ...

  3. python基础-更新篇

    对于windows来说就很简单了: 下载最新版本的python,然后卸载老版本,重新安装即可 对于linux系统的主机来说就有点复杂了: 现在linux主机自带的python版本都使2.x版的,而且L ...

  4. Python笔记5(字符串)-20160921

    一.字符串常用方法 1.title():返回字符串的标题版本,即单词首字母大写其余字母小写 2.upper():返回字符串全部大写版本,lower()则返回字符串全部小写版本 >>> ...

  5. assembly打包实例

    1.先在pom.xml文件中添加assembly打包插件 <build> <plugins> <plugin> <groupId>org.apache. ...

  6. C#使用SqlDataAdapter 实现数据的批量插入和更新

    近日由于项目要求在需要实现中型数据的批量插入和更新,晚上无聊,在网上看到看到这样的一个实现方法,特摘抄过来,以便以后可能用到参考. 一.数据的插入 DateTime begin = DateTime. ...

  7. JAVA中String(字符串)课堂总结

    一:Java编译器中关于字符串自动优化 例子一: 源代码: public class StringPool { public static void main(String args[]) { Str ...

  8. Tsung测试统计报告说明

    Tsung测试统计报告说明 **********************  report.html  *********************** 1.主要统计信息 Tsung统计数据是平均每十秒重 ...

  9. bower工具的简单使用

    基于NodeJS的一个静态资源管理工具,由twitter公司开发维,解决大型网站中静态资源的依赖问题. 1.依赖NodeJS环境和git工具. 2.npm install -g bower安装bowe ...

  10. AIDL机制实现进程间的通讯实例

    转载自:http://blog.csdn.net/cjjky/article/details/7562652 ======================================= 在Andr ...