Page level error in ASP.NET
-
Can anyone tell me how to apply Page_Error in ASP.NET? I have written the following code in some.aspx.cs file. protected void Button1_Click(object sender, EventArgs e) { int[] a=new int[5]; a[5] = 0; } public void Page_Error(object sender, EventArgs e) { Response.Write("Error occured..."); } Where I am making mistake? Please help....
NEHA GUPTA
-
Can anyone tell me how to apply Page_Error in ASP.NET? I have written the following code in some.aspx.cs file. protected void Button1_Click(object sender, EventArgs e) { int[] a=new int[5]; a[5] = 0; } public void Page_Error(object sender, EventArgs e) { Response.Write("Error occured..."); } Where I am making mistake? Please help....
NEHA GUPTA
-
Ok you implemented the page error event to write a string to output stream. It will fire whenever the page encounter an error. So what is your problem? What you want to attain?
I am getting an exception instead of getting response on the web page.
NEHA GUPTA
-
I am getting an exception instead of getting response on the web page.
NEHA GUPTA
-
As said by you, I applied Server.ClearError() in Page_Error event but still same output.
NEHA GUPTA
-
Can anyone tell me how to apply Page_Error in ASP.NET? I have written the following code in some.aspx.cs file. protected void Button1_Click(object sender, EventArgs e) { int[] a=new int[5]; a[5] = 0; } public void Page_Error(object sender, EventArgs e) { Response.Write("Error occured..."); } Where I am making mistake? Please help....
NEHA GUPTA
U just need to modify Page_Error()
public void Page_Error(object sender, EventArgs e)
{
Response.Write("Error occured...");
Server.ClearError();
}Teja Aj, http://opexsolution.com/forum/[^] Fan of: http://www.abtstudioz.com/[^]