[英]PageMethods not working because method is not calling from javascript
我有一個分頁方法,
PageMethods.AuthUser(username,password,onsuccess, on fail);
我后面的代碼如下
public string AuthUser(string username,string password){return ""}
我不知道我在做什么錯,只是沒有用
是的,我明白了我在方法后面的代碼中缺少靜態功能,並且發現該方法應該與webmethod一起使用。 謝謝xyz的評論
應該是
[WebMethod]
public static AuthUser(...)
添加ScriptManager屬性EnablePageMethods="true"
更改您的代碼
[System.Web.Services.WebMethod]
public static string AuthUser(string username,string password){return ""}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.