ajaxtoolkit:CalendarExtender working on one asp.net webpage but not on others from same site

6.6k Views Asked by At

first post hopefully you can all help me. Basically I have registered an ajax web toolkit Calendar Extender in the config file and registered it for one of my asp.net web pages as follows:

Web Config file:

<system.web>
    <compilation debug="true" targetFramework="4.0"/>
      <pages>
          <controls>
              <add tagPrefix="ajaxtoolkit" namespace="AjaxControlToolkit" assembly="AjaxControlToolKit"/>
          </controls>
      </pages>
  </system.web>

Import on page:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Edit.aspx.cs" Inherits="Edit" %>
<%@ Register TagPrefix="CDV" Namespace="CustomDateValidator" %>
<%@ 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">

Calendar Extender Tag on page:

<ajaxtoolkit:CalendarExtender runat="server" id="surveyedDateCal" TargetControlID="surveyedDateValueTxt"
                Format="dd/MM/yyyy"></ajaxtoolkit:CalendarExtender>

The above works perfectly fine on the first page I used it on. Now I want to use it on another page so I just assume it's a case of using the below statement on the other page I want to use the calendar extender on.

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

When I do this the site builds fine but at runtime I get the following error when I try to navigate to the page:

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.

Can anyone suggest anything? Am I missing something obvious? I'm using Visual Web Developer 2010. I hope I have supplied enough detail in the question, let me know if not.

1

There are 1 best solutions below

1
On BEST ANSWER

If you have registered the assembly on the page as you have done you can use the follwing to call the control.

<asp:CalendarExtender runat="server" id="surveyedDateCal" 
  TargetControlID="surveyedDateValueTxt"Format="dd/MM/yyyy">
</asp:CalendarExtender>

Also ensure that the page you adding it to also has a script manager present before the above control

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

If you are using ajax controls throughout the site it can be easier to add the script manager at the top of your master page to save you adding it to the content pages. You only need one script manager on a page.