【发布时间】:2013-02-26 11:37:29
【问题描述】:
我想用 ajax 和 asp.net 用户控件,
$.ajax({
type: "POST",
url: "*TCSection.ascx/InsertTCSection",
data: "{id:'" + id + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
var URL = msg.d;
alert(URL);
});
.cs代码
[WebMethod]
public static string InsertTCSection(string id)
{
string result = "deneme";
return result;
}
【问题讨论】:
-
您遇到错误了吗?
-
我在服务器端函数添加断点,它没有被命中
-
你不能通过jquery调用保存在UserControl中的方法,因为在运行时没有.ascx这样的资源,它与保存它的页面合并