从数据库或者资源问价加载模版页面的例子 未测试,出自http://blog.falafel.com/how-to-load-views-from-assembly-in-mvc/
nnhy
编写于
2015-05-07 21:33:10
X
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Hosting;
using System.Web.Mvc;
namespace NewLife.Cube.Precompiled
{
/// <summary>前端控制器</summary>
public class FrontendController : Controller
{
/// <summary>默认</summary>
/// <returns></returns>
public ActionResult Default()
{
string actionName = (RouteData.Values["viewName"] ?? "Default").ToString();
return View(actionName);
}
}
}
|