如何使用visual studio 2015通过代码添加新项目 [英] How to add new items through code using visual studio 2015

查看:122
本文介绍了如何使用visual studio 2015通过代码添加新项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过代码添加新网页。通常我们只需右键单击并选择添加新项目,但我想知道是否有一种方法可以只是编码添加新项目。



我尝试了什么:



我想知道这个的原因是因为我正在尝试创建一个内容管理系统,它需要创建一个新的网页。由于用户不知道如何在visual studio 2015中创建它,我将需要创建一个系统,用户可以通过实际网站创建自己的网页。例如:我想在Pages文件夹中添加名为Test.aspx的新网页。问题是如何在代码中执行此操作?希望这是有道理的。

I want to add a new webpage through code. Normally we would just right click and select add new item, but i want to know if there's a way that i can just code to add new items.

What I have tried:

The reason why i wanted to know about this is because i'm trying to create a content management system, and it requires to create a new webpage. Since the user does not know how to create it in visual studio 2015, I will need to create a system where the user can create their own webpage via the actual website. Like for example: I wanted to add new webpage called "Test.aspx" in my Pages folder. The question is how can i do it in code? Hope this makes sense.

推荐答案

从这里开始:在代码隐藏中动态构建ASP.NET网页 [ ^ ]


这篇关于如何使用visual studio 2015通过代码添加新项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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