Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello,

i want to show error message for any error or exception occures.

I have written follwing code in Global.asax

C#
void Application_Error(object sender, EventArgs e)
       {
           Response.Write("<Error message...");
       }


but its not working. I have put dubug point on this method but that is also not working.

In the web.config <customErrors mode="RemoteOnly"/> is set.

Anyone havbe idea what is the problem.

Regards,
Viprat
Posted

1 solution

Add your method like below
C#
 protected void Application_Error(object sender, EventArgs e)
        {
            Response.Write("<error message...");

}

I recommend you to follow the exception handling explain in the below link
Exception Handling in MVC[^]
Hope this helps
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900