membership provider

Discussion in 'ASP .Net' started by SilentCry, Aug 23, 2009.

  1. SilentCry

    SilentCry Guest

    i'm implementing a login page within a master page using the Login control.
    the Login control utilizes a custom membership provider that I inherited
    from MembershipProvider (not SqlMembershipProvider). there's a Welcome page
    also that uses the same master page and saves the id of the incoming user in
    a property of the master page before the Login page is displayed. the thing
    is, once the login page comes up and submitted, i need to access the cust id
    from within the ValidateUser method in the MP but the problem is, the MP
    class is located outside the project in the App_Code folder (i believe is
    the right place) where i don't have access to the Page or Session objects.
    anybody have any suggestions on how to do this?
     
    SilentCry, Aug 23, 2009
    #1
    1. Advertising

  2. SilentCry

    tuningd Guest

    You can have you code in the App_Code folder inherits from
    "System.Web.UI.Page"

    so you could have a class in your App_Code folder that looks like
    this:

    using System;
    using System.Web;
    using System.Web.Configuration;

    namespace App_Code.Base {
    public class SiteBasePage : System.Web.UI.Page {

    public SiteBasePage() {
    //nothing yet
    }

    protected override void OnError(EventArgs e) {
    Response.Redirect("~/Error.aspx", true);
    base.OnError(e);
    }

    protected override void OnLoad(EventArgs e) {
    if (String.IsNullOrEmpty
    (SessionStateProperties.SessionUserID)) {
    if (!LoginUser()) {
    Response.Redirect("~/InvalidAccessMethod.aspx",
    true);
    }
    }
    base.OnLoad(e);
    }

    }
    }


    On Aug 23, 7:37 am, "SilentCry" <> wrote:
    > i'm implementing a login page within a master page using the Login control.
    > the Login control utilizes a custom membership provider that I inherited
    > from MembershipProvider (not SqlMembershipProvider). there's a Welcome page
    > also that uses the same master page and saves the id of the incoming user in
    > a property of the master page before the Login page is displayed. the thing
    > is, once the login page comes up and submitted, i need to access the cust id
    > from within the ValidateUser method in the MP but the problem is, the MP
    > class is located outside the project in the App_Code folder (i believe is
    > the right place) where i don't have access to the Page or Session objects..
    > anybody have any suggestions on how to do this?
     
    tuningd, Aug 25, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. BS
    Replies:
    3
    Views:
    2,099
    Alvin Bruney [MVP]
    Jun 17, 2004
  2. Nate Hekman
    Replies:
    0
    Views:
    3,046
    Nate Hekman
    Apr 25, 2005
  3. spp

    Sql Membership provider

    spp, Oct 19, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    531
  4. sloan
    Replies:
    5
    Views:
    1,544
    sloan
    Jun 4, 2006
  5. sloan
    Replies:
    1
    Views:
    562
    Chad Scharf
    Jul 3, 2007
Loading...

Share This Page