ASP.NET误差大会 [英] ASP.NET error with Assembly

查看:174
本文介绍了ASP.NET误差大会的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我建立一个网站ASP.NET/C#,我想使用Ajax工具包组装。我将它添加到参考。

Default.aspx的我有这样的:

 <%@页标题=My_WebsiteLANGUAGE =C#的MasterPageFile =〜/ Site.master母AutoEventWireup =真ViewStateMode =已启用codeBehind =Default.aspx.cs
继承=我-Website._Default%><%@注册标签preFIX =ajaxToolkit命名空间=AjaxControlToolkit大会=AjaxControlToolkit%GT;
< ASP:内容ID =HeaderContent=服务器ContentPlaceHolderID =HeadContent>
< / ASP:内容>
< ASP:内容ID =的BodyContent=服务器ContentPlaceHolderID =日程地址搜索Maincontent>
< ajaxToolkit:组合框ID =ComboBox1=服务器/>
< / ASP:内容>

设计选项卡我可以看到组合框,一切都很好。
但是,当我尝试调试应用程序我得到这个错误:


  

找不到适合指定区域性或中性文化的任何资源。确保AjaxControlToolkit.Properties.Resources.NET4.resources在编译时正确嵌入或链接到程序集​​AjaxControlToolkit,或者确保所有需要的附属程序集都可加载并完全签名。



解决方案

我前一段时间有同样的错误消息,这是因为缺少的的ScriptManager 。尝试的ScriptManager添加到您的aspx页面。

 < ASP:的ScriptManager =服务器>< / ASP:ScriptManager的>


也可以添加的ScriptManager 动态在code后面的Page_Load事件。

 如果(ScriptManager.GetCurrent(页)== NULL)
{
     Page.Form.Controls.AddAt(0,新的ScriptManager());
}

如果您想了解为什么我们需要的ScriptManager在ASP.NET AJAX Toolkit是使用可以检查<一href=\"http://stackoverflow.com/questions/4468230/why-do-we-need-a-script-manager-always-when-we-are-using-ajax-control\">here.

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.

解决方案

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.

这篇关于ASP.NET误差大会的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆