什么是占位符和ContentPlaceHolder? [英] What is placeholder and ContentPlaceHolder?

查看:208
本文介绍了什么是占位符和ContentPlaceHolder?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是占位符和ContentPlaceHolder ??

什么时候在网页中使用

解决方案

PlaceHolder:它用于动态在网页上添加控件。 [ ^ ]示例显示如何使用它。



ContentPlaceHolder:它在母版页中用于定义将在运行时由内容页面填充的区域。 [ ^ ]示例显示如何使用它。


PlaceHolder控件用作要添加的任何控件的容器并可以在任何页面上使用。 ContentPlaceHolder用于保存内容页面中的内容,只能在母版页上使用。



在此查看有关MSDN的文档:



http://msdn.microsoft .com / zh-cn / library / system.web.ui.webcontrols.contentplaceholder.aspx [ ^ ]



http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols。 placeholder.aspx [ ^ ]

What is placeholder and ContentPlaceHolder??
And when are thsese used in Web pages

解决方案

PlaceHolder: It is used to dynamically add controls on a web page. This[^] example shows how to use it.

ContentPlaceHolder: It is used in master pages to define the area that will be filled by content pages at runtime. This[^] example shows how to use it.


A PlaceHolder control is used as a container for any controls you wish to add and can be used on any page. A ContentPlaceHolder is used to hold content from Content Pages and can only be used on a Master Page.

Look here for documentation on MSDN:

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.contentplaceholder.aspx[^]

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.placeholder.aspx[^]


这篇关于什么是占位符和ContentPlaceHolder?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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