SaveButton 类
提供一个按钮,通常在窗体工具栏上,用于保存窗体上的一个新的或编辑列表项。
继承层次结构
System.Object
System.Web.UI.Control
Microsoft.SharePoint.WebControls.SPControl
Microsoft.SharePoint.WebControls.TemplateBasedControl
Microsoft.SharePoint.WebControls.FormComponent
Microsoft.SharePoint.WebControls.SaveButton
Microsoft.SharePoint.WebControls.PublishButton
Microsoft.SharePoint.WebControls.SaveAsDraftButton
Microsoft.SharePoint.WebControls.SubmitCommentButton
命名空间: Microsoft.SharePoint.WebControls
程序集: Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)
语法
声明
<AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
<AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
Public Class SaveButton _
Inherits FormComponent
用法
Dim instance As SaveButton
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class SaveButton : FormComponent
备注
如果ControlMode值为Display,将不会显示SaveButton控件。
创建用于创建或编辑存储在列表中的项的自定义窗体时,请使用SaveButton类。
示例
下面的代码示例演示如何实例化SaveButton对象,设置Text,,然后,在 C# 和 Visual Basic.NET 代码示例,向页上的控件集合添加SaveButton 。
[xml]
<SharePoint:SaveButton runat="server" ID="CustomFormSaveButton" Text="Create!" >
[C#]
SaveButton CustomFormSaveButton = new SaveButton();
this.Controls.Add(CustomFormSaveButton);
[Visual Basic]
Dim CustomFormSaveButton As SaveButton = New SaveButton()
Me.Controls.Add(CustomFormSaveButton)
线程安全性
该类型的任何公共 静态 (已共享 在 Visual Basic 中) 成员都是线程安全的。不保证任何实例成员都是线程安全的。