我們有一家商店,我們與一家公司簽約進行修改。他們增加了以下我們Global.asax文件:從Global.asax文件重定向
protected void Application_PreRequestHandlerExecute(Object sender, EventArgs e)
{
string exFilePath = Request.AppRelativeCurrentExecutionFilePath.ToLower();
if ((!exFilePath.EndsWith(".aspx") && !exFilePath.EndsWith(".ashx"))
|| exFilePath.StartsWith("~/admin")
|| exFilePath.StartsWith("~/js")
|| exFilePath.StartsWith("~/app_themes")
|| exFilePath.StartsWith("~/assets")
|| exFilePath.StartsWith("~/errors")
|| exFilePath.StartsWith("~/fckeditor")
|| exFilePath.StartsWith("~/images")
|| exFilePath.StartsWith("~/layouts")
|| exFilePath.StartsWith("~/webcharts")
)
{
return;
}
else
{
AccessHelper.HandleAnonymousUsers();
}
}
的目的是爲了採取任何人去我們的網頁的一個登入畫面,除非他們將這些文件夾不需要登錄保護。
我現在需要讓他們去到http:// [mysite的] /vendorstore/PasswordHelp.aspx?Key=123 &檢查= V7Xc1BsH913V
如果有人可以幫我修改全局文件我將不勝感激。我試圖添加
exFilePath.EndsWith(「〜/ Passwordhelp.aspx」)
但這並不奏效。
感謝
完美!感謝你的解釋,它給了我一些額外的有用的東西來了解全局文件。 – Deverill 2011-03-17 16:46:35