2012-05-28 27 views

回答

1

HttpContext.Current.RewritePath是在改寫的url服務器端。

這意味着如果您請求的URL /products你可以告訴asp.net使用到rednder /Products.aspx

if(HttpContext.Current.Request.RawUrl == "/products") 
    HttpContext.Current.RewritePath("/Products.aspx"); 

,如果你想給用戶發送到你需要做的另一個域:

HttpContext.Current.Response.Redirect(「http://www.otherdomain.com/page」);

+0

這是行不通的?這是否經過測試? – Eric