English 中文(简体)
服务器。 全球转移。
原标题:Server.Transfer in Global.asax

我的习俗错误手遍及全球。 asax s Application_ 错误发生时,采用下列代码将用户转移到错误网页:

Server.Transfer("/Error/");

但是,在未具体说明实际页数的情况下,上述代码与“相左。 拒绝执行儿童申请的例外情况

因此,如果我使用<代码>Server.Transfer(”/Error/Default.aspx”,则该编码在没有任何问题的情况下进行罚款。

并且使用<代码>Response.Redirect("/Error/")也进行罚款,但我们希望继续使用服务器。 在显示错误页面时,转而保留在地址栏中显示的URL,这样用户就可以简单地更新网页,以便检索原始冒犯的URL。

Would be grateful if anyone can comment on how to get the Server.Transfer method working without specifying the actual aspx page name.

许多感谢。

最佳回答

<代码>Server.Transfer需要实际的、虚拟的资源途径,以提供所需产出。 查阅网站的缺省文件并不通过国际数据系统,因此,除非是实际的档案名称,否则网站没有包含你通过“Error/”的含义。

<代码>Response.Redirect 运行,因为向浏览器发送了与该相对的URL(Error/)的转移结果,而浏览器提出新的申请/Error/, IIS首先处理这一请求,并适用违约文件环境。

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!