我正在使用 jquery-ajax 将动态用户控件(ascx)加载到页面(aspx)。运行时,我想要一个已加载到 Page 中的用户控件实例。我能怎么做?谢谢
function funDersinSubeleriniGoster(programDersGrubDersId) {
$.blockUI();
var ControlName = "OgrenciUserControls/KayitYenileme/DersSubeleriControl.ascx";
$.ajax({
type: "POST",
url: "KayitYenileme.aspx/DersinSubeleriniYukle",
data: "{controlName:'" + ControlName + "',programDersGrubDersId:'" + programDersGrubDersId + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
$.unblockUI();
//$('#dialogDersKayitPopup').html(response.d).dialog({ resizable: false, height: 600, width: 800, modal: true });
},
failure: function (msg) {
$.unblockUI();
//$('#dialogDersKayitPopup').html(msg).dialog({ resizable: false, height: 600, width: 800, modal: true });
}
});
return false;
}
页面
[WebMethod]
public static void DersinSubeleriniYukle(string controlName, int programDersGrubDersId)
{
}
private void UserControlsFind()
{
//I want to have user controls instance.
}