ASP.NET Calendar - Knowledge Base

« Back to Knowledge Base list

Use readonly textbox with date picker

Q:

How to use readonly textbox with date picker?

A:

ASPX
        <asp:TextBox Readonly="true" runat="server" id="txtDate" />
        <obout:Calendar runat="server" DatePickerMode = "true" TextBoxId = "txtDate" />


To get the date server side after postback use the Request object.

C#
        string date = Request[txtDate.UniqueID];

VB
        Dim date As String = Request(txtDate.UniqueID)