间隔一定时间后自动刷新iframe [英] AutoRefresh iframe after some interval

查看:558
本文介绍了间隔一定时间后自动刷新iframe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个tabcontainer,其中有3个tabpanel

Hi,I have a tabcontainer in which i have 3 tabpanel

<cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0">
       
            <cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="TabPanel1">
                <ContentTemplate>
                    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br />
                    <asp:Button ID="Button1" runat="server" Text="Button" />
                </ContentTemplate>
            </cc1:TabPanel>
           
            <cc1:TabPanel ID="TabPanel2" runat="server" HeaderText="TabPanel2">
                <ContentTemplate>
                    <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox><br />
                    <asp:Button ID="Button2" runat="server" Text="Button" />
                </ContentTemplate>
            </cc1:TabPanel>
                      
            <cc1:TabPanel ID="TabPanel3" runat="server" HeaderText="TabPanel3">
                <ContentTemplate>
                      <iframe id="iframeTHIRD" runat="server" src="Mypage.aspx" ></iframe>
                </ContentTemplate>
            </cc1:TabPanel>
           
        </cc1:TabContainer>


我希望每20分钟我拥有iframe的第3个标签面板都应该自动刷新.


I want at every 20min my 3rd tab panel in which i have iframe should be auto refresh.

<body  önload="JavaScript: AutoRefresh(6000);">


为此,我的返回代码为:


for this i had return code as:

<script type="text/JavaScript">
<!--
function AutoRefresh(interval) {
	setTimeout("function(){myTimer()}",interval);
}

function myTimer()
{
var thridtabcontainer=document.getelementbyid("TabPanel3");
__doPostBack('thridtabcontainer', '')
}

function __doPostBack(eventTarget, eventArgument) 
{

//nothing 

}

//   -->
</script>


但我不知道这是否行得通.我必须找到哪个ID(第三个面板或iframe)
在我的javascript函数myTimer()中,或者反之亦然.请帮助


but i dont know this will work or not.Which id i have to find (third panel or iframe)
in my javascript function myTimer() or is ter any otherway to do so.Please help

推荐答案

您可以尝试此
将Meta标签放在Mypage.aspx页的开头部分
You can try this
Put Meta tag in head section of Mypage.aspx page
<head> <meta http-equiv="refresh" content="6000" /> </head>




试试这个:
Hi,

Try this:
Response.AddHeader("Refresh", "10");


这将每10秒刷新一次IFrame.
将其放在IFrame引用的页面的页面中.

祝一切顺利.
--Amit


This will refresh the IFrame in every 10 seconds.
Put it inside the page lode of the page referred by IFrame.

All the best.
--Amit


这篇关于间隔一定时间后自动刷新iframe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆