我如何ASP.NET页面上使用框架? [英] How do I use frame on ASP.NET page?

查看:112
本文介绍了我如何ASP.NET页面上使用框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你怎么一个asp.net页面上正确使用框架,让我有一个左边框和右边框,当我点击左边框架psented页面$ P $的链接,它加载的页面,根据右帧?在此之上,我需要的所有右框的页面的母版页。

How do you correct use frame on a asp.net page, so I have a left frame and a right frame, when I click the links on the page presented in the left frame, it loads the according page in the right frame? On top of this, I need to have a master page on all the right frame's pages.

我如何做到这一点?或有另一种方式来达到同样的效果呢?

How do I do this? or is there another way to achieve the same effect?

谢谢,
雷。

推荐答案

是啊。框架是邪恶的。你真的不应该使用它们。

Yup. Frames are evil. You shouldn't really use them.

他们造成问题,但在一个(非常)少数边缘的情况下,他们可能是有用的,并在开发时间上更便宜,但仍然显示生成的API文档中了不少。

They cause problems, but in a (very)few edge cases they can be useful and cheaper in terms of development time, they still show up in generated api documentation quite a lot.

但无论如何,看到你怎么问怎么使用它们,我们开始吧。

But anyway, seeing as how you asked how to use them, here we go

首先登场的,这取决于你是否要使用一个框架,或者只是把一些内部框架到页面中,内部框架也许容易,但将描述一个框架。下面的一些引用。如果你周围archive.org自由之路机挖,你将能看到一些例子,也采用Sun的在线Java文档是在框架集,但没有看过他们多年。

First up, it depends on whether you want to use a frameset, or just put some iframes into a page, iframes maybe easier, but will describe a frameset. Some references below. If you dig around the wayback machine on archive.org, you will get to see some examples, also Sun's online java docs used to be in framesets, but have not looked at them for years.

http://www.w3schools.com/tags/tag_frameset.asp

http://www.w3schools.com/tags/tag_iframe.asp

基本上,每一帧的内容是各个页面,并且本身必须被命名为框架,其中包含框架文件,这可能看起来有点像这样内:

Basically, the contents of each frame are individual pages, and the frames themselves must be named, within the file which contains the frameset, which might look a little like this:

<html>
<frameset cols="25%,75%">
  <frame name="_left" src="nav.aspx" />
  <frame name="_right" src="foo.aspx" />
</frameset>
</html>

所以,对于锻炼; Tibial的缘故,给人留下框架属性名=__左和NAME =__权为正确的。

So, for the sake of the excercise, give the left frame attribute name="__left" and name="__right" for the right.

关于链接
重要的位
*需要针对该帧应该有目标=_self,任何需要逃跑的框架和设置父页面的位置,应该有目标=顶你的右边框架中的任何链接。

*在你的左边框架中的链接需要有属性目标=权,而应该适当的文档加载到链接被点击时,右框架。

*The links in your left frame will need to have the attribute target="right", and that should load the appropriate document into the right frame when the link is clicked.

它的其余部分是pretty多正常,把你的右手帧的内容作为一个正常的页面,使母版页为正常,一切正常的HTML,头部,身体标记等,有没有什么有关ASPNET或PHP或别的什么,它只是HTML框架不同。

The rest of it is pretty much normal, treat the contents of your right hand frame as a normal page, make a master page as normal, all the normal html, head, body tags etc. There is nothing really different about frames in aspnet or php or anything else, its just html.

有你有它,可能有一些事情我已经错过了,因为他们不是我使用非常频繁,这些天,但有时,当可和所有并不重要,他们可以是一个快速,肮脏的修补程序。例如在W​​eb服务站点,将由谁明白是怎么回事,一个怪胎获得走访了一年12次一些不起眼的管理页面。

There you have it, there may be a few things I have missed, because they're not something I use very often these days, but sometimes, when accessibility and all that don't matter, they can be a quick and dirty fix. e.g some obscure admin page on a web service site, that will get visited 12 times a year by a geek who understands what is going on.

所以,他们是邪恶的,但不应该阻止你了解他们,你会得到真正明白,为什么他们是邪恶的,并形成自己的意见何时以及何时不使用它们。

So, they are evil, but that shouldn't stop you learning about them, you will get to really understand why they are evil, and form your own opinion as to when and when not to use them.

这篇关于我如何ASP.NET页面上使用框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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