Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 14th, 2005, 08:39 PM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Default custom membership provider

Working with membershipProvide in VS 2005.

I have my own custom class which inherits MembershipProvider class.



public class MyCustomerMembershipProvider : MembershipProvider
    {

        public MyCustomerMembershipProvider
    {
            public override bool ValidateUser(string strName, string strPassword)
            {
                    bool boolReturn = true;
                    return boolReturn;
            }
          }
 }


How to call this "ValidateUser" function from my login.aspx page?

login.aspx code:

 <form id="form1" runat="server">
    <div>
        <asp:Login ID="Login1" runat="server" OnAuthenticate="Login1_Authenticate1" >
        </asp:Login>

    </div>
    </form>

protected void Login1_Authenticate1(object sender, AuthenticateEventArgs e)
    {
        bool IsResult = Membership.ValidateUser("x", "y");
        Response.Write(IsResult);
    }

this function always returns false and not refering my MyCustomerMembershipProvider.ValidateUser function.

If this is not correct way pl help me to call my custom provider class MyCustomerMembershipProvider .



thanks

 
Old September 18th, 2005, 04:28 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You're halfway there, but not completely. To tell ASP.NET 2 it should use your provider, you should configure the application by changing the web.config file and adding the right provider, pointing to your assembly. Check out this article for a complete description of a custom provider:

http://msdn.microsoft.com/library/de...ml/bucupro.asp

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Freedom (Live) by Rage Against The Machine (Track 5 from the album: Live & Rare) What's This?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Membership Provider Scott663 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 4 August 1st, 2008 05:16 PM
Custom Membership provider question aspcoder BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 3 July 27th, 2008 09:59 AM
Custom Membership Provider kulkarnimonica ASP.NET 2.0 Professional 0 June 21st, 2007 03:56 PM
problem with custom membership provider hertendreef ASP.NET 2.0 Professional 8 April 17th, 2007 12:11 PM
Issue with custom membership provider cacaldo ASP.NET 2.0 Professional 1 October 7th, 2006 03:05 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.