Company      |       Articles & Research      |      Services      |      Software      |      Contact

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:

C#:
  1. using Microsoft.SharePoint.WebPartPages;

Then, you have to setup your class to use the Authentication Button, so delcare it:

C#:
  1. 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.

C#:
  1. protected override void CreateChildControls()
  2. {
  3. SharePointAuthButton = new AuthenticationButton();
  4. Controls.Add(SharePointAuthButton);
  5. }

Its not real fancy, but I am happy because I was right :-) It only happens far and few between!

share save 171 16 There Really Is an Authentication Button Class

Related posts:

  1. Developing A SharePoint Form WebPart – Part 1 – Set Up the WebPart Class
  2. Customzing Connection Information Using The FilterInfoBar Class
  3. ToolPart Class With System.Reflection
  4. Open Configuration Panel From WebPart ToolPane
  5. WebPart Verbs, MenuItem Class, and WebPart Menus

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment