1
我在我的ASP.NET项目中使用token-input plugin。令牌输入无法访问ASP.Net Web方法
我有一个Web方法如下图所示,
public partial class User : System.Web.UI.Page
{
[WebMethod]
public static List<IdAndName> GetDescriptions()
{
return DBQueryManager.GetDistinctDescriptions();
}
$('#DescriptionFilterTxtBox').tokenInput("User.aspx/GetDescriptions", {
hintText: "Key in atleast 2 chars. First 20 match is displayed.",
searchDelay: 25,
minChars: 1,
resultsLimit: 10,
tokenValue: name
});
我试图从GetDescriptions
方法获取数据,并在DescriptionFilterTxtBox
显示它,但它不工作。基本上,该插件无法击中网络方法。
如何从tokeninput插件打到ASP.Net Web方法?任何帮助/建议表示赞赏。
该控件不会GetDescriptions()? – Sachu
@Sachu,是的。它无法在aspx页面中点击webmethod。 –
我使用了mvc..for aspx上的插件,大多数的ppl建议创建一个jason函数并使用url参考[http://stackoverflow.com/questions/25664448/token-input-not-working] – Sachu