none
FBA Login Page RRS feed

  • Question

  • I want to Change the FBA Login Page and default.aspx page.

    Colud some one let me know the location for /_login/default.aspx . So that I can try to change the page

    Friday, June 8, 2012 6:08 AM

Answers

  • Hi,

    I have created an empty SharePoint project, added a mapped folder to the Layouts Folder, and within that folder I have my login.aspx and my master page. The page uses an asp.net login control.

    Note you need references to 

    Microsoft.SharePoint.IdentityModel (doesn't show up in visual studio, have to browse to it location is C:\Windows\assembly\GAC_MSIL\Microsoft.SharePoint.IdentityModel\14.0.0.0__71e9bce111e9429c\Microsoft.SharePoint.IdentityModel.dll)

    and

    Microsoft.SharePoint.Security

    Below is the code

    <%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
    <%@ Assembly Name="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Assembly Name="Microsoft.SharePoint.IdentityModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    
    <%@ Import Namespace="Microsoft.SharePoint" %>
    <%@ Import Namespace="Microsoft.SharePoint.WebControls" %>
    
    <%@ Register Tagprefix="SharePoint" 
        Namespace="Microsoft.SharePoint.WebControls" 
        Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Tagprefix="asp" Namespace="System.Web.UI" 
        Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
    
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="login.aspx.cs" 
        Inherits="FSB.SAM.Webparts.login" MasterPageFile="MyMaster.master" %>
    
    <asp:Content ID="Content1" ContentPlaceHolderID="PlaceHolderPageTitle"
        runat="server">
        <SharePoint:EncodedLiteral runat="server"
            EncodeMethod="HtmlEncode" ID="ClaimsFormsPageTitle"
            Visible="false" />
        SAM Portal Login
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea"
        runat="server">
        <SharePoint:EncodedLiteral runat="server"
            EncodeMethod="HtmlEncode" ID="ClaimsFormsPageTitleInTitleArea"
            Visible="false" />
    </asp:Content>
    <asp:Content ID="Content3" ContentPlaceHolderID="PlaceHolderSiteName"
        runat="server" />
    <asp:Content ID="Content4" ContentPlaceHolderID="PlaceHolderMain"
        runat="server">
        <SharePoint:EncodedLiteral runat="server"
            EncodeMethod="HtmlEncode" ID="ClaimsFormsPageMessage"
            Visible="false" />
            <style type="text/css">
    .loginStyle1{
    	text-align: right;
    }
    .loginStyle2{
     border-color:gray;
     border-width:thin;
    }
    .loginStyle3{
    	width:228px;
    }
    </style>
        <table width="500px" style="margin-left:-120px;">
    	    <tr>
                <td>
                </td>
    		    <td colspan="2" style="width:300px"> 
    			    <h1 class="ms-rteElement-H1 ">Sign in to the Portal</h1>		
    		    </td>
    	    </tr>
            <tr>
                <td>
                    <!--<img src="ceoLogin.png" alt=""/>-->
                </td>
                <td>
                <br />
    			<asp:Panel runat="server" id="Panel1" CssClass="loginStyle2">
    				<asp:Login CssClass="loginStyle3" ID="signInControl" FailureText="<%$Resources:wss,login_pageFailureText%>" runat="server" DestinationPageUrl="/" MembershipProvider="mp" FailureTextStyle-ForeColor="Black">
    					<LayoutTemplate>                    
    						<table class="loginStyle3">
    							<tr>
    								<td style="width: 72px">Email:</td>
    								<td style="width: 126px">
    								<asp:TextBox id="UserName" runat="server" Width="250px">
    								</asp:TextBox>
    								</td>
    								<td>
    								<asp:RequiredFieldValidator id="UserNameRequired" runat="server" ControlToValidate="UserName" Text="*">
    								</asp:RequiredFieldValidator>
    								</td>
    							</tr>
    							<tr>
    								<td style="width: 72px">Password:</td>
    								<td style="width: 126px">
    								<asp:TextBox id="Password" runat="server" textMode="Password" Width="250px">
    								</asp:TextBox>
    								</td>
    								<td>
    								<asp:RequiredFieldValidator id="PasswordRequired" runat="server" ControlToValidate="Password" Text="*">
    								</asp:RequiredFieldValidator>
    								</td>
    							</tr>                            
    							<tr>
    								<td style="width: 72px">&nbsp;</td>
    								<td style="width: 125px; text-align:right">
    								<asp:ImageButton id="Login" ImageUrl="Sign-in.gif" CommandName="Login" runat="server" Text="Login" />
    								</td>
    								<td>&nbsp;</td>
    							</tr>
                                <tr>
    								<td colspan="3"><a href="/Forgot%20Password/ForgotPassword.aspx">Forgot Password?</a></td>
    							</tr>
    						</table>
                            <asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal>
    					</LayoutTemplate>
    				</asp:Login>
    			    </asp:Panel>                        
                </td>
            </tr>
        </table>
    </asp:Content>
    The code behind 
    using System;
    using Microsoft.SharePoint.IdentityModel.Pages;
    
    namespace FSB.SAM.Webparts
    {
        public partial class login : FormsSignInPage
        {
            protected void Page_Load(object sender, EventArgs e)
            {
            }
        }
    }


    Friday, June 8, 2012 8:01 AM

All replies

  • Hi Rajashekar,

    First you need to create custom page and deploy in _layout folder.

    After that change in web.config /_login/default.aspx  to _layouts/XYZ.aspx page.

    Regards


    Mukesh Ajmera

    Friday, June 8, 2012 6:17 AM
  • Hi,

    I have created an empty SharePoint project, added a mapped folder to the Layouts Folder, and within that folder I have my login.aspx and my master page. The page uses an asp.net login control.

    Note you need references to 

    Microsoft.SharePoint.IdentityModel (doesn't show up in visual studio, have to browse to it location is C:\Windows\assembly\GAC_MSIL\Microsoft.SharePoint.IdentityModel\14.0.0.0__71e9bce111e9429c\Microsoft.SharePoint.IdentityModel.dll)

    and

    Microsoft.SharePoint.Security

    Below is the code

    <%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
    <%@ Assembly Name="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Assembly Name="Microsoft.SharePoint.IdentityModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    
    <%@ Import Namespace="Microsoft.SharePoint" %>
    <%@ Import Namespace="Microsoft.SharePoint.WebControls" %>
    
    <%@ Register Tagprefix="SharePoint" 
        Namespace="Microsoft.SharePoint.WebControls" 
        Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Tagprefix="asp" Namespace="System.Web.UI" 
        Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
    
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="login.aspx.cs" 
        Inherits="FSB.SAM.Webparts.login" MasterPageFile="MyMaster.master" %>
    
    <asp:Content ID="Content1" ContentPlaceHolderID="PlaceHolderPageTitle"
        runat="server">
        <SharePoint:EncodedLiteral runat="server"
            EncodeMethod="HtmlEncode" ID="ClaimsFormsPageTitle"
            Visible="false" />
        SAM Portal Login
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea"
        runat="server">
        <SharePoint:EncodedLiteral runat="server"
            EncodeMethod="HtmlEncode" ID="ClaimsFormsPageTitleInTitleArea"
            Visible="false" />
    </asp:Content>
    <asp:Content ID="Content3" ContentPlaceHolderID="PlaceHolderSiteName"
        runat="server" />
    <asp:Content ID="Content4" ContentPlaceHolderID="PlaceHolderMain"
        runat="server">
        <SharePoint:EncodedLiteral runat="server"
            EncodeMethod="HtmlEncode" ID="ClaimsFormsPageMessage"
            Visible="false" />
            <style type="text/css">
    .loginStyle1{
    	text-align: right;
    }
    .loginStyle2{
     border-color:gray;
     border-width:thin;
    }
    .loginStyle3{
    	width:228px;
    }
    </style>
        <table width="500px" style="margin-left:-120px;">
    	    <tr>
                <td>
                </td>
    		    <td colspan="2" style="width:300px"> 
    			    <h1 class="ms-rteElement-H1 ">Sign in to the Portal</h1>		
    		    </td>
    	    </tr>
            <tr>
                <td>
                    <!--<img src="ceoLogin.png" alt=""/>-->
                </td>
                <td>
                <br />
    			<asp:Panel runat="server" id="Panel1" CssClass="loginStyle2">
    				<asp:Login CssClass="loginStyle3" ID="signInControl" FailureText="<%$Resources:wss,login_pageFailureText%>" runat="server" DestinationPageUrl="/" MembershipProvider="mp" FailureTextStyle-ForeColor="Black">
    					<LayoutTemplate>                    
    						<table class="loginStyle3">
    							<tr>
    								<td style="width: 72px">Email:</td>
    								<td style="width: 126px">
    								<asp:TextBox id="UserName" runat="server" Width="250px">
    								</asp:TextBox>
    								</td>
    								<td>
    								<asp:RequiredFieldValidator id="UserNameRequired" runat="server" ControlToValidate="UserName" Text="*">
    								</asp:RequiredFieldValidator>
    								</td>
    							</tr>
    							<tr>
    								<td style="width: 72px">Password:</td>
    								<td style="width: 126px">
    								<asp:TextBox id="Password" runat="server" textMode="Password" Width="250px">
    								</asp:TextBox>
    								</td>
    								<td>
    								<asp:RequiredFieldValidator id="PasswordRequired" runat="server" ControlToValidate="Password" Text="*">
    								</asp:RequiredFieldValidator>
    								</td>
    							</tr>                            
    							<tr>
    								<td style="width: 72px">&nbsp;</td>
    								<td style="width: 125px; text-align:right">
    								<asp:ImageButton id="Login" ImageUrl="Sign-in.gif" CommandName="Login" runat="server" Text="Login" />
    								</td>
    								<td>&nbsp;</td>
    							</tr>
                                <tr>
    								<td colspan="3"><a href="/Forgot%20Password/ForgotPassword.aspx">Forgot Password?</a></td>
    							</tr>
    						</table>
                            <asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal>
    					</LayoutTemplate>
    				</asp:Login>
    			    </asp:Panel>                        
                </td>
            </tr>
        </table>
    </asp:Content>
    The code behind 
    using System;
    using Microsoft.SharePoint.IdentityModel.Pages;
    
    namespace FSB.SAM.Webparts
    {
        public partial class login : FormsSignInPage
        {
            protected void Page_Load(object sender, EventArgs e)
            {
            }
        }
    }


    Friday, June 8, 2012 8:01 AM