首先添加全局应用程序Global.asax
protected void Application_BeginRequest(Object sender, EventArgs e)
{
string rawUrl = Request.RawUrl;
rawUrl = rawUrl.Replace("html", "aspx");
Context.RewritePath(rawUrl);
}
浏览器输入http://localhost:1981/UrlRewritingTest/Default.html 实际跳转到Default.aspx