Refresh aspx page in ASP.NET tab panel

久未见 提交于 2020-01-06 04:24:45

问题


On my ASP.NET page I am using an iframe and setting its source in code behind the page.

Markup

<asp:TabPanel ID="tabDocs" Enabled="false" HeaderText="Documents" runat="server">
<ContentTemplate>
    <iframe width="100%" height="600" id="frmDocs" frameborder="0" runat="server"></iframe>
</ContentTemplate>
</asp:TabPanel>

Code Behind

 frmDocs.Attributes.Add("src", "/xyz.aspx?vType=EmpRpt&vid=" + EmpID.ToString)

There is a Create Report button on the page, which will save a report in the database and then show the file details (i.e. file name, size and etc.) on page xyz.aspx.

After saving the report I am using Response.Redirect(Request.RawUrl) to refresh the whole page.

Is there any way of reloading just xyz.aspx showing it in a tab instead of reloading the whole page?


回答1:


This is not an ASP.NET problem per se - just incidentally.

Consider using JavaScript to reload the iframe as another SO question addresses.

One possibility per one of the answers to it that you should be able to adapt for your needs is...

document.getElementById('frmDocs').src = document.getElementById('frmDocs').src

..., but there are others you can consider too.



来源:https://stackoverflow.com/questions/24308243/refresh-aspx-page-in-asp-net-tab-panel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!