AjaxControlToolkit etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
AjaxControlToolkit etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster

18 Eylül 2012 Salı

possible cause for a common AjaxControlToolkit error

The full error message:

Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "AjaxControlToolkit.Properties.Resources.NET4.resources" was correctly embedded or linked into assembly "AjaxControlToolkit" at compile time, or that all the satellite assemblies required are loadable and fully signed.


The working environment is the same as in http://hilaltarakci.blogspot.com/2012/09/using-calendarextender.html.
I have a user control using ajax control toolkit components and i am pretty sure this control works properly on its own. However, when i tried to use the control in another control, i got the above error.
In my case, adding the following lines to the caller user control fixed my problem:



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



i got the idea from here: http://www.vijaykodali.com/Blog/post/2011/11/06/Make-sure-AjaxControlToolkitPropertiesResourcesNET4resources-was-correctly-embedded.aspx
it specifies the reason for the error as

AjaxControlToolkit’s control load reference refers to the base System.Web.UI.Control method which is present as a part of the ASP.NET AJAX Libraries and those libraries are referenced only when the ScriptManager is referenced in the page.

using CalendarExtender


here is some useful links to use CalendarExtender
http://www.ezineasp.net/post/AJAX-Control-Toolkit-Calendar-Extender.aspx
http://hazaa.com.au/2007/08/13/how-to-use-the-ajax-control-toolkit-calendar-extender-control/

lets summarize the process:

  • install ajax control toolkit  ( http://ajaxcontroltoolkit.codeplex.com/) to your project via Visual Studio package manager console with command Install-Package AjaxControlToolkit. This creates packages folder in your repository and downloads the assemblies in that folder.. 
  • in your Web.config file add these two statements:
    • <add assembly="AjaxControlToolkit"/> This line goes under configuration->system.web->compilation->assemblies tag.
    • < add tagPrefix= " ajaxToolkit "  assembly= " AjaxControlToolkit "  namespace= " AjaxControlToolkit "  / > This line goes under configuration->system.web->pages->controls tag.
  • use the control as follows:
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix= " cc1" %>

<asp:TextBox ID="TextBoxDogumTarihi" runat="server"/>
<asp:Image ID="ImageDogumTarihi" runat="server" ImageUrl="../images/calendar.png" />
<cc1:CalendarExtender ID="CalendarDogumTarihi" TargetControlID="TextBoxDogumTarihi" runat="server"
                                        PopupPosition="Right"   PopupButtonID="ImageDogumTarihi"   />

In the following image, the above is a CalendarExtender whereas the below is a styled asp.net calendar.


 to customize CalendarExtender see http://www.ezineasp.net/post/Customized-AJAX-Calendar-Control-CSS-Example.aspx