Answered by:
Registration form for a SharePoint site using FBA!!!

Question
-
Hi All,
- I need to design a custom Login page for my SharePoint 2010 site which is configured with FBA. I also need to have a custom registration form which where an anonymous user can register for a new user account. Can anyone pls help me out on how to develop a custom Registration form for a Sharepoint 2010 site configured with FBA?? Thank you.
Thursday, September 16, 2010 7:13 PM
Answers
-
Hi scvinod,
I think I can help you in this issue.
First, here is a post about how to configure FBA in SharePoint 2010.
Second, you can find a “_form” folder in the directory of “C:\inetpub\wwwroot\wss\VirtualDirectories\<Applicationname>”, and the “default.aspx” file is the login page. Here is the source code of the page:
asp:login id="signInControl" FailureText="<%$Resources:wss,login_pageFailureText%>" runat="server" width="100%">
<layouttemplate>
<asp:label id="FailureText" class="ms-error" runat="server"/>
<table width="100%">
...
</table>
</layouttemplate>
</asp:login>
You can add style or javascript to this page.
Third, if you want to custom the registration form, the “<asp:CreateUserWizard>” control in Asp.Net can help you. For example, we create a register page named “signup.aspx”.
Here is some sample code about this:
<%@ Page Language="C#" MasterPageFile="~/_layouts/simple.master" %>
<asp:Content ContentPlaceHolderId="PlaceHolderPageTitle" runat="server">
SignUp
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderPageTitleInTitleArea" runat="server">
Sign Up
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderSiteName" runat="server"/>
<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
<asp:CreateUserWizard ID="SignUp" runat="server" CreateUserButtonText="Sign Up">
<TextBoxStyle CssClass="ms-inputuserfield" />
<WizardSteps>
<asp:CreateUserWizardStep runat="server" Title="Sign Up"></asp:CreateUserWizardStep>
<asp:CompleteWizardStep runat="server"></asp:CompleteWizardStep>
</WizardSteps>
</asp:CreateUserWizard>
</asp:Content>
Using the “<asp:CreateUserWizard>” control, there are no need for you to write the logic code about CRUB SQL DB.
At last, add a “Sign Up” link to the login page(default.aspx), here is the result.
<asp:login id="signInControl" FailureText="<%$Resources:wss,login_pageFailureText%>" runat="server" width="100%">
<layouttemplate>
<asp:label id="FailureText" class="ms-error" runat="server"/>
<table width="100%">
...
<tr>
<td colspan="2" align="right"><asp:LinkButton id="RegisterNew" text="Sign Up" runat="server" PostBackUrl="SignUp.aspx" /></td>
</tr>
</table>
</layouttemplate>
</asp:login>
More information about “<asp:CreateUserWizard>” control:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.createuserwizard.aspx
- Marked as answer by Aaron Han - MSFT Friday, September 24, 2010 3:12 AM
Monday, September 20, 2010 2:28 AM
All replies
-
Hi scvinod,
I think I can help you in this issue.
First, here is a post about how to configure FBA in SharePoint 2010.
Second, you can find a “_form” folder in the directory of “C:\inetpub\wwwroot\wss\VirtualDirectories\<Applicationname>”, and the “default.aspx” file is the login page. Here is the source code of the page:
asp:login id="signInControl" FailureText="<%$Resources:wss,login_pageFailureText%>" runat="server" width="100%">
<layouttemplate>
<asp:label id="FailureText" class="ms-error" runat="server"/>
<table width="100%">
...
</table>
</layouttemplate>
</asp:login>
You can add style or javascript to this page.
Third, if you want to custom the registration form, the “<asp:CreateUserWizard>” control in Asp.Net can help you. For example, we create a register page named “signup.aspx”.
Here is some sample code about this:
<%@ Page Language="C#" MasterPageFile="~/_layouts/simple.master" %>
<asp:Content ContentPlaceHolderId="PlaceHolderPageTitle" runat="server">
SignUp
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderPageTitleInTitleArea" runat="server">
Sign Up
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderSiteName" runat="server"/>
<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
<asp:CreateUserWizard ID="SignUp" runat="server" CreateUserButtonText="Sign Up">
<TextBoxStyle CssClass="ms-inputuserfield" />
<WizardSteps>
<asp:CreateUserWizardStep runat="server" Title="Sign Up"></asp:CreateUserWizardStep>
<asp:CompleteWizardStep runat="server"></asp:CompleteWizardStep>
</WizardSteps>
</asp:CreateUserWizard>
</asp:Content>
Using the “<asp:CreateUserWizard>” control, there are no need for you to write the logic code about CRUB SQL DB.
At last, add a “Sign Up” link to the login page(default.aspx), here is the result.
<asp:login id="signInControl" FailureText="<%$Resources:wss,login_pageFailureText%>" runat="server" width="100%">
<layouttemplate>
<asp:label id="FailureText" class="ms-error" runat="server"/>
<table width="100%">
...
<tr>
<td colspan="2" align="right"><asp:LinkButton id="RegisterNew" text="Sign Up" runat="server" PostBackUrl="SignUp.aspx" /></td>
</tr>
</table>
</layouttemplate>
</asp:login>
More information about “<asp:CreateUserWizard>” control:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.createuserwizard.aspx
- Marked as answer by Aaron Han - MSFT Friday, September 24, 2010 3:12 AM
Monday, September 20, 2010 2:28 AM -
I've released the SharePoint 2010 FBA Pack, it provides a web part for registering users, as well as web parts for changing your password and recovering passwords. It also has pages for administering users and roles. You can get it here:
- Proposed as answer by Chris Coulson Thursday, April 21, 2011 3:53 PM
Thursday, April 21, 2011 3:53 PM -
Hi Chris,
I have added the webpart for registering users to a FBA based site. The whole site is set to be anonymously accessible but still when I go the register page (which contains the Membership Request webpart), it is redirected to login screen. Is there a way to make the registration webpart anonymously accesible?
Thanks,
JigarFriday, April 29, 2011 1:39 PM -
The membership request web part has been fixed to work anonymously in release 1.0.2.
Thanks,
Chris
Monday, May 9, 2011 8:21 AM -
Or if you need a professional solution, you can try the FBA Suite for SharePoint Extranet:
Monday, June 25, 2012 2:55 PM