asp.net - Web.Config 奇怪的 <customErrors> 部分?

标签 asp.net web-config

我正在学习 ASP.Net Web 表单教程 here:在 asp.net 网站上。本教程包含自定义错误部分,这对我来说有点奇怪。

<customErrors mode="On" defaultRedirect="ErrorPage.aspx?handler=customErrors%20section%20-%20Web.config">
    <error statusCode="404" redirect="ErrorPage.aspx?msg=404&amp;handler=customErrors%20section%20-%20Web.config" />
</customErrors>

问题:有人可以解释一下 defaultRedirect 中的查询字符串参数 handler=customErrors%20section%20-%20Web.config" & <强>重定向?

这个语法有什么特殊含义吗?

最佳答案

%20 只是 URL 编码的空格。它发送一个人类可读的名称,该名称在查询字符串中重定向到错误处理程序页面。

关于asp.net - Web.Config 奇怪的 <customErrors> 部分?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14125468/

相关文章:

asp.net - 如何为 Entity Framework DBContext 显式指定连接字符串

ASP.net 设计问题,如果在 HTTPS 上则强制重定向到 HTTP

c# - 如何将 IHttpActionResult(内部带有 JSON)转换为我可以使用 LINQ 处理的对象

c# - 从 iframe 内的按钮打开菜单列表

asp.net - 将预加密的配置文件部署到生产环境

javascript - 获取 $.post 返回 View

.net - 为什么我的 web 项目找不到我的 elmah.axd 文件

asp.net - IIS中的Web配置错误

c# - 如何访问外部 .config 文件?

asp.net - 是否可以在 web.config 中指定自动配置代理?