Page.IsValid Demo (VB.net) : Page IsValid « Page « ASP.Net






Page.IsValid Demo (VB.net)

<%@ Page Language="vb" %>
<html>
   <head>
      <title>IsValid property example</title>
      <script runat="server">
         Sub Page_Load()
            If IsPostBack Then
               Page.Validate()
               If Page.IsValid Then
                  Message.Text = "Page is valid."
               Else
                  Message.Text = "Page is not valid."
               End If
            End If
         End Sub
      </script>
   </head>
<body>
   <form runat="server">
      Enter your name:
      <asp:textbox id="name" runat="server"/>
      <asp:requiredfieldvalidator 
         id="rfvName"
         controltovalidate="name"
         enableclientscript="false"
         errormessage="Required!"
         runat="server"/>
      <br/>
      <asp:button id="submit" Text="Submit" runat="server"/>
      <br/>
      <asp:label id="Message" runat="server"/>
   </form>
</body>
</html>
           
       








Related examples in the same category

1.Is page valid (C#)