J
julien
This is a part of my Global.asax.cs :
Code:
protected void Application_Error(Object sender, EventArgs e)
{
String sError =
Server.GetLastError().GetBaseException().Message;
Context.Response.Redirect("ErrorViewer.aspx?" + "Error=" +
HttpUtility.UrlEncode(sError));
}
and of my web.config :
Code:
<customErrors mode="On" defaultRedirect="ErrorViewer.aspx"/>
and at least of the ErrorViewer.aspx.cs :
Code:
protected System.Web.UI.WebControls.Label Label1;
private void Page_Load(object sender, System.EventArgs e)
{
if (Context.Request.Params["Error"] != null)
{
String ErrorMessage =
HttpUtility.UrlDecode(Context.Request.Params["Error"]);
if (ErrorMessage.StartsWith("Login failed") ||
ErrorMessage.StartsWith("Invalid authorization
specification"))
{
Context.Response.Redirect("Default.aspx");
}
else
{
Label1.Text = ErrorMessage;
}
}
else
{
Label1.Text = "Unknown error.";
}
}
On my development server and integration server, whenever I have an
error, I am well redirected to :
http://server/MyWebSite/ErrorViewer.aspx?Error=Attempt+to+insert+duplicate+key#edit
But on my production server, I am redirected to :
http://server/MyWebSite/ErrorViewer.aspx?aspxerrorpath=/MyWebSite/TranscoDealingCenter.aspx#edit
Knowing that TranscoDealingCenter.aspx is the page from which the
error has been generated.
I don't understand the particular behaviour that I have in production.
I have checked and it seems that the ASPNET account has got the same
rights on all the environments, it is part of the same user group.
However, it seems that there is a server setting difference, but I
have absolutely no idea which one it can be. Indeed, in one case I go
through the Application_Error of the global.asax except in
production...
Thanks for your help.
JULIEN
Code:
protected void Application_Error(Object sender, EventArgs e)
{
String sError =
Server.GetLastError().GetBaseException().Message;
Context.Response.Redirect("ErrorViewer.aspx?" + "Error=" +
HttpUtility.UrlEncode(sError));
}
and of my web.config :
Code:
<customErrors mode="On" defaultRedirect="ErrorViewer.aspx"/>
and at least of the ErrorViewer.aspx.cs :
Code:
protected System.Web.UI.WebControls.Label Label1;
private void Page_Load(object sender, System.EventArgs e)
{
if (Context.Request.Params["Error"] != null)
{
String ErrorMessage =
HttpUtility.UrlDecode(Context.Request.Params["Error"]);
if (ErrorMessage.StartsWith("Login failed") ||
ErrorMessage.StartsWith("Invalid authorization
specification"))
{
Context.Response.Redirect("Default.aspx");
}
else
{
Label1.Text = ErrorMessage;
}
}
else
{
Label1.Text = "Unknown error.";
}
}
On my development server and integration server, whenever I have an
error, I am well redirected to :
http://server/MyWebSite/ErrorViewer.aspx?Error=Attempt+to+insert+duplicate+key#edit
But on my production server, I am redirected to :
http://server/MyWebSite/ErrorViewer.aspx?aspxerrorpath=/MyWebSite/TranscoDealingCenter.aspx#edit
Knowing that TranscoDealingCenter.aspx is the page from which the
error has been generated.
I don't understand the particular behaviour that I have in production.
I have checked and it seems that the ASPNET account has got the same
rights on all the environments, it is part of the same user group.
However, it seems that there is a server setting difference, but I
have absolutely no idea which one it can be. Indeed, in one case I go
through the Application_Error of the global.asax except in
production...
Thanks for your help.
JULIEN