0
我有一個HttpHandler映射到aspnet_isapi.dll進行靜態文件在經典模式下使用IIS 7.5(.pdf文件)的自定義驗證檢驗:呼叫StaticFileHandler
void IHttpHandler.ProcessRequest(HttpContext context)
{
if(!User.IsMember) {
Response.Redirect("~/Login.aspx?m=1");
}
else {
//serve static content
}
}
上面的代碼工作正常,除else語句邏輯。在else語句中,我只是想允許StaticFileHandler處理請求,但我無法對此進行排序。將不勝感激任何關於如何簡單地將文件「交還」回IIS以作爲正常的StaticFile請求提供請求的建議。
如果我想以類似的方式提供.aspx頁面,而不是調用System.Web.StaticFileHandler類型,我可以使用相同的方法並調用某種類型:System.Web。這種類型是什麼? – 2012-08-19 16:17:48
嘗試使用'BuildManager.CreateInstanceFromVirtualPath'方法。 – 2012-08-19 20:25:47