简体   繁体   English

ASP.NET页面模板库

[英]ASP.NET Page Templates Library

I know that in Windows Form Application you can inherit a Form and in ASP.NET u can inherit a page but some big constraint exist: ASPX page is not compiled in the library. 我知道在Windows Form Application中您可以继承Form,而在ASP.NET中您可以继承页面,但是存在一些较大的约束:ASPX页面未在库中编译。

I tried to embed a User Control in DLL but Design Time is not supported, also I tried to make a Custom Server Control but in the end you are inheriting a control not Page. 我试图在DLL中嵌入用户控件,但不支持“设计时间”,我也尝试制作“自定义服务器控件”,但最终您继承的是控件而不是Page。

So the question is what is the way to make your own library of Template Pages that u can inherit and use in different projects with design support . 因此,问题是,有什么样的方式可以使自己的模板页面库在设计支持下可以在不同项目中继承和使用。

Thanks in advance 提前致谢

Creating Reusable Page template 创建可重用页面模板

Here I've shown how to Create a reusable page template . 在这里,我展示了如何创建可重复使用的页面模板 To use your template in your another website or project you have to right click on the project Add -> New Item . 要在另一个网站或项目中使用模板,必须右键单击项目Add-> New Item Add New Item dialog box will appear. 将出现“ 添加新项”对话框。 You can use the Search Installed Templates option and search your template or you can click on Visual C# tab on left panel of the dialog box and find your Template . 您可以使用“ 搜索已安装的模板”选项来搜索模板,也可以单击对话框左面板上的“ Visual C#”选项卡并找到模板

Note : Your Template might not appear if you click on Visual C# -> Web on Add New Item dialog box. 注意:如果单击Visual C#-> 添加新项上的Web对话框,则模板可能不会出现。 Rather you have to search it in Visual C# tab. 而是必须在Visual C#选项卡中进行搜索。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM