I have loaded a user control dynamically using jquery ajax in my asp.net application.
Every thing is working fine except after the user control loaded an asp.net link button on the page is not firing the click event. The link button is not dynamically loaded.
Please help me to resolve the issue.
Thanks
Shibin V.M
html markup
logout
More
js web method calling function
function callRefinepopUpAjax(type, id)
{
var panel_popup_layer = $('#id');
var val;
if (Serach.hasOwnProperty(type))
val = Serach[type];
$.ajax({
type: "POST",
url: "../ProfileSearchService.asmx/LoadRefinePopUp",
data: "{Type:'" + type + "',Value:'" + val + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
$(panel_popup_layer).html(msg.d);
setUp();
}
});
}
web method
public string LoadRefinePopUp(string Type, string Value)
{
Page page = new Page();
UserControl ctl = new UserControl();
ArrayList list = new ArrayList();
list.Add(Value);
Context.Items["WebForm1List"] = list;
try
{
ctl =
(UserControl)page.LoadControl("~//popup" + Type + ".ascx");
HtmlForm form = new HtmlForm();
form.Controls.Add(ctl);
page.Controls.Add(form);
StringWriter textWriter = new StringWriter();
HttpContext.Current.Server.Execute(page, textWriter, false);
return CleanHtml(textWriter.ToString());
}
catch (Exception ex)
{
return ex.toString();
}
}