Basic Date Picker Documentation

BasicDatePicker.AutoPostBack Property

Automatically postback to the server after the date is modified.

[Visual Basic]
Public Property AutoPostBack As Boolean
[C#]
public bool AutoPostBack {get; set;}

Property Value

Default value is false. By default the user can navigate between months with posting back to server.

Remarks

This event is raised when the user selects a new day.

Example

[Visual Basic, C#] The following example demonstrates how to specify and code a handler for the SelectionChanged event. When the event fires the SelectedDateFormatted if printed to the page. If using Visual Studio .NET, double click on BasicDatePicker in design view to automatically setup the event delegates in the code behind.

 [Visual Basic]
<%@ Page Language="VB" AutoEventWireup="true" %>
<%@ Register TagPrefix="bdp" Namespace="BasicFrame.WebControls" Assembly="BasicFrame.WebControls.BasicDatePicker" %>
<html>
    <head>
        <title>Basic Date Picker AutoPostBack 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.
                    this.BasicDatePicker1.SelectedDate = DateTime.Today
                End If
            End Sub
            
            Sub BasicDatePicker1_SelectionChanged(sender As Object, e As EventArgs) 
                ' Write SelectedDate to page.
                Response.Write(Me.BasicDatePicker1.SelectedDateFormatted)
            End Sub
        </script>
    </head>
    <body>
        <form runat="server">
            <h3>Basic Date Picker AutoPostBack Example</h3>
            <bdp:BasicDatePicker ID="BasicDatePicker1" 
                runat="server" 
                onSelectionChanged="BasicDatePicker1_SelectionChanged" 
                AutoPostBack="true">
            </bdp:BasicDatePicker>
        </form>
    </body>
</html>
 
 [C#]
<%@ Register TagPrefix="bdp" Namespace="BasicFrame.WebControls" Assembly="BasicFrame.WebControls.BasicDatePicker" %>
<%@ Page Language="C#" AutoEventWireup="true" debug="true"%>
<html>
    <head>
        <title>Basic Date Picker AutoPostBack Example</title>
        <script runat="server">
            void Page_Load(Object sender, EventArgs e)
            {
                // Set SelectedDate to Today
                if (!IsPostBack)
                    this.BasicDatePicker1.SelectedDate = DateTime.Today;
            }
            
            void BasicDatePicker1_SelectionChanged(object sender, EventArgs e)
            {
                // Write SelectedDate to page.
                Response.Write(this.BasicDatePicker1.SelectedDateFormatted);
            }
        </script>
    </head>
    <body>
        <form runat="server">
            <h3>Basic Date Picker AutoPostBack Example</h3>
            <bdp:BasicDatePicker ID="BasicDatePicker1" 
                runat="server" 
                OnSelectionChanged="BasicDatePicker1_SelectionChanged" 
                AutoPostBack="true">
            </bdp:BasicDatePicker>
        </form>
    </body>
</html>        
 

See Also

BasicDatePicker Class | BasicFrame.WebControls Namespace