可以ASP.Net MVC视图(*的.aspx)可以在多个ASP.net MVC项目中重复使用? [英] Can ASP.Net MVC Views (*.aspx) be reused in multiple ASP.net MVC projects?

查看:154
本文介绍了可以ASP.Net MVC视图(*的.aspx)可以在多个ASP.net MVC项目中重复使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想重用在多个ASP.Net MVC项目* .aspx文件。这可能吗?

I would like to reuse *.aspx files in multiple ASP.Net MVC projects. Is this possible?

编辑:使用版本控制系统跨多个项目解决了我的一个实际问题的方式共享公共文件安东尼的建议。幸运的是,因为我使用Subversion,该解决方案适合我。不过,如果我不使用的,这怎么能问题仍然需要解决?

Anthony's suggestion of using version control system to share common files across multiple projects solves my question in a practical way. Luckily, since I'm using Subversion, the solution fits me. However, if I wasn't using one, how can this problem still be solved?

是否有可能做这样的事情?

Is it possible to do something like this?


  1. 构建使用VS网站precompilation功能的再发行的用户控件。 (这里如上所述。)

  2. 参考输出组件中所需要的项目。

  3. 创建,它通过泛型类型参数实例化用户控件修改视图引擎。

  1. Build a redistributable User Control using VS's website precompilation feature. (As described here.)
  2. Reference the output assemblies in the required projects.
  3. Create a modified View engine that instantiates User Controls via generic type parameter.

我们再构造控制器操作是这样的:

We then construct controller actions like this:

public ActionResult Shared()
{
    return View<SharedPageOrUserControl>();
}

这是否看可能吗?

Does that look possible?

推荐答案

我通常通过解决源$ C ​​$ C控制这类问题。大多数系统(甚至VSS)允许你在多个项目共享文件。

I normally solve this sort of issue via source code control. Most systems (even VSS) allow you to share a file across multiple projects.

这篇关于可以ASP.Net MVC视图(*的.aspx)可以在多个ASP.net MVC项目中重复使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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