Public Class datecheck
    Inherits System.Web.UI.Page
    Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox
    Protected WithEvents Button1 As System.Web.UI.WebControls.Button

#Region " Web Form Designer Generated Code "

    ' To wywołanie jest wymagane przez Web Form Designera.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        ' CODEGEN: To wywołanie metody jest wymagane przez Web Form Designera
        ' Nie modyfikuj go za pomocą edytora kodu.
        InitializeComponent()
    End Sub

#End Region
    Dim Msg As String
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Button1.Text = "Sprawdź datę"
        TextBox1.Text = DateTime.Now.ToString
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Msg = IsDate(Request.Form.Item("TextBox1")).ToString
        Msg += "<BR>"
        Msg += Request.Form.Item("TextBox1")
        If Page.IsPostBack Then
            Response.Write(Msg)
            Button1.Text = "Data sprawdzona"
        End If
    End Sub

End Class
