Re: Custom Membership Provider



Hi Shaun,

I was doing this, but all the attributes for the provder were empty
(applicationName, connectionString etc), as instansiate wasn't called. This
is called by the base class when you click "login" in the asp:login control.
I have now found how to pass in the NameValueCollection and it works great!

This is the code, if anyone else needs so:

System.Web.Configuration.MembershipSection ms =
(System.Web.Configuration.MembershipSection)ConfigurationManager.GetSection("system.web/membership");
OracleMembershipProvider OMP = new OracleMembershipProvider();
OMP.Initialize("", ms.Providers[0].Parameters);

Thanks for the reply Shaun, appreciate your time.

Jon

"Shaun C McDonnell" wrote:

Jon,

You shouldn't need to be instantiating your custom Membership Provider. Use
the current instance within your page (Membership) to call
Membership.ValidateUser

Shaun McDonnell

"Jon" <Jon@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:740F663E-4ED5-4AD7-8091-CD87831CB31C@xxxxxxxxxxxxxxxx
Hello all,

I've written a Customer Membership Provider and am trying the call the
ValidateUser method from a button click, as below:

CustomOracleMembershipProvider COMP = new
CustomOracleMembershipProvider();

bool validated = new
Security.CustomOracleMembershipProvider().ValidateUser("yatesj", "abcde");

However, I need to call the initialize method first, but I'm having
problems
in passing in the <membership> element in the web.config file. Can this
even
be done?

I'm trying not to use the Login control, as authentication may come from
somewhere else and we may need to do the process manually.

Any help would be great.

Jon

.