How to use CalendarExtender Control

Here are the simple code snippet to use CalendarControl of AjaxControlToolkit

Add following code o your page

 

<div>
        <asp:ScriptManager ID=”ScriptManager1″ runat=”server”>
        </asp:ScriptManager>
        <div>
            <asp:Panel ID=”Panel1″ runat=”server”>
                <asp:Label ID=”Label1″ runat=”server” Text=”Date”></asp:Label>
                <asp:TextBox ID=”TextBox1″ runat=”server”></asp:TextBox><asp:Button ID=”ShowCal”
                    runat=”server” Text=”Show Cal” />
                <cc1:CalendarExtender ID=”TextBox1_CalendarExtender” runat=”server” Enabled=”True”
                    TargetControlID=”ShowCal”>
                </cc1:CalendarExtender>
        </div>

<div>

   <asp:ScriptManager ID=”ScriptManager1″ runat=”server”></asp:ScriptManager>

  <asp:TextBox ID=”TextBox1″ runat=”server”></asp:TextBox>         <cc1:CalendarExtender ID=”TextBox1_CalendarExtender” runat=”server” Enabled=”True”     TargetControlID=”TextBox1″/>

     </div>

Now clciking on the TextBox, it  will popup a Calendar. 

i guess its too easy than the old javascript Calendar popup. Isn’t it .

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s