[WebMethod] is static and if the User.Identity.Name is used this error "Keyword 'this' is not valid in a static property, static method, or static field initializer" is thrown.
Reason being this.Page.User.Identity is non static and usage is not valid.
ex:
someVariable = someMethodArgument(HttpContext.Current.User.Identity.Name);
Reason being this.Page.User.Identity is non static and usage is not valid.
Instead using " HttpContext.Current.User.Identity.Name " will resolve the error since current is static.
ex:
someVariable = someMethodArgument(HttpContext.Current.User.Identity.Name);