gpt4 book ai didi

javascript - 回发后未调用 pageload()

转载 作者:行者123 更新时间:2023-11-28 10:17:57 25 4
gpt4 key购买 nike

我的 div“附件”在回发后没有刷新并且 pageLoad() 没有被调用

    <div id ="attachments">
<asp:UpdatePanel ID="updtPnlAttachements" runat ="server" >

<ContentTemplate>
<asp:GridView ID="gvAttachments" runat="server" ClientIDMode = "Static" Width ="100%">
<Columns>


</Columns>
<EmptyDataTemplate>
<div> Sorry Empty</div>
</EmptyDataTemplate>
</asp:GridView>

</ContentTemplate>

</asp:UpdatePanel>

调用此按钮后

 public void ReportLinkButton_Click(object sender, EventArgs e)
{

LinkButton Lbtn = (LinkButton)sender;
string assessmentString = Lbtn.CommandArgument;
Guid assessmentID = new Guid(assessmentString);

DR_Data db = new DR_Data();
var reports = db.GetAttachmentsByAssessmentID(assessmentID).ToList();

gvAttachments.DataSource = reports;
gvAttachments.DataBind();

if (reports.Count() > 0)
{
gvAttachments.HeaderRow.TableSection = TableRowSection.TableHeader;
gvAttachments.FooterRow.TableSection = TableRowSection.TableFooter;
}


}

我的脚本看起来像这样

       function pageLoad() {var totalRows = $("#<%=gvAttachments.ClientID %> tr").length;

if (totalRows > 0) {

$("#dialog:ui-dialog").dialog("destroy");

$("#attachments").dialog({
hide: "fold",
show: "blind",
height: 500,
width: 800,
modal: true
});
}

$('#gvNcReports').dataTable({
"bJQueryUI": true,
"sPaginationType": "full_numbers"
});
}`

任何建议。谢谢

*更新**

我有多个更新面板,一旦我删除它们,它就起作用了。

最佳答案

尝试:

using Sys.Application.add_load(function(sender, e) {

});

看看这是否会产生影响。当更新面板请求结束时,您还可以使用:

var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_endRequest(function(sender, e) {

});

HTH。

关于javascript - 回发后未调用 pageload(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6194026/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com