错误“Telerik未定义”

时间:2012-08-13 06:31:35

标签: asp.net-ajax telerik

我在运行项目时收到JScript错误“Microsoft JScript运行时错误:'Telerik'未定义”。 我刚刚尝试从菜单栏'Telerik-> Rad.net控件for asp.net ajax-> configure project'配置项目,它给了我这个错误。

请在下面找到我的webconfig文件。我可以在Telerik论坛上找到关于故障排除的一些线程,但他们没有解决我的问题。 我使用的是.net 4.0版本。

<?xml version="1.0"?>
<configuration>
    <connectionStrings>
        <add name="xxx" connectionString="Data Source=xxx;Initial Catalog=xxx;Integrated Security=False; User ID=abc; Password=xxxx;" />     
    </connectionStrings>
    <appSettings>
        <add key="Telerik.Skin" value="Default" />
        <add key="Telerik.ScriptManager.TelerikCdn" value="Enabled" />
        <add key="Telerik.StyleSheetManager.TelerikCdn" value="Enabled" />            
    </appSettings>
    <system.web>
        <compilation debug="true" targetFramework="4.0">
            <assemblies>
                <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
                <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
                <add assembly="System.Speech, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /></assemblies></compilation>
        <pages>
            <controls>
                <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI" />
            </controls>
        </pages>
        <httpHandlers>
            <add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false" />
            <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false" />
            <add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false" />
            <add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false" />
            <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" />    
        </httpHandlers>
        <httpModules>
            <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" />
            <add name="RadCompression" type="Telerik.Web.UI.RadCompression" />
        </httpModules>
    </system.web>
    <system.webServer>
        <validation validateIntegratedModeConfiguration="false" />
        <modules runAllManagedModulesForAllRequests="true">
            <remove name="RadUploadModule" />
            <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" preCondition="integratedMode" />
            <remove name="RadCompression" />
            <add name="RadCompression" type="Telerik.Web.UI.RadCompression" preCondition="integratedMode" />
        </modules>
        <handlers>
            <remove name="ChartImage_axd" />
            <add name="ChartImage_axd" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" preCondition="integratedMode" />
            <remove name="Telerik_Web_UI_SpellCheckHandler_axd" />
            <add name="Telerik_Web_UI_SpellCheckHandler_axd" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" preCondition="integratedMode" />
            <remove name="Telerik_Web_UI_DialogHandler_aspx" />
            <add name="Telerik_Web_UI_DialogHandler_aspx" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" preCondition="integratedMode" />
            <remove name="Telerik_RadUploadProgressHandler_ashx" />
            <add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" preCondition="integratedMode" />
            <remove name="Telerik_Web_UI_WebResource_axd" />
            <add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode" />
        </handlers>
    </system.webServer>
</configuration>

4 个答案:

答案 0 :(得分:3)

请尝试在Web配置中使用此代码,

<httpHandlers>
  <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Version=2009.3.1314.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" verb="*" validate="false" />
</httpHandlers>

<handlers> <add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Version=2009.3.1314.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" /></handlers>

我能够在Web Config中使用这两个设置运行Telerik

答案 1 :(得分:3)

如果您使用Telerik 2013-3-1015而非替换

<add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false"/>

使用

<add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Version=2013.3.1015.45, Culture=neutral, PublicKeyToken=121fae78165ba3d4" verb="*" validate="false"/>

web.config

检查Telerik的版本。转到Solution Explorer - &gt; References现在Telerik.Web.UI Windows检查版本属性

,点击Properties

享受...... !!!!

答案 2 :(得分:1)

请将这些行添加到网络配置

<location path="Users/Telerik.Web.UI.WebResource.axd">
<system.web>
    <authorization>
        <allow users="*"/>
    </authorization>
</system.web>
</location>

<location path="Telerik.Web.UI.WebResource.axd">
<system.web>
    <authorization>
        <allow users="*"/>
    </authorization>
</system.web>
</location>

答案 3 :(得分:1)

看看你的web.config中是否有这一行并将其注释掉:

  <add key="Telerik.ScriptManager.TelerikCdn" value="Enabled" />