Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET error with Assembly

Hello I am creating an ASP.NET/C# website and I want to use the Ajax Toolkit assembly. I added it to the "References".

In Default.aspx I have this:

<%@ Page Title="My_Website" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" ViewStateMode="Enabled" CodeBehind="Default.aspx.cs" Inherits="My-Website._Default" %>  <%@ Register TagPrefix="ajaxToolkit" Namespace="AjaxControlToolkit" Assembly= "AjaxControlToolkit"%> <asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"> </asp:Content> <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"> <ajaxToolkit:ComboBox ID="ComboBox1" runat="server" /> </asp:Content> 

In the Design Tab I can see the Combo box and everything is fine. But when I try to debug the application I get this error:

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.

like image 856
Y2theZ Avatar asked Aug 23 '11 12:08

Y2theZ


1 Answers

I had the same error message while ago and it was caused due to missing ScriptManager. Try to add ScriptManager to your aspx page.

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

Or you can add ScriptManager dynamically at Page_Load event of code behind.

if (ScriptManager.GetCurrent(Page) == null) {      Page.Form.Controls.AddAt(0, new ScriptManager()); } 

If you want to learn why we need ScriptManager when ASP.NET AJAX ToolKit is used you can check here.

like image 183
emre nevayeshirazi Avatar answered Oct 09 '22 12:10

emre nevayeshirazi