Skip to content

Exception in ASP.Net

Eric Flamm

Asked Jul 2, 2007, 11:05 PM EDT1 answer
Share
LinkedInX
Hi,

I've picked up a partially developed ASP.Net app in c#. There's a page called ErrorDisplay.aspx, with a code behind of ErrorDisplay.aspx.cs. So far, so good. The code behind defines a partial Class ErrorDisplay, with a property ExceptionDetails (of type Exception).
The catch code on all the other pages reads:
  catch (Exception ec)
  {
  ErrorDisplay.ExceptionDetails = ec;
  Response.Redirect("ErrorDisplay.aspx");
  }
But, when I build the site, I get a collection of errors:
"The name 'ErrorDisplay' does not exist in the current context
N:\My Documents\ASPNET\Project1\Logon.aspx.cs"
All of the pages are at the same level, and I don't think there's a Namespace issue - I tried wrapping ErrorDisplay in a Namespace command, but VS protested there was already an ErrorDisplay class in the global namespace.
So why am I getting these "does not exist in current context" errors, and how do I fix it?

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    If you want quick reply for ur query, then post them in its specific forum i.e ASP.NET forums not in C# forum.
    0