There Really Is an Authentication Button Class
I got in an argument today over the phone with a co-worker I used to work with that there was no AuthenticationButton Class. Actually, there is a sealed AuthenticationButton class that inherits from System.Web.UI.Control class, the System.Web.UI.INamingContainer interface, and the Microsoft.SharePoint.WebControls. IDesignTimeHtmlProvider.
To be honest, I only used it in SharePoint 2003, but it doesn’t appear to be deprecated in SharePoint 2007, so I am on the ball. So, how do you use it? Well, it is pretty easy, because its like adding any control to a SharePoint WebPart.
The first that you have to do when creating a Windows SharePoint Services custom component that makes use of the AuthenticationButton class to make the appropriate references. The AuthenticationButton class exists in the Microsoft.SharePoint.WebPartPages namespace, so make the reference:
-
using Microsoft.SharePoint.WebPartPages;
Then, you have to setup your class to use the Authentication Button, so delcare it:
-
private AuthenticationButton SharePointAuthButton;
In your CreateChildControls() method, create a new AuthenticationButton, and then add it by using the add method out of the controls class.
-
protected override void CreateChildControls()
-
{
-
Controls.Add(SharePointAuthButton);
-
}
Its not real fancy, but I am happy because I was right :-) It only happens far and few between!
Related posts:
- Developing A SharePoint Form WebPart – Part 1 – Set Up the WebPart Class
- Customzing Connection Information Using The FilterInfoBar Class
- ToolPart Class With System.Reflection
- Open Configuration Panel From WebPart ToolPane
- WebPart Verbs, MenuItem Class, and WebPart Menus
No Comments »
No comments yet.
RSS feed for comments on this post. TrackBack URL























Articles & Research
SharePoint Architecture
Research Methodology
Personal/Off-Topic
Article Or Research Filed Under 
