Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Validations in .NET

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 120
    Comment on it

    In .NET we do validations to restrict wrong entries and making valid values to be entered through the forms.

    Validation on a form or UI page can be done on two sides

    1 Server Side Validation

    2 Client Side Validation

    Server Side validation we provide when we want to check the details after making request to the server

    For providing server side validation we will use ASP validators

    Ex :  <asp:TextBox id="txtName" 
                 runat="server"></asp:TextBox>
    
                <asp:RequiredFieldValidator 
                 id="RequiredFieldValidator1" runat="server" 
                 ErrorMessage="Required!" 
                 ControlToValidate="txtName">
                </asp:RequiredFieldValidator>
    

    Client side validation we provide when we wan to check the details as they are entered instantly into the form

    For providing client side validation we use Javascript validators or Jquery validators

    Ex :  <script> 
           function checkname()
           {
      var name=document.getElementByID("txtName").value;
      if(name=="")
    {
    alert("Name cannot be left blank");
    }
          }
         </script>
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: