[System.Web.Services.WebMethod]
public static string GetChapterDetails()
{
string query = "SELECT * FROM GitaDummy.dbo.Glossary WHERE Chapter_id =@ChapterId ";
SqlCommand cmd = new SqlCommand(query);
var id = HttpContext.Current.Request.RequestContext.RouteData.Values["ID"];
if (id == null)
{
cmd.Parameters.AddWithValue("@ChapterId", 1);
}
else
{
cmd.Parameters.AddWithValue("@ChapterId", id);
}
return GetData(cmd).GetXml();
}
I am trying to get the ID but its giving me null all the time
I am then binding them in my AJAX