views:

20

answers:

1

A followup to another question I did, I've done some more digging but I am still coming up dry. Is there any way to include .HTML/.ASPX files as 'embedded resources' into an ASP.NET MVC application? I've found lots of examples of using string resources, but never other files entirely.

+1  A: 

Sure it's possible.

Assuming that you want to use your embedded resource HTML/ASPX files as Views, you just need to:

  1. Change the Build Action property to "Embedded Resource" on the files you want to embed as resources.
  2. Write and register a custom IViewEngine to retrieve the resources. You can probably extend WebFormViewEngine and WebFormView rather than starting from scratch, since you're basically just searching for the view markup in resources rather than on the file system.

Sounds like fun. Good luck!

John Bledsoe