I'm working on a large scale software which consists of about 300 projects written in C#. The software is working based on a framework and a WinForm based portal for UI.
Our team is working to develop the Web portal framework.
The web portal is going to load and return javascript, cshtml and css files which resides in various dlls. For example:
Carane.Accounting.Web:
- VoucherSmartPart.cshtml
- VoucherSmartPart.js
Carane.Inventory.Web:
- GoodRequest.cshtml
- GoodRequest.js
The framework resides in somewhere like Carane.Portal.Web.
As the portal is SPA using HotTowel, I configured Durandal
to get html
views and javascript viewmodels
from a Controller.
The controller to return Javascript files works fine.
The problem is with the ViewController which should be like this:
public class ViewController : ApiController
{
[HttpGet]
public string GetSmartPart(string moduleName, string smartpartName)
{
// some code to retrieve the cshtml file from the dll
// and render the cshtml and return the html in a way
// as Durandal recognize it as a html file.
}
}
Questions:
- How to get
cshtml
files from another project to involve in framework project? - How to render the
cshtml
and return it as a html.
It's important that the cshtml file should be debug-able via Visual Studio while it's getting rendered.