加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – 使用jquery调用ascx页面方法

发布时间:2020-12-15 18:37:59 所属栏目:asp.Net 来源:网络整理
导读:我知道我可以使用以下语法使用jquery调用页面方法 $.ajax({ type: "POST",url: "Default.aspx/GetDate",data: "{}",contentType: "application/json; charset=utf-8",dataType: "json",success: function(msg) { // Replace the div's content with the page
我知道我可以使用以下语法使用jquery调用页面方法
$.ajax({
  type: "POST",url: "Default.aspx/GetDate",data: "{}",contentType: "application/json; charset=utf-8",dataType: "json",success: function(msg) {
    // Replace the div's content with the page method's return.
    $("#Result").text(msg.d);
  }
});

这适用于aspx页面,但是可以使用ascx页面吗? (网页控制)

我一直在尝试约半个小时,因为我不能工作,我想知道是否可能。

注意:为了清楚,当我尝试调用ascx页面时,我正在更新jquery中的url

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读