Requiredfieldvalidator not validating
I used asp required field in my code but data in text box are sending even they are empty when clicking on the button and after they are sending, message of required field appears!! I have required field validation control for a radiobutton list.I'm sure that all the attributes of the controls makes sense by now, so I won't go into details about them. You should see something like this: If your browser supports Java Script, which most modern browers do, then you will notice that the page is not being posted back to the server - the validation is performed clientside! To see how it feels, you can add enableclientscript="false" to the Required Field Validator and try again.Now you will see the browser posting back to the server, but the result will be the same - the validator still works! Now you can ask questions directly to me on my new site ASPForums. Net Question Answer site, specially started to allow visitors of this site ask their doubts and queries. Just click the Ask Now button and ask your question now.I have the following code for my Rad Drop Down List ; The Required Field Validator is not being fired. If you want to push the user to select an item different from the first one, you could set the Initial Value property of the Required Field Validator and set first item's Text to the Initial Value property, like demonstrated in this video.
Let's give it a try, and add a Required Field Validator to our page.
Hello Parul, If this is the very same implementation that you are using at your end, the Rad Drop Down List would be populated, with setting its first item as selected.
Other possible implementation would be to set the Default Message property of the Rad Drop Down List.
Right now, the button does nothing, besides posting back if the page is valid.
We will change this by adding an onclick event to it: As you will notice, we check whether or not the page is valid, before we do anything.