文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>ASP.NET MVC 使用WebForm

ASP.NET MVC 使用WebForm

时间:2011-02-20  来源:安羽.

// 忽略对 WebForms 路径的路由
routes.IgnoreRoute("WebForms/{subdir}/{page}");
 public class WebFormsRouteHandler:IRouteHandler
{
public IHttpHandler GetHttpHandler(RequestContext requestContext)
{

// 从URL中获取subdir参数
var subdir= requestContext.RouteData.GetRequiredString("subdir");

// 从URL中获取page参数
var page = requestContext.RouteData.GetRequiredString("page");
// 创建实例
// 根据 page 参数拼接成类似/WebForms/account/page.aspx地址来访问WebForms页面
IHttpHandler hander = BuildManager.CreateInstanceFromVirtualPath("/WebForms/"+subdir+"/"+ this.page+".aspx", typeof(System.Web.UI.Page)) as IHttpHandler;
return hander;
}
}
相关阅读 更多 +
排行榜 更多 +
别惹神枪手安卓版

别惹神枪手安卓版

冒险解谜 下载
坦克战争世界

坦克战争世界

模拟经营 下载
丛林反击战

丛林反击战

飞行射击 下载