I am having a problem in using Ajax methods.I have a master page and a content page.I want to use Ajax methods in content page.For that
in cs page in page load:
Ajax.Utility.RegisterTypeForAjax(typeof(testcontent));
i have added this as my content page name is testcontent.
This is my method in cs page :
[Ajax.AjaxMethod()]
public int Getdatabyid(int id)
{
int count = 0 ;
//getting the id and basing on that processing the data and assigning to count
return count;
}
in my aspx page :
function getdata(value)
{
var id = value;
var count = testcontent.Getdatabyid(id);
}
But i am getting the error “testcontent unavailable”.
Can i use Ajax methods in Content Pages which inherits properties from master page.In master page i placed Script Manager…Pls help me out
I found out the solution for the question.
In web.config file,
add these lines of code.
This will allow the Ajax Methods.