AJAX calendar control

  • Thread starter Thread starter George
  • Start date Start date
G

George

How do I tell script manager to load necessary JavaScript files to support
CalendarBehavior.

If I drop Calendar control on the page it's done automatically. But I do not
have CalendarControl on the page. My JavaScript code will attach it in
runtime but I need to be able to load JavaScript files that support
CalendarBehaviour...

Thanks
George.
 
Finally found an answer

<asp:ScriptManager ID="ScriptManager1" runat="server">
<Scripts>
<asp:ScriptReference Assembly="AjaxControlToolkit"
Name="AjaxControlToolkit.Common.Common.js" />
<asp:ScriptReference Assembly="AjaxControlToolkit"
Name="AjaxControlToolkit.ExtenderBase.BaseScripts.js" />
<asp:ScriptReference Assembly="AjaxControlToolkit"
Name="AjaxControlToolkit.Common.Threading.js" />
<asp:ScriptReference Assembly="AjaxControlToolkit"
Name="AjaxControlToolkit.Animation.Animations.js" />
<asp:ScriptReference Assembly="AjaxControlToolkit"
Name="AjaxControlToolkit.PopupExtender.PopupBehavior.js" />
<asp:ScriptReference Assembly="AjaxControlToolkit"
Name="AjaxControlToolkit.Animation.AnimationBehavior.js" />
<asp:ScriptReference Assembly="AjaxControlToolkit"
Name="AjaxControlToolkit.Common.DateTime.js" />
<asp:ScriptReference Assembly="AjaxControlToolkit"
Name="AjaxControlToolkit.Compat.Timer.Timer.js" />
<asp:ScriptReference Assembly="AjaxControlToolkit"
Name="AjaxControlToolkit.Calendar.CalendarBehavior.js" />
</Scripts>
</asp:ScriptManager>


Here is list of scripts needs to be added for each control
http://mattberseth2.com/demo/Default.aspx?Name=AjaxControlToolkit+Script+Browser&Filter=All

George.
 
I have AJaxControlToolkit.dll in my project.
There is no problem with CalendarControl. It's just I do not want to drop it
on my page.
I use JavaScript code to attach CalendarBehaviour to my input box.

Like this
$create(AjaxControlToolkit.CalendarBehavior,
{ "button":$get("imgCal1"),
"format":"MM/dd/yy",
"id":"CalendarExtender1"
},
null,
null,
$get("txtDate1")
);

I just need to make AjaxControlToolkit.CalendarBehavior available by
including proper Javascript files.

PS: Problem was solved by adding following lines to ScriptManager.

<asp:ScriptManager ID="ScriptManager1" runat="server">
<Scripts>
<asp:ScriptReference Assembly="AjaxControlToolkit"
Name="AjaxControlToolkit.Common.Common.js" />
<asp:ScriptReference Assembly="AjaxControlToolkit"
Name="AjaxControlToolkit.ExtenderBase.BaseScripts.js" />
<asp:ScriptReference Assembly="AjaxControlToolkit"
Name="AjaxControlToolkit.Common.Threading.js" />
<asp:ScriptReference Assembly="AjaxControlToolkit"
Name="AjaxControlToolkit.Animation.Animations.js" />
<asp:ScriptReference Assembly="AjaxControlToolkit"
Name="AjaxControlToolkit.PopupExtender.PopupBehavior.js" />
<asp:ScriptReference Assembly="AjaxControlToolkit"
Name="AjaxControlToolkit.Animation.AnimationBehavior.js" />
<asp:ScriptReference Assembly="AjaxControlToolkit"
Name="AjaxControlToolkit.Common.DateTime.js" />
<asp:ScriptReference Assembly="AjaxControlToolkit"
Name="AjaxControlToolkit.Compat.Timer.Timer.js" />
<asp:ScriptReference Assembly="AjaxControlToolkit"
Name="AjaxControlToolkit.Calendar.CalendarBehavior.js" />
</Scripts>
</asp:ScriptManager>


George
 
David Wier said:
Try adding the AjaxControlToolkit.dll to your toolbox
I normally create a new tab for it and just add it in

I get an error saying assembly cannot be found when I try this in Visual
Studio 2005. Odd, it worked fine at work.

Marc
 
Back
Top