如何仅刷新页面正文而不刷新页眉和页脚 [英] how to refresh only body of the page not header and footer

查看:80
本文介绍了如何仅刷新页面正文而不刷新页眉和页脚的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我的表单中有页眉,页脚和中间层.
在标题中,我有三个锚标记,例如

Suppose i have a form in which i have header,footer and the middle layer.
In the header i have three anchor tag such as

<a href="page1.aspx" >clickme1</a>
<a href="page2.aspx" >clickme2</a>
<a href="page3.aspx" >clickme3</a>



我想每当我单击linkbutton时,都应该刷新中间层,而不是
整页.

与代码项目中的相同,即
主页|文章|快速解答|

每当我单击菜单时,仅包含的内容都不会刷新整页.



I want whenever i click on the linkbutton only the middle layer should be refresh not
the full page.

same as it is in the codeproject ie
Home|Articles|Quick Answers |

whenever i click on the menu only the contain are refresh not full page.

推荐答案

据我所知,您有很多方法可以做到这一点,我将为您提供一些方法.

1.您可以在中间层使用IFrame.
2.您可以使用ajax更改中间层.
3.您可以将框架设置为整页.

希望这对您有所帮助.
As i know you have number of way to do this, I will give you few.

1. You can use IFrame to your middle layer.
2. You can use ajax to change your middle layer.
3. You can use frame set to your full page.

I hope this will help you.


这只是一个iframe示例,我急忙编写,因此如果有任何错误,请留下评论,我将对其进行纠正.

我希望这会有所帮助


This is just a iframe example, I write it in hurry so if there any error please leave a comment i''ll make it correct.

I hope this will help


<html>

<head>

<title>Untitled 1</title>


<pre lang="Javascript"><script language="JavaScript">
function go(loc){
    document.getElementById['calendar'].src = loc;
}
</script>


</head>

<body>
<iframe id="calendar" src="about:blank" width="1000" height="450" frameborder="0" scrolling="no"></iframe>

<form method="post">
    <input name="calendarSelection" type="button"  önclick="go('page1.aspx')" value="Day" />
    <input name="calendarSelection" type="button"  önclick="go('page2.aspx')" value="Week" />
    <input name="calendarSelection" type="button"  önclick="go('page3.aspx')" value="Month" />
    </form>

</body>

</html>




谢谢




Thanks


这篇关于如何仅刷新页面正文而不刷新页眉和页脚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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