SPMobileBaseFieldControl.CreateControlForNew 方法

创建用于呈现新项目表单上的字段控件。

命名空间:  Microsoft.SharePoint.Mobile.WebControls
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
Protected Overridable Function CreateControlForNew As Control
用法
Dim returnValue As Control

returnValue = Me.CreateControlForNew()
protected virtual Control CreateControlForNew()

返回值

类型:System.Web.UI.Control
呈现该字段的新的窗体上MobileControl

备注

默认实现调用CreateControlForDisplay

示例

The following example shows an override of this method that inserts default text in the item title on a New item form. For the full example, see Walkthrough: Creating a Custom Field Rendering Control for Mobile Pages.

protected override MobileControl CreateControlForNew()
{
    MobileControl myNewControl = null;
    if (this.Field != null)
    {
        string text = "Group: Project Name";
        if (!this.Page.IsPostBack)
        {
            this.TextBoxControl.Text = text;
        }
        myNewControl = this.TextBoxControl;
    }
    return myNewControl;
}
Protected Overrides Function CreateControlForNew() As MobileControl
    Dim myNewControl As MobileControl = Nothing
    If Me.Field IsNot Nothing Then
        Dim text As String = "Group: Project Name"
        If Not Me.Page.IsPostBack Then
            Me.TextBoxControl.Text = text
        End If
        myNewControl = Me.TextBoxControl
    End If
    Return myNewControl
End Function

另请参阅

引用

SPMobileBaseFieldControl 类

SPMobileBaseFieldControl 成员

Microsoft.SharePoint.Mobile.WebControls 命名空间