Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Web.Config Custom Errors
Jay
#1 Posted : Wednesday, April 6, 2011 6:28:35 AM(UTC)
Groups: Member
Joined: 9/21/2010(UTC)
Posts: 10

When trying to activate custom errors in the web config file UltiDev won't recognize the command.

here is the code:

Code:
<customErrors defaultRedirect="error.html" mode="On"></customErrors>


this is nested within the system.web tags.

Ultidev Team
#2 Posted : Wednesday, April 6, 2011 12:44:13 PM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
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.
Jay
#3 Posted : Friday, April 8, 2011 2:00:28 AM(UTC)
Groups: Member
Joined: 9/21/2010(UTC)
Posts: 10

did you get our PM?
Ultidev Team
#4 Posted : Friday, April 8, 2011 4:43:37 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Yes, we have. We responded very soon after. Will resend to your forum account email address.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Jay
#5 Posted : Monday, April 11, 2011 5:36:56 AM(UTC)
Groups: Member
Joined: 9/21/2010(UTC)
Posts: 10

the link you gave me about custom error pages, is about images? http://ultidev.com/Forum...?g=posts&t=295#1165
is that the right post?
Ultidev Team
#6 Posted : Monday, April 11, 2011 6:21:20 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Jay,

The post we mentioned is not about exactly the same issue, but the solution very similar. It provides guidance for writing a custom IHttpHandler that can be used to massage all requests coming to your application, including requests for static content and possibly requests for non-existing static files.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Rss Feed  Atom Feed
Users browsing this topic
Guest (4)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.