Tag:webmethod

  • Example of calling webmethod method in aspx.cs page with juery’s Ajax method

    Time:2021-9-9

    First, create a public static method in the ASPX. CS file, and then add the webmethod attribute.For example:[WebMethod] public static string GetUserName() { //…… } If you want to operate a session in this method, you must also set the enablesession property of webmethod to true. Namely:[webmethod (enablesession = true)] / / or [webmethod (true)]public […]