I would like to reuse *.aspx files in multiple ASP.Net MVC projects. Is this possible?
EDIT: 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?
We then construct controller actions like this:
public ActionResult Shared()
{
return View<SharedPageOrUserControl>();
}
Does that look possible?
One idea you could try would be to:
So in the projects that you wanted to use the shared Views, the controller actions could return something like
public ActionResult Shared()
{
return new EmbeddedViewResult("SharedLib.SharedPage");
}
I've done something similar with WebForms pages, so it should be possible.
I normally solve this sort of issue via source code control. Most systems (even VSS) allow you to share a file across multiple projects.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With