// Change the current path so that the Routing handler can correctly interpret
// the request, then restore the original path so that the OutputCache module
// can correctly process the response (if caching is enabled).

string originalPath = Request.Path;
HttpContext.Current.RewritePath(Request.ApplicationPath, false);

IHttpHandler httpHandler = new MvcHttpHandler();
httpHandler.ProcessRequest(HttpContext.Current);

HttpContext.Current.RewritePath(originalPath, false);

Rewrite Path in Asp.Net MVC Project的更多相关文章

  1. Creating a NuGet Package in 7 easy steps - Plus using NuGet to integrate ASP.NET MVC 3 into existing Web Forms applications

    UPDATE: Check out my follow up post where I remove the need for editing the Global.asax.cs and show ...

  2. A Look at the Razor View Engine in ASP.NET MVC

    The biggest architectural difference that exists between ASP.NET MVC and ASP.NET Web Forms is the ne ...

  3. 【转】ASP.NET MVC 的最佳实践

    [This post is based on a document authored by Ben Grover (a senior developer at Microsoft). It is ou ...

  4. Incorporating ASP.NET MVC and SQL Server Reporting Services, Part 1

    Your ASP.NET MVC application needs reports. What do you do? In this article, I will demonstrate how ...

  5. Using the Repository Pattern with ASP.NET MVC and Entity Framework

    原文:http://www.codeguru.com/csharp/.net/net_asp/mvc/using-the-repository-pattern-with-asp.net-mvc-and ...

  6. 1.Getting Started with ASP.NET MVC 5

    Getting Started Start by installing and running Visual Studio Express 2013 for Web or Visual Studio ...

  7. ASP.NET MVC 5 Authentication Breakdown

    In my previous post, "ASP.NET MVC 5 Authentication Breakdown", I broke down all the parts ...

  8. Areas in ASP.NET MVC 4

    Download source - 2.7 MB Introduction to Areas In this article, we will learn the concept of Areas a ...

  9. The Three Models of ASP.NET MVC Apps

    12 June 2012  by Dino Esposito by Dino Esposito   We've inherited from the original MVC pattern a ra ...

随机推荐

  1. PHP获取客户端和服务器IP地址

    /** * 获取客户端IP地址 * @return string */ function get_client_ip() { if(getenv('HTTP_CLIENT_IP')){ $client ...

  2. iOS开源项目推荐|下拉刷新

    MJRefresh - 仅需一行代码就可以为UITableView或者CollectionView加上下拉刷新或者上拉刷新功能.可以自定义上下拉刷新的文字说明. CBStoreHouseRefresh ...

  3. 解锁Dagger2使用姿势(一)

    毫无疑问,Dagger2的 上手是有门槛的,有门槛是因为它里边的概念多,用起来复杂,可是一旦你学会了Dagger2的使用,你一定会爱不释手的.与ButterKnife和AndroidAnnotatio ...

  4. hibernate简单应用

    Hibernate 第二章 核心API 和CURD实现 核心API介绍 单表操作方法 查询hql语句 1.认识hibernate 核心思想ORM:实现数据库中的文件一一映射为java中的实体类. 使用 ...

  5. maven主仓库中找不到restlet的解决办法

    解决办法: 修改Pom.xml  增加 <repositories>         <repository>             <id>maven-rest ...

  6. magento 操作数据库

    查:     $read = Mage::getSingleton(“core/resource”)->getConnection(‘core_read’);     $sql = “selec ...

  7. (转)ASP.net的url重写

    1. 有关于URL的重写,本文也只是拿来主意.相继有MS的组件“URLRewriter”和在Global.asax里的“Application_BeginRequest()”编码方式,以及IIS里的I ...

  8. ASP.NET CompareValidator 控件在VS2012中出错的问题

    CompareValidator 控件用于将由用户输入到输入控件的值与输入到其他输入控件的值或常数值进行比较. -------如果输入控件为空,则不会调用任何验证函数,并且验证将成功.使用 Requi ...

  9. 使用反射让Spinner选择同一选项时触发onItemSelected事件

    翻看源码,Spinner判断是否触发onItemSelected,是在它的基类AdapterView里面做的: void checkSelectionChanged() { if ((mSelecte ...

  10. OC - 3.OC的三大特性

    一.封装 1> 封装的定义 隐藏对象的属性和实现细节,仅对外公开接口,控制在程序中属性的读和修改的访问级别 2> 封装的好处 可以通过set方法防止为成员变量设置不合理的值 仅向外部提供公 ...