Hello, Jay.
We have tested the scenario and had no issue with it. We've created a ASP.NET 2.0 application and ran it in both IIS and UltiDev Cassini, and had the consistent result in both: redirection worked. We have created a Defaul.aspx (and .cs) page and Error.htm. Here's what's in them:
Web.config:
Code:<?xml version="1.0"?>
<configuration>
<appSettings />
<connectionStrings />
<system.web>
<compilation debug="true">
</compilation>
<authentication mode="Windows" />
<customErrors defaultRedirect="Error.htm" mode="On" />
</system.web>
</configuration>
Error.htm:
Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Oops!</title>
</head>
<body>
<h1>Error</h1>
</body>
</html>
Default.aspx:
Code:<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="AspNetErrorRdirectTest._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
Hello!
</div>
</form>
</body>
</html>
Default.aspx.cs:
Code:using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace AspNetErrorRdirectTest
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
throw new Exception();
}
}
}
Please let us know a little bit more about the scenario you are troubleshooting, especially what kind of error does not get redirected.
Best regards,
UltiDev Team.
Please donate at
http://www.ultidev.com/products/Donate.aspx to help us improve our products.