Click here to Skip to main content
15,895,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
hi friends i have one page and in this page i create one validationgroup and two button like add and save and my problem is i use validationgroup in add button it work properly and wen i click save button all validation are working without validationgroup and i want to validiongroup are work in save button
pls help me
Posted
Comments
Thanks7872 17-May-13 0:37am    
Post code of save button using Improve question link above.
Sergey Alexandrovich Kryukov 17-May-13 1:08am    
...and ask some question. This is a Quick Questions & Answers forum, if you still did not notice that.
—SA

I think validations are called automatically when a button is clicked... So same is the case that all validations are getting called based on button click without discrimination of validation groups assigned on specific button..

Secondly you are using ADD & SAVE buttons on the same page.. it seems a bit illogical, as add and save could be doing the same thing, that taking the form data to database or for further processing,

Rather You can use Add & Cancel Button, and than you can redirect the Page over Cancel Button so that add button could automatically handle the validations.

I am also a new in this field, so just sharing my experience, not expertise, (coz dont have much... :( )

But I hope it will work for you..

Regards,
 
Share this answer
 
Make it:

ASP.NET
<asp:textbox id="txtBox" runat="server" xmlns:asp="#unknown"></asp:textbox>
                              <asp:requiredfieldvalidator id="rfv1" runat="server" errormessage="Provide District" controltovalidate="txtBox" validationgroup="vCheck" xmlns:asp="#unknown"></asp:requiredfieldvalidator>

<asp:button id="btnAdd" runat="server" text="Add" onclick="btnAdd_Click" validationgroup="vCheck" xmlns:asp="#unknown" />
 
Share this answer
 
Comments
[no name] 17-May-13 9:34am    
what's a meaning of xmlns:asp="#unknown"
Jitendra Parida - Jeetu 20-May-13 6:46am    
leave that xmlns:asp="#unknown"

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900