编程人生

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

首先設定 IIS  讓所有檔案都由asp.net 執行

按右鍵選內容

 

按設定

 

按新增

 

打上 C:\WINNT\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll 和 *

 

 

在 Global.asax.cs 這個檔寫段程式

1 protected void Application_BeginRequest(Object sender, EventArgs e)  
2 {  
3    string url = System.Web.HttpContext.Current.Request.Path;  
4    string query = System.Web.HttpContext.Current.Request.QueryString.ToString();  
5    if (url.IndexOf(".aspx") == -1)  
6       System.Web.HttpContext.Current.RewritePath(url+".aspx"+ (query.Length > 0?"?"+query:""));  
7 }  
posted on 2006-09-03 22:22  choice  阅读(844)  评论(0编辑  收藏  举报