I need to load usercontrol using jquery. I created a handler class and loaded usercontrol through that. The jquery part is:
$.ajax({
    type: "POST",
    url: "HandlerAdminManageDataSideMenu.ashx",
    contentType: "application/html; charset=utf-8",
    dataType: "html",
    success: function (data) {
        alert("success" + data);
        $(".admin_side_menu").append(data);
    },
    error: function (XMLHttpRequest, textStatus, errorThrown) {
        debugger;
        alert("Error Occured!");
    }
});
My handler file looks like :
Public Class HandlerAdminManageDataSideMenu
    Implements System.Web.IHttpHandler, IRequiresSessionState
    Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
        'context.Response.ContentType = "text/plain"
        'context.Response.Write("Hello World!")
        context.Response.ContentType = "text/html"
        context.Response.Write(RenderPartialToString("Shared\AdminManageDataSideMenu.ascx"))
    End Sub
    Private Function RenderPartialToString(ByVal controlName As String) As String
        Dim page As New Page()
        Dim control As Control = page.LoadControl(controlName)
        page.Controls.Add(control)
        Dim writer As New StringWriter()
        HttpContext.Current.Server.Execute(page, writer, False)
        Return writer.ToString()
    End Function
    ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
        Get
            Return False
        End Get
    End Property
End Class
The line HttpContext.Current.Server.Execute(page, writer, False) throws error: 
Error executing child request for handler 'System.Web.UI.Page'
Can anyone help me on this?
 
     
    