locked
'ASP.pages_login_aspx' does not contain a definition for 'Login1_Authenticate' and no extension method 'Login1_Authenticate' accepting a first argument of type 'ASP.pages_login_aspx' could be found (are you missing a using directive or an assembly referen RRS feed

  • Question

  • I want to change the partner portal authenticate against the MSCRM only.
    I am following this blog
    http://dynamicslollipops.blogspot.com.au/2011/09/how-to-change-customer-partner-portal.html
     But after implementing 4th step I am start receiving this error.
    Here is the code of my login.aspx

    <%@ Page Language="C#" MasterPageFile="~/MasterPages/Default.master" AutoEventWireup="True" 
    Inherits="Site.Pages.Login" %>
    <%@ Register TagPrefix="adx" TagName="AzureAcs" Src="~/Controls/AzureAcs.ascx" %>
    <asp:Content ContentPlaceHolderID="ContentBottom" runat="server">
    
    	<h2><crm:Snippet runat="server" SnippetName="Login/ACS/AccountTransfer/Heading" DefaultText="Live ID Account Transfer" /></h2>
    	<div>
    		<p>Already registered with a Windows Live ID account? Sign in to transfer the account to an AppFabric ACS account:</p>
    		<asp:Login ID="Login1" runat="server" OnAuthenticate="Login1_Authenticate"></asp:Login>
    	</div>
    </asp:Content>

    And this is of Login.aspx.cs
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web.UI.WebControls;
    using Microsoft.Security.Application;
    using Microsoft.Xrm.Client;
    using Microsoft.Xrm.Portal;
    using Microsoft.Xrm.Portal.Cms;
    using Microsoft.Xrm.Portal.Configuration;
    using Microsoft.Xrm.Portal.Web;
    using Microsoft.Xrm.Sdk;
    using Microsoft.Xrm.Sdk.Client;
    using Microsoft.Xrm.Sdk.Messages;
    using Microsoft.Xrm.Sdk.Metadata;
    using Xrm;
    
    namespace Site.Pages
    {
    	public partial class Login : PortalPage
    	{
    		protected void Page_Load(object sender, EventArgs e)
            {
                if ((User != null) && User.Identity.IsAuthenticated)
                {
                    var redirectUrl = !string.IsNullOrEmpty(Request.QueryString["ReturnUrl"])
                   ? Request["ReturnUrl"]
                   : !string.IsNullOrEmpty(Request.QueryString["URL"])
                       ? Request["URL"]
                       : "/";
                    Response.Redirect(redirectUrl);
                }
            }
            private Contact _loginContact;
            protected Contact LoginContact
            {
                get
                {
                    return _loginContact ??
                    (_loginContact = XrmContext.ContactSet
                    .FirstOrDefault(c => c.Adx_username == Login1.UserName && c.Adx_LogonEnabled != null && c.Adx_LogonEnabled.Value));
                }
            }
            public void Login1_Authenticate(object sender, System.Web.UI.WebControls.AuthenticateEventArgs e)
            {
                if (LoginContact == null)
                {
                    e.Authenticated = false;
                }
                else
                {
                    if (LoginContact.Adx_password == Login1.Password)
                    {
                        if (LoginContact.Adx_changepasswordatnextlogon.Value)
                        {
                            var page = ServiceContext.GetPageBySiteMarkerName(Website, "ChangePassword");
                            string redirectURL = ServiceContext.GetUrl(page) + "?UserName=" +
    Server.UrlEncode(Login1.UserName) + "&Password=" + Server.UrlEncode(Login1.Password); Response.Redirect(redirectURL); } else { LoginContact.Adx_LastSuccessfulLogon = DateTime.Now.Date; XrmContext.UpdateObject(LoginContact); XrmContext.SaveChanges(); e.Authenticated = true; // Response.Redirect("/"); FormsAuthentication.RedirectFromLoginPage(Login1.UserName, true); } } else { e.Authenticated = false; } } } } }


    Please help me. if any body know the solution or send me any other blog that could solve my problem
    Any help will be appreciated.
    • Edited by CRMGeek1 Wednesday, May 30, 2012 2:50 PM
    Wednesday, May 30, 2012 2:45 PM

All replies

  • Hi,

    The blog is about earlier version of the portal, Please try using the this blog

    http://dynamicslollipops.blogspot.co.il/2012/10/how-to-change-customer-partner-portal.html.

    Hope it helps.


    Yair Rozenberg

    • Proposed as answer by yairrose Saturday, November 10, 2012 8:19 AM
    • Unproposed as answer by yairrose Saturday, November 10, 2012 8:19 AM
    Saturday, November 10, 2012 8:19 AM