Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Membership Create User without requiresQuestionAndAnswer

How can I use the CreateUser method in the Membership class without having to assign a question and answer?

I have disabled it in the web.config with the following setting.

requiresQuestionAndAnswer="false"

I need the status output from the CreateUser method, but the overload requires a question and answer. Can anyone suggest how I can go about this?

like image 660
Oliver S Avatar asked Feb 27 '09 18:02

Oliver S


2 Answers

I haven't tried this, but have you tried just passing null for those two parameters?

like image 58
Quintin Robinson Avatar answered Oct 15 '22 12:10

Quintin Robinson


you need to set parameters in web.config

<system.web>
<membership>
<providers>

<add name="YOURMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="con"  minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" passwordFormat="Clear" applicationName="YourAppName" maxInvalidPasswordAttempts="2147483647"/>

I tried this. Its working Fine. Thanks

like image 41
Abhi Avatar answered Oct 15 '22 12:10

Abhi