event Page_Error(object sender, EventArgs e) doesn't handle expection. Exception is handling by Visual Studio.
I tried throw Exception by Page_Load or button but still isn't working. I can't search any information about this problem. In my book is show simple example with Page_Load, Page_Error, Button and according my book this should working. I guess that in Web.config is missing something.
void Page_Error(object sender, EventArgs e)
{
Response.Clear();
Exception ex = Server.GetLastError();
Response.Write("Something not yet");
Response.Write(ex.Message);
Server.ClearError();
}
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("Load event fired");
throw new Exception();
}
I expect that throwed Exception will be handled by Page_Error, not by Visual Studio.