WebPartZone Constructor ()

 

Initializes a new instance of the WebPartZone class.

Namespace:   System.Web.UI.WebControls.WebParts
Assembly:  System.Web (in System.Web.dll)

Public Sub New

The WebPartZone method is a default constructor and does not set any values. However, derived classes can use the constructor to set base zone properties, to create standard behaviors and appearance for a custom zone control.

The following code example demonstrates the use of a constructor on a custom WebPartZone class to set several base properties for the zone. This approach could be useful if you want to create a custom WebPartZone control that has specific behaviors and appearance. The full code for the example, including both the custom class and an .aspx page to host the control, is found in the Example section of the WebPartZone class overview topic.

Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.WebControls
Imports System.Web.UI
Imports System.Web
Imports System.Security.Permissions
Imports System.ComponentModel
Imports System.Collections
Imports System

Namespace Samples.AspNet.VB.Controls


<AspNetHostingPermission(SecurityAction.Demand, _
  Level := AspNetHostingPermissionLevel.Minimal)> _
<AspNetHostingPermission(SecurityAction.InheritanceDemand, _
  Level := AspNetHostingPermissionLevel.Minimal)> _
Public Class MyWebPartZone
  Inherits WebPartZone

  Public Sub New()
    MyBase.New
    MyBase.VerbButtonType = ButtonType.Button
    MyBase.CloseVerb.Enabled = false
  End Sub
End Class

End Namespace

.NET Framework
Available since 2.0
Return to top
Show: