RequiredFieldValidator Posting Back!!!?
-
Hai, I have used asp:RequiredFieldValidator to validate two text boxes. But when I clicks on the button it is posting back and executing the server code with the required field validator error message. i have set the clientside validation property true for the button and my requiredfieldvalidator code is
Please select a DPM or Table from Module1
Why this happened? Any idea? Please help me to resolve this by showing a right way. Thanks very much. Thank you, Rahul.P.Menon. -- modified at 0:31 Tuesday 13th December, 2005 -
Hai, I have used asp:RequiredFieldValidator to validate two text boxes. But when I clicks on the button it is posting back and executing the server code with the required field validator error message. i have set the clientside validation property true for the button and my requiredfieldvalidator code is
Please select a DPM or Table from Module1
Why this happened? Any idea? Please help me to resolve this by showing a right way. Thanks very much. Thank you, Rahul.P.Menon. -- modified at 0:31 Tuesday 13th December, 2005Rahul.P.Menon wrote:
i have set the clientside validation property true for the button
Hi, have you set the
ValidationGroup
property of the asp:RequiredFieldValidator and the asp:Button ? if not set the property toValidationGroup = myValidationGroupName
for both the button and the validator controls. In addition, you might want to make sure that the propertyCausesValidation
of the button is set totrue
Hopes this helps :) let me know how it goes... Afzal "AV-E" Hassen -
Rahul.P.Menon wrote:
i have set the clientside validation property true for the button
Hi, have you set the
ValidationGroup
property of the asp:RequiredFieldValidator and the asp:Button ? if not set the property toValidationGroup = myValidationGroupName
for both the button and the validator controls. In addition, you might want to make sure that the propertyCausesValidation
of the button is set totrue
Hopes this helps :) let me know how it goes... Afzal "AV-E" HassenHai Afzal, Thanks much for your help and quick response. But I couldn't get the specified property 'ValidationGroup' for requiredfield validator or button.Can you please elaborate the point.I have set the causesvalidation=true.Still it is posting back.Please show me the right way. Thanks very much. Thank You, Rahul.P.Menon
-
Hai Afzal, Thanks much for your help and quick response. But I couldn't get the specified property 'ValidationGroup' for requiredfield validator or button.Can you please elaborate the point.I have set the causesvalidation=true.Still it is posting back.Please show me the right way. Thanks very much. Thank You, Rahul.P.Menon
hey Rahul, No problem, look carefully in the property explorer of the IDE (the pane where you set the ID of your control).. make sure that you select the
asp:RequiredFieldValidator
control in the designer for your page the property pane will show the available properties for theasp:RequiredFieldValidator
you just selected.. the propertyValidationGroup
is definitley there :) do the same for theasp:Button
control. let me know if i need to elaborate a little more.. :) Afzal "AV-E" Hassen -
hey Rahul, No problem, look carefully in the property explorer of the IDE (the pane where you set the ID of your control).. make sure that you select the
asp:RequiredFieldValidator
control in the designer for your page the property pane will show the available properties for theasp:RequiredFieldValidator
you just selected.. the propertyValidationGroup
is definitley there :) do the same for theasp:Button
control. let me know if i need to elaborate a little more.. :) Afzal "AV-E" HassenHai Afzal, I am using the previous version 1.1 of dotnetframewor.(That is not version 2 of dotnetframework).I think the specified property 'ValidationGroup' is new and only available in version2. So that i couldnot get the property. What I should do? Still it is posting back and made me confused. Thanks a lot for your valuable information. Thank You, Rahul.P.Menon
-
Hai Afzal, I am using the previous version 1.1 of dotnetframewor.(That is not version 2 of dotnetframework).I think the specified property 'ValidationGroup' is new and only available in version2. So that i couldnot get the property. What I should do? Still it is posting back and made me confused. Thanks a lot for your valuable information. Thank You, Rahul.P.Menon
hey, My bad:doh:, I should have known to ask what version of ASP.NET you're using to develop with. You are correct, 1.1 does not have the validation group property, however, I wrote a quick test webform to see what properties need to be set in 1.1 .. and I found that the control did perform the intended validation on the Textbox i used. The only properties I set were... for the RequiredFieldValidator:
ControlToValidate = myTextbox
,Display = Dynamic
; for the button i setCausesValidation = true
and that was it. As soon as i selected to view the page in a browser, it worked perfectly. if this still doesnt help, then i would be just as stumped as you are..:sigh: Afzal "AV-E" Hassen -
hey, My bad:doh:, I should have known to ask what version of ASP.NET you're using to develop with. You are correct, 1.1 does not have the validation group property, however, I wrote a quick test webform to see what properties need to be set in 1.1 .. and I found that the control did perform the intended validation on the Textbox i used. The only properties I set were... for the RequiredFieldValidator:
ControlToValidate = myTextbox
,Display = Dynamic
; for the button i setCausesValidation = true
and that was it. As soon as i selected to view the page in a browser, it worked perfectly. if this still doesnt help, then i would be just as stumped as you are..:sigh: Afzal "AV-E" HassenHai Afzal, Thanks a lot for your help. But this time bad luck for me. I have tried all these ways,but it is still posting back:confused: Prevoiusly I have used javascript for the validation.Later I changed with requiredfieldvalidator.So that my aspx page contains javascript functions.Is this cause any problem..? Any way I am still in search how to resolve...?:omg: Thanks very much. Thank You, Rahul.P.Menon. SoftwareDeveloper(.NET)