SPWebEventReceiver.WebAdding method
建立新的子網站前,但是不在建立新的網站集合的根網站時,就會發生的同步Before事件。
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'宣告
Public Overridable Sub WebAdding ( _
properties As SPWebEventProperties _
)
'用途
Dim instance As SPWebEventReceiver
Dim properties As SPWebEventProperties
instance.WebAdding(properties)
public virtual void WebAdding(
SPWebEventProperties properties
)
參數
properties
Type: Microsoft.SharePoint.SPWebEventPropertiesSPWebEventProperties物件,代表事件處理常式的屬性。
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | properties是 null 。 |
備註
WebAdding(SPWebEventProperties)事件發生於父代建立新的子 web,因為尚未存在新的子 web 的網頁上。基於這個理由,URL 相關的屬性可能會是 null,當實際上這些數值應父 Web 的 URL 時父 Web 是根網站。更具體地說, WebAdding事件中的 [ ServerRelativeUrl ] 屬性是父 Web。相反地, WebProvisioned(SPWebEventProperties)事件的這個屬性應該是新建立的子 web。
Notes to implementers
因為事件接收器必須使用註冊網站集合之前處理常式可以執行、 建立網站集合和其根 web 站台時,無法執行的WebAdding和WebProvisioned的處理常式。