locked
Need an event of selection of asp:CalendarExtender RRS feed

  • Question

  • User1052662409 posted

    Hi All,

    I am using a Calendar Extender in my form. Now I want to do after selecting the date from it. I don't find any event on server side for this control. below is my aspx code

     <asp:TextBox ID="txtDate_From" runat="server" CssClass="link" Width="180px"  
                        ontextchanged="txtDate_From_TextChanged" Enabled="False"></asp:TextBox>
                    <asp:CalendarExtender ID="txtDate_From_CalendarExtender" Format="dd/MM/yyyy" runat="server"
                        Enabled="True" TargetControlID="txtDate_From" >

    Could you please let me what I can do for my requirement?

    Thanks

    Thursday, March 10, 2016 7:04 AM

Answers

  • User61956409 posted

    Hi demoninside9,

    I am using a Calendar Extender in my form. Now I want to do after selecting the date from it. I don't find any event on server side for this control.

    You could try to get the selected date on TextChanged event, the following sample is for your reference.

    <asp:TextBox ID="txtdate" runat="server" OnTextChanged="txtdate_TextChanged" AutoPostBack="true"></asp:TextBox>
    <asp:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtdate"></asp:CalendarExtender>
    <asp:Label ID="Label1" runat="server" Text=""></asp:Label>
    
    protected void txtdate_TextChanged(object sender, EventArgs e)
    {
        Label1.Text = txtdate.Text;
    }
    

    Best Regards,

    Fei Han



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, March 11, 2016 6:19 AM