Basic Date Picker Documentation

BasicDatePicker.PostedText Property

Gets the exact string value entered by user into the TextBox.

[Visual Basic]
Public ReadOnly Property PostedText As String
[C#]
public string PostedText {get;}

Property Value

String value of TextBox.Text value. Exact value entered by user.

Example

[Visual Basic, C#] The following example demonstrates how to use the PostedText property to get the exact string value entered by user.

[Visual Basic]
<%@ Page Language="VB" AutoEventWireup="true" %>
<%@ Register TagPrefix="bdp" Namespace="BasicFrame.WebControls" Assembly="BasicFrame.WebControls.BasicDatePicker" %>
<html>
 <head>
    <title>Basic Date Picker PostedText Example</title>
     <script runat="server">
        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            If Not IsPostBack Then
                ' Set SelectedDate to Today
                Me.BasicDatePicker1.SelectedDate = DateTime.Today
            End If
        End Sub
        
        Sub Button1_Click(sender As Object, e As EventArgs) 
            Response.Write("Value supplied: " + this.BasicDatePicker1.PostedText)
        End Sub
     </script>
 </head>
 <body>
     <form runat="server">
         <h3>Basic Date Picker PostedText Example</h3>
         <p>Edit date and change to invalid DateTime value, then move focus off TextBox. Example "asdf"</p>
        <p><bdp:BasicDatePicker ID="BasicDatePicker1" runat="server"></bdp:BasicDatePicker></p>
        <p><asp:Button ID="Button1" runat="server" onclick="Button1_Click" text="Submit" /></p>
     </form>
 </body>
</html>

[C#]
<%@ Page Language="C#" AutoEventWireup="true" %>
<%@ Register TagPrefix="bdp" Namespace="BasicFrame.WebControls" Assembly="BasicFrame.WebControls.BasicDatePicker" %>
<html>
 <head>
    <title>Basic Date Picker PostedText Example</title>
     <script runat="server">
        void Page_Load(Object sender, EventArgs e)
        {
            // Set SelectedDate to Today
            if (!IsPostBack)
                this.BasicDatePicker1.SelectedDate = DateTime.Today;
        }
        
        protected void Button1_Click(object sender, EventArgs e)
        {
            Response.Write("Value supplied: " + this.BasicDatePicker1.PostedText);
        }    
     </script>
 </head>
 <body>
     <form runat="server">
         <h3>Basic Date Picker PostedText Example</h3>
         <p>Edit date and change to invalid DateTime value, then move focus off TextBox. Example "asdf"</p>
        <p><bdp:BasicDatePicker ID="BasicDatePicker1" runat="server"></bdp:BasicDatePicker></p>
        <p><asp:Button ID="Button1" runat="server" onclick="Button1_Click" text="Submit" /></p>
     </form>
 </body>
</html>

See Also

BasicDatePicker Class | BasicFrame.WebControls Namespace | IsNull | IsDate