Click here to Skip to main content
15,893,564 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i use ajaxcalender exdender control for pick date to textbox
but when i click textbox the calender not popup what is the problem????

and this is my code

C#
<tr>
<td>Choose Date</td><td style="width:10px">:</td>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    <td>
    <asp:TextBox ID="date1" runat="server">
    <asp:ImageButton ID="Image1" runat="server" ImageUrl="~/images/cal.png" />
    <asp:CalendarExtender ID="CalendarExtender1" runat="server" 
        PopupButtonID="Image1" TargetControlID="date1"></td></tr>


after that i place following code in webconfig file
C#
<add tagprefix="ajaxToolkit" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" />
Posted
Updated 23-Sep-11 0:19am
v2
Comments
Pravin Patil, Mumbai 23-Sep-11 6:23am    
You posted the same question at http://www.codeproject.com/Questions/259057/ajaxcalender-exdender-control.
Just update that question, do not repost it, be sure you will get the response.

Be Cool and Try:

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>


<cc1:ToolkitScriptManager ID="ToolkitScriptManager1"  runat="server">
        </cc1:ToolkitScriptManager>
        <asp:TextBox ID="txtDate" runat="server"></asp:TextBox>
        <cc1:CalendarExtender ID="CalendarExtender1" TargetControlID="txtDate"  runat="server">
        </cc1:CalendarExtender>
 
Share this answer
 
v2
Hi
You were missing close tags
ASP.NET
<tr>
<td>Choose Date</td><td style="width:10px">:</td>
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
    <td>
                <asp:TextBox ID="date1" runat="server">    </asp:TextBox>
    <asp:ImageButton ID="Image1" runat="server" ImageUrl="/images/cal.png" />

    <asp:CalendarExtender ID="CalendarExtender1" runat="server"
        PopupButtonID="Image1" TargetControlID="date1">
        </asp:CalendarExtender>
        </td></tr>

Best Regards
M.Mitwalli
 
Share this answer
 
Hi,

First you need check closing tags for every control.

Remove "PopupButtonID" of Calendar Control(If you want calendar with text box click no use with image button).

Place the below code after page directive.
<add tagprefix="ajaxToolkit" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" />


Place the below code in body.
XML
Choose Date:
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
<asp:TextBox ID="date1" runat="server"></asp:TextBox>
<asp:ImageButton ID="Image1" runat="server"  />
<asp:CalendarExtender ID="CalendarExtender1" runat="server"
 TargetControlID="date1"/>



I hope it will help you.
 
Share this answer
 
<![CDATA[<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
 

<asp:textbox id="txtFromDate" runat="server" width-="100px" xmlns:asp="#unknown"></asp:textbox>
 <cc1:calendarextender id="CalendarExtender1" targetcontrolid="txtFromDate"  runat="server" xmlns:cc1="#unknown"></cc1:calendarextender>
 
Share this answer
 
v2
In popupControlID you have given imageid
so calender will open when you click on imagebutton

If you want to open calender when you click on textbox, then give popupbuttonid as textbox id
and remove imagebutton.
 
Share this answer
 
v2
Comments
Muralikrishna8811 23-Sep-11 8:27am    
nice quess
XML
<asp:TextBox ID="date1" runat="server">


C#
<cc1:calendarextender id="CEtxtTo"  runat="server" enabled="True" xmlns:cc1="#unknown">
                                                 TargetControlID="date1">
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900