Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to ask it is necessary to include update panel in order using ajax calender extender? i want to display calender when click the text box .I have try to including update panel, but it does not work
Posted
Comments
pankajupadhyay29 3-Apr-11 7:59am    
could you provide your markup here.
Keith Barrow 3-Apr-11 18:47pm    
Please add your code to your question, we cannot tell what is happening without it!
Ankur\m/ 4-Apr-11 2:44am    
No, you don't. You will just need to add ScriptManager.
Member 9837497 18-Feb-13 6:00am    
y is this with out any answers?

XML
If you want to popup a Calendar on the click of a button, you can use set the PopupButtonID of the CalendarExtender to the ID of the button. In this case, we will be using an ImageButton as shown below:
       <asp:ImageButton runat="Server" ID="ImageButton1" ImageUrl="~/Images/Icon1.jpg" AlternateText="Click here to display calendar" />
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

        <cc1:CalendarExtender ID="CalendarExtender1" runat="server"
        TargetControlID="TextBox1" PopupButtonID="ImageButton1"/>
If you are using an earlier version of the toolkit, you may observe that the ImageButton causes a postback when you click on it again, to close the Calendar. To avoid the postback, use a HTML Image Control instead of the Server side Image Control as shown below:
       <img alt="Icon" src="/Images/Icon1.jpg" id="Image1" />
       <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

        <cc1:CalendarExtender ID="CalendarExtender1" runat="server"
        TargetControlID="TextBox1" PopupButtonID="Image1"/>
Note: In case you are clicking on the textbox to open the calendar, then in earlier versions of the toolkit, the calendar would not hide automatically when the user clicked anywhere outside the Calendar control. However this was fixed in the later versions. In fact, in the latest version, the Calendar hides automatically when a date is selected.
If for some reason you are facing issues with the Calendar not hiding automatically, make sure that you have the latest version of the AJAX Control Toolkit.
 
Share this answer
 
Comments
nazila24 3-Apr-11 23:46pm    
thank u, thats mean i'm not using the latest version of AJAX toolkit?it is right?
why ajax calender does not work when i'm click the textboxt in my website ?i have try create a new website to test my ajax control and it is work, i'm wonder what actually the problem? can webconfig cause this problem?
I had the same issue too..., but i found solution eventually, hopefully this will be helpful, along with the asp.net Ajax extender controls, toolkit also extended Asp.Net Ajax script manager, which is called ToolkitScriptManager. Try replace <asp:scriptmanager xmlns:asp="#unknown"> with <asp:toolkitscriptmanager>, this should fix the issue you are facing.
 
Share this answer
 
There is no need to put that in update panel because update panel is used to loads only that part of the page which is required or you want to update what you can do is just add Toolkit script manager,Calendorextendor textbox and (Image on the click of which calendor will be displayd )

try this link

Link [^]
 
Share this answer
 
Comments
nazila24 3-Apr-11 23:27pm    
ok..thank u but when im using the below code, ajax calender does not appear in my website

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>

<asp:ScriptManager ID="ScriptManager1" runat="server">

<br />
<asp:TextBox ID="TextBox1" runat="server">
<asp:CalendarExtender ID="TextBox1_CalendarExtender" runat="server"
Enabled="True" TargetControlID="TextBox1">


</div>
</form>
</body>
</html>

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