<customErrors> 元素
摘要:http://apps.hi.baidu.com/share/detail/23393975http://msdn.microsoft.com/zh-cn/library/h0hfz6fc(VS.80).aspx提供有关 ASP.NET 应用程序自定义错误消息的信息。配置结构的示例:<configuration><system.web><customErrors><customErrors defaultRedirect="url" mode="On|Off|RemoteOnly"> <error s
阅读全文
ASP.NET中URL Rewrite的实现方法
摘要:http://developer.51cto.com/art/200901/104833.htm在一个ASP.NET应用中如果要进行URL Rewrite,那么一般就是在BeginRequest事件中调用HttpContext的RewritePath方法,将该请求重新“定位”至一个目标URL。例如我们就可以在Global.asax中重写Application_BeginRequest方法来实现这一点: 之所以在BeginRequest中进行Rewrite,是因为这个事件是在所有Pipeline事件中最早被触发的。在这时进行了重新“定位”之后,当前HttpContext中的一些属性也就发生了相应
阅读全文
301 重定向
摘要:<script runat="server"> private void Page_Load(object sender, System.EventArgs e) { Response.Status = "301 Moved Permanently"; Response.AddHeader ("Location","http://www.domain.com"); } </script>
阅读全文