For some weird reason, I can't debug the code inside my static web method. The code itself is like this:
public partial class StoredProcedures : BasePage//Inherits from System.Web.UI.Page
{
...........................
[WebMethod(EnableSession = true)]
public static object ProcedureList(int jtStartIndex, int jtPageSize, string jtSorting)
{
if (jtStartIndex == null)
jtStartIndex = 0;
if (jtPageSize == null)
jtPageSize = 0;
if (string.IsNullOrEmpty(jtSorting))
jtSorting = null;
//Get data from database
string sql = "select object_name as Name, status as Status, created as Created from user_objects where object_type = 'PROCEDURE'";
DataTable ds = RequestSingleton.DBConnection.GetDataTable(sql);
int procCount = ds.Rows.Count;
if (procCount != 0)
{
DataFiller<StoredProc> dtfStoredProc = new DataFiller<StoredProc>();
List<StoredProc> list = null;
list = dtfStoredProc.FromDataTableToList(ds);
.........................
..............................
The JQuery calls the static method, and if I insert breakpoints inside the static method, they are not used. It's probably something obvious that I'm missing, but seems kinda weird that i can't debug the webmethod. The thing is that I want to see what is going on in there, since something is not right, and without debugging, it's kinda hard. Inserting breakpoints in any other place in the ASP.NET project is not a problem, but in that code block, it is.
I have found why the static method couldn't be debugged: the value of trace in the web.config file must be set to true, otherwise the breakpoints are not invoked. So to anyone who might have this problem when debugging static webmethods in ASP.NET, check that trace is set to true. It doesn't matter whether the pageOutput is false or true, but trace has to be set to true. Thanks for your time and answers.