membership provider

  • Thread starter Thread starter SilentCry
  • Start date Start date
S

SilentCry

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?
 
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);
}

}
}
 
Back
Top