MyPage.aspx後:更新文本框的值呈現
<asp:TextBox ID="txtPageCount" runat="server" EnableViewState="true" ></asp:TextBox>
<rc:ReportControl id="ReportControl1" runat="server" />
ReportControl.ascx:
<div>
<rsweb:ReportViewer ID="ReportViewer1" runat="server" CssClass="ReportViewer" AsyncRendering="false"
OnPreRender="RptViewer_PreRender" EnableViewState="true" Width="100%" PageCountMode="Actual"
WaitMessageFont-Size="1.2em" ShowToolBar="true" Visible="true"
InteractiveDeviceInfos="(Collection)">
<LocalReport></LocalReport>
</rsweb:ReportViewer>
</div>
後報告處理(RptViewer_PreRender
),在Render
事件MyPage.aspx
,我更新值的txtPageCount
。
protected override void Render(HtmlTextWriter writer)
{
base.Render(writer);
TextBox pageCount = new TextBox();
pageCount = (TextBox)RtDialysisSummary.FindControl("txtPageCount");
pageCount.Text = Convert.ToString(ReportViewer1.TotalPages);
}
textbox的值沒有更新。
謝謝。你是對的。 – mike44