Click here to Skip to main content
15,886,786 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
in application one text box & there is validation on that test box but it is not require or compulsory field, all validation on that text box are working fine but when click on "Procedd to Next button" it goes on next page. how i can stop that go to next page if its gives invalid message without using Required field.
Posted
Comments
hitech_s 30-Sep-11 1:37am    
plz improve the question
nagendrathecoder 30-Sep-11 1:43am    
Your question is not clear.
Plz explain your question a bit.

Make a validation function at code behind. As you said the textbox value may or may not be mandatory.
So write code as per your requirement.
 
Share this answer
 
try with custom validator.

http://asp.net-tutorials.com/validation/custom-validator/[^]

You can manually changed the is field is mandotaory is not as per your condition.
 
Share this answer
 
v2
please insure that you will not apply validation group on that textbox that's why
request transfer is called...
 
Share this answer
 
solution is pretty simple use CausesValidation="false" in asp:button
or write like this
<input type="button" onclick="validation();return false;"/>
<asp:Button id="aa" runat="server" onclick="fadf" onClientClick="validation();return false;"/>
 
Share this answer
 

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