<asp:RegularExpressionValidator ID="valPasswordLength" runat="server" ControlToValidate="Password" SetFocusOnError="true" Display="Dynamic"
ValidationExpression="\w{5,}" ErrorMessage="Password must be at least 5 characters long." ToolTip="Password must be at least 5 characters long."
ValidationGroup="CreateUserWizard1" EnableClientScript="False">*</asp:RegularExpressionValidator>
It lets me create a password. But if I type in an amount of characters less than 5 characters, for example, "cat", it doesn't give me an error message. It just clears both of the password boxes and puts a red * next to the first one - I.e., it doesn't state
what I did wrong, or what is the required format for the password.
The other fields do give statements on errors. For example, it told me in red, that the email address I tried to use was already in use. I guess that's no surprise since you only had me change the password part of the validator.
So that seems to be the only part of that control that won't work.
Okay, so we know the validator is working on the server.
Client-side means "in the browser". In this case, the validator can work on either the client-side (browser) or server-side (ASP.NET Development Server). It will work on the client side if it can, because that's faster. But if you disable client script,
then it will validate on the server side instead.
We know that worked, because you got the red *. The reason you didn't get the pop-up message telling you what you did wrong is that only the client can generate pop-ups for this -- the server can't do that. (This is why I generally avoid using pop-ups for
errors. There is a ValidationSummary control that works from both the client and server side.)
This narrows the issue down to your browser. What browser are you using? Can you try it with a different browser and see what happens?
Excuse me for my ignorance of terms, but what does that mean, "the client side" only ? You mean the beerhouse project as opposed to my VS program?
Client / Server is how the entire Web works. On the Web, usually the client is a browser, like Internet Explorer.
Not to be condescending, but this question (and some others you are asking) indicate that perhaps you don't really possess enough basic knowledge to get very far with this application. Didn't you say you were getting a beginner book at some point? You might
consider giving that a go first.
By the way... I can't really promote other book publishers over on the Wrox site, but the Murach books (http://www.murach.com) are very good for beginners.
Before trying to change my browser settings to Firefox, I changed the setting on the extra statement you gave me to true:
EnableClientScript="True">
and then tried once more and it worked! I then typed only a 3 letter password and the pop up error box came up and worked too.
Maybe the trick was adding that line of code to my membership section which wasn't there before you told me to type it in.
You think that was it? Its not there in the original beerhouse code.
Rae
p.s. I just saw your other reply re: my level of understanding. My prior program was all just with dao for particular windows applications. No experience at all with web stuff. But yes, I did order two books, the wrox beginner asp.net and the one for the
beer project. They will be here 13th. So far, I've learned a lot already tho playing with this project.
Normally, client script is enabled by default, so you shouldn't have to set it to true explicitly, but I guess in this case you had to. That is truly weird. Welcome to the Wonderful World of Web Programming. [;)]
Email problems are nearfly impossible to diagnose over a forum, there are so many problems that can arise. But, those books will tell you how it's done, so you should be able to fix it from those.
Lee Dumond
Contributor
6404 Points
1173 Posts
Re: Can't create passwords
Dec 11, 2008 05:57 PM|LINK
Just type it in:
<asp:RegularExpressionValidator ID="valPasswordLength" runat="server" ControlToValidate="Password" SetFocusOnError="true" Display="Dynamic" ValidationExpression="\w{5,}" ErrorMessage="Password must be at least 5 characters long." ToolTip="Password must be at least 5 characters long." ValidationGroup="CreateUserWizard1" EnableClientScript="False">*</asp:RegularExpressionValidator>Follow Me on Twitter
RaeKC
Member
101 Points
366 Posts
Re: Can't create passwords
Dec 11, 2008 06:13 PM|LINK
Okay, I did that.
It lets me create a password. But if I type in an amount of characters less than 5 characters, for example, "cat", it doesn't give me an error message. It just clears both of the password boxes and puts a red * next to the first one - I.e., it doesn't state what I did wrong, or what is the required format for the password.
The other fields do give statements on errors. For example, it told me in red, that the email address I tried to use was already in use. I guess that's no surprise since you only had me change the password part of the validator.
So that seems to be the only part of that control that won't work.
So you're stumped too?
Rae
RaeKC
Member
101 Points
366 Posts
Re: Can't create passwords
Dec 11, 2008 06:16 PM|LINK
Excuse me for my ignorance of terms, but what does that mean, "the client side" only ? You mean the beerhouse project as opposed to my VS program?
Rae
Lee Dumond
Contributor
6404 Points
1173 Posts
Re: Can't create passwords
Dec 11, 2008 06:30 PM|LINK
Okay, so we know the validator is working on the server.
Client-side means "in the browser". In this case, the validator can work on either the client-side (browser) or server-side (ASP.NET Development Server). It will work on the client side if it can, because that's faster. But if you disable client script, then it will validate on the server side instead.
We know that worked, because you got the red *. The reason you didn't get the pop-up message telling you what you did wrong is that only the client can generate pop-ups for this -- the server can't do that. (This is why I generally avoid using pop-ups for errors. There is a ValidationSummary control that works from both the client and server side.)
This narrows the issue down to your browser. What browser are you using? Can you try it with a different browser and see what happens?
Follow Me on Twitter
Lee Dumond
Contributor
6404 Points
1173 Posts
Re: Can't create passwords
Dec 11, 2008 06:36 PM|LINK
Client / Server is how the entire Web works. On the Web, usually the client is a browser, like Internet Explorer.
Not to be condescending, but this question (and some others you are asking) indicate that perhaps you don't really possess enough basic knowledge to get very far with this application. Didn't you say you were getting a beginner book at some point? You might consider giving that a go first.
By the way... I can't really promote other book publishers over on the Wrox site, but the Murach books (http://www.murach.com) are very good for beginners.
Follow Me on Twitter
RaeKC
Member
101 Points
366 Posts
Re: Can't create passwords
Dec 11, 2008 06:54 PM|LINK
HA!
THANK YOU!!
Before trying to change my browser settings to Firefox, I changed the setting on the extra statement you gave me to true:
EnableClientScript="True">
and then tried once more and it worked! I then typed only a 3 letter password and the pop up error box came up and worked too.
Maybe the trick was adding that line of code to my membership section which wasn't there before you told me to type it in.
You think that was it? Its not there in the original beerhouse code.
Rae
p.s. I just saw your other reply re: my level of understanding. My prior program was all just with dao for particular windows applications. No experience at all with web stuff. But yes, I did order two books, the wrox beginner asp.net and the one for the beer project. They will be here 13th. So far, I've learned a lot already tho playing with this project.
Now back to that email problem...
Lee Dumond
Contributor
6404 Points
1173 Posts
Re: Can't create passwords
Dec 11, 2008 07:28 PM|LINK
Normally, client script is enabled by default, so you shouldn't have to set it to true explicitly, but I guess in this case you had to. That is truly weird. Welcome to the Wonderful World of Web Programming. [;)]
Email problems are nearfly impossible to diagnose over a forum, there are so many problems that can arise. But, those books will tell you how it's done, so you should be able to fix it from those.
Follow Me on Twitter
Lee Dumond
Contributor
6404 Points
1173 Posts
Re: Can't create passwords
Dec 11, 2008 07:29 PM|LINK
P.S. Don't forget to mark your thread as Answered so that everyone will know that it's taken care of.
Follow Me on Twitter