Click here to Skip to main content
16,019,843 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have an issue.I have added validation controls to my page.Its working fine.But when I disabled javascript to my browser validators are not working.Hence I got exceptions when i run my page in the browser.Can any body tell me please How to validate the controls when my javascript is enabled in my browser?
Posted

1 solution

try
C#
private void ValidateBtn_Click(Object Sender, EventArgs E)
{
    Page.Validate();
    if (Page.IsValid == true)  // yes, it is written this way in the MSDN documentation
        lblOutput.Text = "Page is Valid!";
    else
        lblOutput.Text = "Some required fields are empty.";
}


REf.
http://stackoverflow.com/questions/5534336/how-to-handle-validation-when-javascript-is-disabled-in-asp-net[^]
 
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