从IFRAME asp.net刷新基页IFRAME、asp、net

2023-09-06 21:48:25 作者:摇床尖叫亚麻得i

我有一个内部的iframe等asp.net页面的页面。

I have page with other asp.net page inside iframe.

和按钮点击里面的iframe,我需要从服务器端刷新主页。

And on button click inside iframe i need to refresh main page from server side.

怎么了?

推荐答案

请使用javascript,你可以很容易地做到这一点。

Make use of javascript and you can easily do it

调用下面的函数上的按钮,点击

call the following function on your button click

<script language="javascript">
function RefreshParent()
{
window.parent.location.href = window.parent.location.href;
}
</script>

从CS code如果在iframe打开aspx页面

From the cs code if you are opening the aspx page in the iframe

Page.RegisterStartupScript("RefreshParent","<script
language='javascript'>RefreshParent()</script>");