jQuery-Ajax-当用户 更改DropDownList中的选定索引时,如何将ascx加载到DIV中?>

问题描述 投票:2回答:2

在A.ascx中,我有一个DropDownList和一个DIV。 DropDownList是动态填充的。

当用户更改DropDownList中的选定索引时,如何将B.ascx加载到DIV中。这应该通过使用jQuery和Ajax在客户端进行,而无需回发。

在A.ascx中,我有一个DropDownList和一个DIV。 DropDownList是动态填充的。当用户更改DropDownList中的选定索引时,如何将B.ascx加载到DIV中。这应该...

asp.net jquery ajax custom-server-controls
2个回答
2
投票

This article显示您。我花了很长时间才找到一个例子


-1
投票
  function selectedindexchange() {
  $.ajax({
    type: "POST",
    url: "CONTROLNAME.ascx",
    data: "{}",
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: function(msg) {
      $('#ContentDIV').html(msg.d);
    }
  });
});
© www.soinside.com 2019 - 2024. All rights reserved.