繁体   English   中英

ASP.NET:在运行时中的代码背后动态创建Masterpage和aspx页面?

[英]ASP.NET:Create dynamically Masterpage and aspx page in runtime in code behind?

我想在后面的代码中动态制作一个aspx页面和母版页,并保存在特定路径中。 我正在搜索此代码,但是我发现了一些这样的代码:

字符串filePath = MapPath(“〜/ file.aspx”);
字符串htmlText =“ <%@页面语言= \\” C#\\“%> \\ n <!DOCTYPE html> <h 1> Hello World </ h1>”;
//我放置了这些空间,因为不要更改输出语句;)System.IO.File.WriteAllText(filePath,htmlText);

请参考此链接。

以编程方式使用ASP.NET母版页

希望您能在这里找到解决方案。

暂无
暂无

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

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