I have around 50+ AJAX WebMethods in my *.aspx site, which is called by JQuery (sometimes raw jquery, sometimes over lib's).
Here are a few examples:
[WebMethod]
public static string GetLog()
{
DAL.LogService log = new DAL.LogService();
string items = log.GetLog();
return items;
}
[WebMethod]
public static void ClearBenchmarks()
{
DAL.LogService log = new DAL.LogService();
log.ClearBenchmarks();
}
[WebMethod]
public static void WriteLog(string message1, string message2, string user, string type)
{
DAL.LogService.WriteLog(message1, message2, user, type);
}
In fact in the most time, they only redirect to the dataLayer of my application, but in fact, ofc, I have 50+ single methods...
Now I want to include error handling in my application - how to do that globaly without having try catch in every single method?