框架与母版页 [英] Frames vs. Master Pages

查看:65
本文介绍了框架与母版页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先让我说我不是.net程序员,但我非常擅长

ASP,JavaScript,HTML,DHTML,Flash开发。


我一直在阅读这里有关Frames与Master Pages的帖子,并且

似乎是为什么在使用Master Page时可以使用Frames?

如果主页面只更新了一个部分而没有重新显示

整个页面。我们有一个网站有一些小的瑞士法郎横幅缺少一个更好的术语,我们不希望他们的内部时钟重置和

重新开始在主页面上点击一个链接的时间,它重新显示(又名为刷新)。


另外,我们有一个标题栏顶部,左侧和底部栏上的菜单带有

版权,隐私政策等。这些都不会改变或需要更新

。如果我使用的是框架,我只会更新主要框架。带有

内容的框架。如果你使用母版页,不是所有这些部分,顶部栏,菜单

在左边,底部栏必须重新绘制/刷新/重新显示

(无论你想叫什么)每次点击一个链接。


对不起,如果我问的是愚蠢的问题,但我总是认为*适当的*

使用框架是一个强大的功能,可以为那些连接速度很慢的人提供快速连接。

Let me first by saying I am NOT a .net programmer, but am very skilled with
ASP, JavaScript, HTML, DHTML, Flash development.

I''ve been reading through posts here about Frames vs. Master Pages and there
seems to be the thought of why use Frames when you can use a Master Page?
How does a Master Page only update a section without re-displaying the
entire page. We have a site that has some small swf banners for lack of a
better term that we don''t want to have their internal clock reset and to
start over each time a link is clicked on the master page and it''s
re-displayed (aka refreshed).

Also, we have a title bar at the top, menu on the left and bottom bar with
copyright, privacy policy, etc. None of these will change or need to be
updated. If I was using frames I would only update the "Main" frame with the
content. If you use a Master Page, won''t all these sections, top bar, menu
on the left, and bottom bar have to be re-drawn/refreshed/re-displayed
(whatever you''d like to call it) each time a link is clicked.

Sorry if I''m asking dumb questions, but I''ve always considered the *proper*
uses of frames a powerful feature to have a site fast for people who have a
slow connection.

推荐答案

主页不会*刷新一个没有加载整个页面的部分。

一般不鼓励框架的原因是会话状态是

很难用Frames来管理。根据浏览器的不同,每个Frame可能有自己的Session会话,并且协调它们客户端和服务器端可能会有问题。母版页提供了一种方法来保持格式主题和

内容在整个页面中保持一致,而无需每页重复一次

。但每个页面加载MasterPage中的所有HTML,只需要访问
.


-

HTH,


Kevin Spencer

Microsoft MVP

..Net开发人员

你可以带鱼去一辆自行车,

,但需要很长时间,

,自行车必须*要*改变。


" M.Siler" <乔****** @ NoSpam.com>在消息中写道

新闻:Ow ************** @ TK2MSFTNGP10.phx.gbl ...
A Master Page does *not* refresh a section withnout loading the entire page.
The reason why Frames are generally discouraged is that Session State is
hard to manage with Frames. Depending upon the browser, each Frame may have
its own Session, and coordinating them client and server-side can be
problematic. Master Pages provide a way to keep a formatting theme and
content consistent throughout your pages without having to duplicate it for
each page. But each page loads all of the HTML in the MasterPage when it''s
accessed.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.

"M.Siler" <Jo******@NoSpam.com> wrote in message
news:Ow**************@TK2MSFTNGP10.phx.gbl...
首先让我说我不是.net程序员,但我非常熟练使用ASP,JavaScript,HTML,DHTML,Flash开发。

我一直在阅读有关Frames vs. Master的帖子页面和
似乎有为什么在使用Master
页面时使用Frames的想法? Master Page如何只更新一个部分而不重新显示整个页面。我们有一个网站,有一些小的SWF横幅缺乏更好的术语,我们不想让他们的内部时钟重置和每次在主人点击链接时重新开始页面,它重新显示(也就是刷新)。

此外,我们在顶部有一个标题栏,左侧和底部的菜单有
版权,隐私政策等。这些都不会改变或需要更新。如果我使用的是框架,我只会更新主要框架。框架内容。如果你使用母版页,不是所有这些部分,左边的顶部栏,
菜单和底栏都必须重新绘制/刷新/重新显示(无论你是什么' 我想打电话给它每次点击一个链接。

对不起,如果我问的是愚蠢的问题,但我一直认为
*正确*框架的使用是一个强大的功能,可以为人们提供快速连接的网站。
Let me first by saying I am NOT a .net programmer, but am very skilled
with ASP, JavaScript, HTML, DHTML, Flash development.

I''ve been reading through posts here about Frames vs. Master Pages and
there seems to be the thought of why use Frames when you can use a Master
Page? How does a Master Page only update a section without re-displaying
the entire page. We have a site that has some small swf banners for lack
of a better term that we don''t want to have their internal clock reset and
to start over each time a link is clicked on the master page and it''s
re-displayed (aka refreshed).

Also, we have a title bar at the top, menu on the left and bottom bar with
copyright, privacy policy, etc. None of these will change or need to be
updated. If I was using frames I would only update the "Main" frame with
the content. If you use a Master Page, won''t all these sections, top bar,
menu on the left, and bottom bar have to be
re-drawn/refreshed/re-displayed (whatever you''d like to call it) each time
a link is clicked.

Sorry if I''m asking dumb questions, but I''ve always considered the
*proper* uses of frames a powerful feature to have a site fast for people
who have a slow connection.



>我一直在阅读有关Frames与Master Pages的帖子以及
> I''ve been reading through posts here about Frames vs. Master Pages and
,当你可以使用Master
页面时,似乎有为什么使用Frames的想法?


为什么要使用Frames?

主页如何只更新一个部分而不重新显示
整个页面。


在大多数情况下,这不应该是一个问题。这就是网络

通常如何运作。


由于各种原因,帧数很糟糕。它们在某些

实例中很有用,但实际上,它们导致的问题多于解决大多数时间的问题。

我们有一个网站有一些小的swf横幅缺乏一个更好的术语
我们不希望他们的内部时钟重置并重新开始
每次在主页面上点击一个链接并重新显示它(又名<刷新)。


使用cookies和一些服务器端脚本与SWF文件进行通信

如果动画已经播放,则不要重复动画。

此外,我们在顶部有一个标题栏,左侧和底部的菜单有
版权,隐私政策等。这些都不会改变或需要更新。


使用服务器端包含或网页控件。

对不起,如果我问的是愚蠢的问题,但我一直认为是
*正确*使用框架是一个强大的功能,可以为人们提供快速连接的网站。
there seems to be the thought of why use Frames when you can use a Master
Page?
Why use Frames ever?
How does a Master Page only update a section without re-displaying the
entire page.
For the most part, that shouldn''t ever be a problem. That''s how the web
normally works.

Frames are bad for a variety of reasons. They can be useful in certain
instances, but really, they cause more problems than solve most of the time.
We have a site that has some small swf banners for lack of a better term
that we don''t want to have their internal clock reset and to start over
each time a link is clicked on the master page and it''s re-displayed (aka
refreshed).
Use cookies and some server-side scripting to communicate with the SWF file
to NOT repeat the animation if it''s already played.
Also, we have a title bar at the top, menu on the left and bottom bar with
copyright, privacy policy, etc. None of these will change or need to be
updated.
Use server side includes,or web controls.
Sorry if I''m asking dumb questions, but I''ve always considered the
*proper* uses of frames a powerful feature to have a site fast for people
who have a slow connection.




这是一个糟糕的功能。书签问题,使用

后退按钮导航,可能导致可访问性问题,搜索引擎排名问题,




为了正确实现框架,必须使用大量客户端和/或

服务器端脚本来克服这些问题,并且在这一点上,一个

意识到帧开始时没有任何好处。


-Darrel



It''s a bad feature. Causes problems with bookmarking, navigating with the
back button, can cause accessibility issues, search engine ranking issues,
etc.

To implement frames ''properly'' one must use a lot of client side and/or
server side scripting to overcome the problems and, at that point, one
realized that frames really add no benefit to begin with.

-Darrel


>混合并匹配内部/外部内容。框架的一些用途:)


是的。公平地说,框架和iframe肯定有用。但是,

大部分时间框架都是出于错误的原因而实施的。 ; o)
> Mix and match internal/external content. There are some uses of Frames : )

Yes. To be fair, there certainly are uses for frames and iframes. However,
most of the time Frames are implemented for the wrong reasons. ;o)
在某些情况下,页面的某些部分需要刷新 - 否则就不会有像客户端回发或AJAX这样的技术。
There are situations where parts of the page need to be refreshed -
otherwise there wouldn''t be technology like Client-Side Postbacks or AJAX.




帧不是页面的一部分''。框架本身就是页面。一个框架集是一个单独框架的组合。


AJAX旨在更新页面上的数据,而不必担心需要

将您的页面拆分为单独的细分,并通过框架集进行排列。


-Darrel



Frames aren''t ''part of a page''. Frames are pages themselves. A frameset is a
combination of separate frames.

AJAX is designed to update data on a page without the mess of having to
split your page into individual segments and arrange them via a frameset.

-Darrel


这篇关于框架与母版页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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