Displays a publish button on a form that is used to publish a list item, usually a blog post or comment. When this button is clicked, the draft version of the current list item is approved.
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)] [AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] [SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)] [AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)] public class PublishButton : SaveButton
Publishing is not the same as saving. If, for example, a blog is moderated, saving a post or comment does not make it public. Publishing occurs when a moderator approves the post or comment.
Use the PublishButton class when creating a custom form for reviewing (and possibly also editing) items stored in a Windows SharePoint Services list.
You can only use the PublishButton control for items on lists that are enabled for moderation.
The following code samples show how to instantiate a PublishButton object, give it a text label, and then, in the C# and Visual Basic .NET code samples, add the PublishButton to the controls collection of the page.
<SharePoint:PublishButton runat="server" ID="CustomFormPublishButton" Text="I Approve!" />
PublishButton CustomFormPublishButton = new PublishButton(); this.Controls.Add(CustomFormPublishButton);
Dim CustomFormPublishButton As PublishButton = New PublishButton() Me.Controls.Add(CustomFormPublishButton)