Click here to Skip to main content
15,890,579 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionexport multiple crystal reports to a single destination PDF Pin
vvibha27-Jul-11 20:19
vvibha27-Jul-11 20:19 
AnswerRe: export multiple crystal reports to a single destination PDF Pin
Orcun Iyigun27-Jul-11 21:12
Orcun Iyigun27-Jul-11 21:12 
GeneralRe: export multiple crystal reports to a single destination PDF Pin
vvibha27-Jul-11 23:55
vvibha27-Jul-11 23:55 
QuestionTextbox value dissappear when using FilteredTextboxExtender Pin
Orcun Iyigun27-Jul-11 12:45
Orcun Iyigun27-Jul-11 12:45 
AnswerRe: Textbox value dissappear when using FilteredTextboxExtender Pin
Shahriar Iqbal Chowdhury/Galib27-Jul-11 22:35
professionalShahriar Iqbal Chowdhury/Galib27-Jul-11 22:35 
GeneralRe: Textbox value dissappear when using FilteredTextboxExtender Pin
Orcun Iyigun28-Jul-11 10:25
Orcun Iyigun28-Jul-11 10:25 
QuestionFile Uploader No Longer Working Pin
Dominick Marciano27-Jul-11 7:53
professionalDominick Marciano27-Jul-11 7:53 
QuestionHow to use minRequiredPasswordLength and minRequiredNonalphanumericCharacters? Pin
kbalias27-Jul-11 0:17
kbalias27-Jul-11 0:17 
Hi
I am using Visual Web Developer 2010 Express (with C# as code-behind) to develop a website.
I have created a custom MembershipProvider and I have specified that in the web.config that
minRequiredPasswordLength="6"
minRequiredNonalphanumericCharacters="0"


I am not sure where and how to use these values.

I have done the following:
I have added a CustomValidator to the Password textbox in the CreateUserWizard.

<asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label>
<asp:TextBox ID="Password" runat="server" CssClass="passwordEntry" TextMode="Password"></asp:TextBox>
<asp:CustomValidator ID="CustomValidator_PW" runat="server" ControlToValidate="Password"
    OnServerValidate="CustomValidate_PW" ValidateEmptyText="true" Display="Dynamic"
    ErrorMessage="" ForeColor="Red" ValidationGroup="RegisterUser">
</asp:CustomValidator>
<asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
    CssClass="failureNotification" ErrorMessage="Password is required." ToolTip="Password is required."
    ValidationGroup="RegisterUser">*</asp:RequiredFieldValidator>



And a server-side method in the code-behind:

protected void CustomValidate_PW(object source, ServerValidateEventArgs args)
{
    CustomValidator cv = (CustomValidator)source;

    //check if password conforms to minimum password length
    string pw = RegisterUser.Password;
    if (pw.Length < Membership.MinRequiredPasswordLength)
    {
        cv.ErrorMessage = "Minimum Password length is " + Membership.MinRequiredPasswordLength;
        args.IsValid = false;
    }

    //check if password conforms to required number of nonAlphanumericCharacters
    if (Membership.MinRequiredNonAlphanumericCharacters > 0)
    {
        int count = 0;
        for (int j = 0; j < pw.Length; j++)
        {
            if (!char.IsLetterOrDigit(pw[j]))
            {
                count++;
            }
        }

        if (count < Membership.MinRequiredNonAlphanumericCharacters)
        {
            cv.ErrorMessage = "Password requires " + Membership.MinRequiredNonAlphanumericCharacters + " non-Aphanumeric characters";
            args.IsValid = false;
        }
    }
}


Is there a better way or better place to do this?

All help will be appreciated.
Kobus
Questioni want to select mssql2005 or mssql2008 where 2005, 2008 was instlled. Pin
buffering8326-Jul-11 17:23
buffering8326-Jul-11 17:23 
AnswerRe: i want to select mssql2005 or mssql2008 where 2005, 2008 was instlled. Pin
m@dhu26-Jul-11 18:45
m@dhu26-Jul-11 18:45 
AnswerRe: i want to select mssql2005 or mssql2008 where 2005, 2008 was instlled. Pin
Shameel26-Jul-11 21:13
professionalShameel26-Jul-11 21:13 
GeneralHow to get value from invisible column in gridview Pin
sujitdeshpande_1926-Jul-11 2:48
sujitdeshpande_1926-Jul-11 2:48 
GeneralRe: How to get value from invisible column in gridview Pin
Orcun Iyigun26-Jul-11 6:22
Orcun Iyigun26-Jul-11 6:22 
GeneralRe: How to get value from invisible column in gridview Pin
GenJerDan28-Jul-11 6:17
GenJerDan28-Jul-11 6:17 
QuestionProject Code in Asp.net Pin
Akshaya Kumar Patel25-Jul-11 21:44
Akshaya Kumar Patel25-Jul-11 21:44 
AnswerRe: Project Code in Asp.net Pin
Blue_Boy25-Jul-11 23:06
Blue_Boy25-Jul-11 23:06 
AnswerRe: Project Code in Asp.net Pin
R. Giskard Reventlov26-Jul-11 0:11
R. Giskard Reventlov26-Jul-11 0:11 
AnswerRe: Project Code in Asp.net Pin
Not Active26-Jul-11 14:03
mentorNot Active26-Jul-11 14:03 
QuestionHow to identify a particular Web site is not active Pin
Gali197825-Jul-11 7:53
Gali197825-Jul-11 7:53 
AnswerRe: How to identify a particular Web site is not active Pin
R. Giskard Reventlov25-Jul-11 8:03
R. Giskard Reventlov25-Jul-11 8:03 
QuestionHow can Interchange the Language of Web? Pin
Naseem Alam Ansari25-Jul-11 4:12
Naseem Alam Ansari25-Jul-11 4:12 
AnswerRe: How can Interchange the Language of Web? Pin
Blue_Boy25-Jul-11 4:25
Blue_Boy25-Jul-11 4:25 
AnswerRe: How can Interchange the Language of Web? Pin
Dalek Dave27-Jul-11 23:04
professionalDalek Dave27-Jul-11 23:04 
QuestionMessage to user when email not unique? Pin
kbalias25-Jul-11 1:38
kbalias25-Jul-11 1:38 
AnswerRe: Message to user when email not unique? Pin
kbalias25-Jul-11 2:09
kbalias25-Jul-11 2:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.