Saturday, March 19, 2011

Add password reset page in Form Based Authentication MOSS 2007 site

Add password reset page in Form Based Authentication MOSS 2007 site:


This article explains how to add a reset password page in Form Based Authentication enable SharePoint 2007 (MOSS) site, so the user can reset his/her password. We will add this page in standard menu.


When you enable forms authentication on SharePoint 2007 (MOSS), it means that users credentials are stored in membership database like ASP.NET database. In Form Based Authentication site, if we want to reset password then reset password page should be accessible to anonymous user also.


We are going to add new feature (ResetPasswordPage feature) in the standard user menu:

1. Write code .cs file(c# file), In this class, we will inherit the class Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase

For example:

public class ExtranetPasswordReset_Test : Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase

2. Creating ExtranetPasswordReset_Test.aspx
3. Creating ResetPasswordPage feature
4. Deployment

1. Creation of ExtranetPasswordReset_Test.aspx:

We will create new ExtranetPasswordReset.aspx with the help of VS 2005.

<%@ Assembly Name="Microsoft.SharePoint,Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" Inherits="Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase" MasterPageFile="~/_layouts/simple.master" %>
<%@ Assembly Name="Test.Security, Version=, Culture=neutral, PublicKeyToken=8b7a42e9b9b5355f" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>

Site Title:

Code behind file of ExtranetPasswordReset_Test.aspx, called ExtranetPasswordReset_Test.aspx.cs:

1. We need add two functions:
I. protected override bool AllowAnonymousAccess
II. protected void Page_Load(object sender, EventArgs e)

2. Inherit the class with UnsecuredLayoutsPageBase class.

namespace Test.Security.Web.UI

public class ExtranetPasswordReset_Test : Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase
protected override bool AllowAnonymousAccess
return true;

protected void Page_Load(object sender, EventArgs e)


2. Create ResetPasswordPage feature:

We will create Feature file and put into the ResetPasswordPage folder inside the Feature folder.

We also need to create elements.xml file.

Set CustomAction properties as shown, Location to be ‘StandardMenu’ and UrlAction URL property should be “_layouts/ExtranetPasswordReset_Test.aspx”
3. Deployment
1. Copy ‘ExtranetPasswordReset_Test.aspx’ file to the following path:
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\
2. Copy ResetPasswordPage folder that contains elements.xml and feature.xml to the following path: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\

3. run the following command:

Now the feature is installed successfully, but needs to be activated.

4. Go to your site-> Site Actions -> Site Settings -> Modify All Site Settings->Site Collection Features ->Activate ResetPasswordPage feature.

Now you can find Reset Password action in the standard user menu



Sitecore® Technology MVP 2019

Featured Post

Sitecore Error Troubleshooting: Sitecore Solr Connectivity Issue:: Part-1

Sitecore Error Troubleshooting: Sitecore Solr Connectivity Issue:: Part-1 How to verify Sitecore 9.1 (IaaS and Azure PaaS) + Solr (IaaS) C...

Total Pageviews

State Counder


About Me

My photo
Based in Bangalore, INDIA, Amit is a Sitecore MVP and MCC. He has an MCA from the U.P.T.U., INDIA and holds certifications including Sitecore and SharePoint 2007/2010. He is an contributor to Sitecore/MSDN communities and Amit have experience in Sitecore, ASP.Net with C#, MVC, SharePoint, Classic ASP, VB,Macros,HTML,JavaScript,JSON,BootStrap and AngularJS.


Follow me on Twitter