WebPartZoneCollection.Contains(WebPartZoneBase) 方法

定义

返回一个值,该值指示集合中是否存在特定区域。

public:
 bool Contains(System::Web::UI::WebControls::WebParts::WebPartZoneBase ^ value);
public bool Contains (System.Web.UI.WebControls.WebParts.WebPartZoneBase value);
member this.Contains : System.Web.UI.WebControls.WebParts.WebPartZoneBase -> bool
Public Function Contains (value As WebPartZoneBase) As Boolean

参数

value
WebPartZoneBase

要对其进行检查以确定是否位于集合中的 WebPartZone

返回

Boolean

一个布尔值,该值指示集合中是否存在特定区域。

示例

下面的代码示例演示了该方法的使用 Contains 。 示例的完整代码(包括用户控件、包含区域的页面和包含代码的分部类文件)位于类概述的 WebPartZoneCollection “示例”部分中。

以下代码部分演示了方法的 Contains 用法。 若要执行代码,请在浏览器中加载页面,然后单击 Coll。包含 WebPartZone2 按钮。

protected void Button2_Click(object sender, EventArgs e)
{
  Label1.Text = String.Empty;
  Label1.Text = mgr.Zones.Contains(WebPartZone2).ToString();
}
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs)
  Label1.Text = String.Empty
  Label1.Text = mgr.Zones.Contains(WebPartZone2).ToString()

End Sub

注解

使用此方法 Contains 可以检查特定 WebPartZone 对象并确定它是否在集合中 WebPartZoneCollection

适用于

另请参阅