Qus:    I am not able to use the Page Methods option. What should I do to use webMethods?
Apr 19, 2021 10:54 1 Answers Views: 522 DIVYA
Prev Next
Answers (1)
RITA Apr 20, 2021 10:16
Answer:   1. You need to have the following attributes to the WebMethod in ASPX
[System.Web.Services.WebMethod()]
[System.Web.Script.Services.ScriptMethod()]
public static string GetCountry()
{

// your code

}
2. ScriptManager EnablePageMethods to TRUE

3. In Javascript


function GetCountryName() {
PageMethods.GetCountry();
}

Post Your Answer
Guest User

Not sure what course is right for you?

Choose the right course for you.
Get the help of our experts and find a course that best suits your needs.


Let`s Connect