执行处理程序'System.Web.UI.Page'的子请求时出错。 [英] Error executing child request for handler 'System.Web.UI.Page'.
本文介绍了执行处理程序'System.Web.UI.Page'的子请求时出错。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的usercontrol在母版页中注册。当我将鼠标悬停在div我的webmethod LoadCommunicationGrid()上时,在母版页中有一个div,它应该绑定gridview控件,但它会出现以下错误。
执行处理程序'System.Web.UI.Page'的子请求时出错。
UserControl(.ascx)
my usercontrol is register in master page. there is a div in master page when i hover over that div my webmethod LoadCommunicationGrid() which supposed to bind the gridview control but it gives following a error.
Error executing child request for handler 'System.Web.UI.Page'.
UserControl(.ascx)
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="TEAMEICCOMMUNICATION.ascx.vb" Inherits="RBSS.TEAMEICCOMMUNICATION" %>
<asp:GridView ID="gridCommunicaiton" runat="server" AutoGenerateColumns="false" GridLines="None"
AlternatingRowStyle-CssClass="odd" RowStyle-CssClass="even" Width="436px" Style="color: Black">
<HeaderStyle CssClass="gridHeader" HorizontalAlign="Left" />
<Columns>
<asp:TemplateField HeaderText="Date" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblDate" runat="server" Text='<%# Eval("EXFB_DATE") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Comments" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblComments" runat="server" Text='<%# Eval("EXFB_COMMENT") %>'></asp:Label>
<%--<asp:LinkButton ID="ReadMoreLinkButton" runat="server" Text="More" CommandArgument='<%#Eval("EXFB_ID")%>'
OnCommand="ReadMoreLinkButton_Click"> </asp:LinkButton>--%>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
.aspx.vb代码
.aspx.vb code
<WebMethod()> _
Public Shared Function LoadCommunicationGrid()
Using page As New Page()
Dim userControl As UserControl = DirectCast(page.LoadControl("~/UserControl/TEAMEICCOMMUNICATION.ascx"), UserControl)
page.Controls.Add(userControl)
Dim dtList As DataTable = clsCommon.ListRecommendation(clsAuth.GetEXTMID)
TryCast(userControl.FindControl("gridCommunicaiton"), GridView).DataSource = dtList
TryCast(userControl.FindControl("gridCommunicaiton"), GridView).DataBind()
page.Controls.Add(userControl)
Dim writer As New StringWriter()
page.Controls.Add(userControl)
HttpContext.Current.Server.Execute(page, writer, False)
Return writer.ToString()
End Using
End Function
jQuery
jQuery
function ShowGrid() {
$.ajax({
type: "POST",
url: "demo.aspx/LoadCommunicationGrid",
data: '{}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (r) {
$("#showCommunicationGrid").show();
$(".hoverCountMessage").hide();
$(".Records").hide();
$(".showCancel").show();
}
});
}
$(".hoverCountMessage").mouseenter(function () {
ShowGrid();
});
推荐答案
.ajax({
type: POST,
url: demo.aspx / LoadCommunicationGrid,
数据:' {}',
contentType:< span class =code-string> application / json; charset = utf-8,
dataType: json,
成功: function (r){
.ajax({ type: "POST", url: "demo.aspx/LoadCommunicationGrid", data: '{}', contentType: "application/json; charset=utf-8", dataType: "json", success: function (r) {
( #showCommunicationGrid)。show();
("#showCommunicationGrid").show();
( 。hoverCountMessage)。hide();
(".hoverCountMessage").hide();
这篇关于执行处理程序'System.Web.UI.Page'的子请求时出错。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文