Basic Date Picker Documentation

BDPLite.SelectedDateFormatted Property

Gets the formatted SelectedDate as string based on the DateFormat.

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

Property Value

A String object that represents the selected date formatted as specified by the DateFormat property.

Remarks

BDPLite follows the same convention as all ASP.NET controls and by default renders based on the web server Culture settings.

BDPLite will use the System.Threading.Thread.CurrentThread.CurrentCulture to render the culture specifc DayNames, FirstDayOfWeek and MonthNames. If DatePickerDisplayType is ShortDate or LongDate, BDPLite will follow the ShortDatePattern or LongDatePattern.

Note   See Culture for more information and examples.

Example

[Visual Basic, C#] The following example demonstrates how to use the SelectedDateFormatted property to get the SelectedDate value and write to page in the same format as it appears in the TextBox.

[Visual Basic]
<%@ Page Language="VB" AutoEventWireup="true" %>
<%@ Register TagPrefix="bdp" Namespace="BasicFrame.WebControls" Assembly="BasicFrame.WebControls.BasicDatePicker" %>
<html>
 <head>
    <title>BDP Lite SelectedDateFormatted 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
                BDPLite1.SelectedDate = DateTime.Today
            End If
        End Sub
        
        Sub Button_Click(sender As Object, e As EventArgs) 
            Response.Write("You picked: " + Me.BDPLite1.SelectedDateFormatted)
        End Sub    
     </script>
 </head>
 <body>
     <form runat="server">
         <h3>BDP Lite SelectedDateFormatted Example</h3>
         <bdp:bdplite ID="BDPLite1" runat="server"></bdp:bdplite>
         <p><asp:Button 
                 ID="Button1" 
                 runat="server" 
                 text="Submit" 
                 onclick="Button_Click"></asp:Button></p>
     </form>
 </body>
</html>

[C#]
<%@ Page Language="C#" AutoEventWireup="true" %>
<%@ Register TagPrefix="bdp" Namespace="BasicFrame.WebControls" Assembly="BasicFrame.WebControls.BasicDatePicker" %>
<html>
 <head>
    <title>BDP Lite SelectedDateFormatted Example</title>
     <script runat="server">
        void Page_Load(Object sender, EventArgs e)
        {
            // Set SelectedDate to Today
            if (!IsPostBack)
                this.BDPLite1.SelectedDate = DateTime.Today;
        }

        private void Button_Click(object sender, EventArgs e)
        {
            Response.Write("You picked: " + this.BDPLite1.SelectedDateFormatted;
        }    
     </script>
 </head>
 <body>
     <form runat="server">
         <h3>BDP Lite SelectedDateFormatted Example</h3>
         <bdp:bdplite ID="BDPLite1" runat="server"></bdp:bdplite>
         <p><asp:Button 
                 ID="Button1" 
                 runat="server" 
                 text="Submit" 
                 onclick="Button_Click"></asp:Button></p>
     </form>
 </body>
</html>

See Also

BDPLite Class | BasicFrame.WebControls Namespace | SelectedDate