This is a migrated thread and some comments may be shown as answers.

[Solved] telerik is not defined javascript error

15 Answers 782 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jefferson
Top achievements
Rank 1
Jefferson asked on 16 Jan 2008, 07:51 PM
Hi!, I am using the prometheus radtreeview control, I have a wap project, and  the script manager is in the master page : it uses a scriptpath for loading js. In the MicrosoftAjaxLibrary folder should be every js to load in the page, but i don´t know what js I have to load for telerik. so I think the javascript error in the page is because of that. the error is "telerik is not defined", when i expand the treeview node nothing happens. do I have to put some line in the web.config or something?. please help.


This is the script manager in the master:

<

asp:ScriptManager ID="Scriptmanager1" AsyncPostBackTimeout="800" runat="server" EnableScriptGlobalization="True" EnableScriptLocalization="false" EnablePartialRendering="True" ScriptPath="~\MicrosoftAjaxLibrary" ScriptMode="Release">

</asp:ScriptManager>


this is the aspx code of the page

<%

@ Page Language="C#" AutoEventWireup="true" Codebehind="BuscarProcesosArbolV2.aspx.cs" Inherits="Proceso_BuscarProcesosArbolV2"

Title="BuscarProcesosArbolV2" MasterPageFile="~/Shared/Default.master" %>

<%

@ Register Assembly="Microsoft.Practices.Web.UI.WebControls" Namespace="Microsoft.Practices.Web.UI.WebControls"

TagPrefix="pp" %>

<%

@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<%

@ MasterType VirtualPath="~/Shared/Default.master" %>

<%

@ Register Src="../Shared/Titulo.ascx" TagName="Titulo" TagPrefix="uc1" %>

<%

@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<%

@ Register Src="../Shared/TituloPopup.ascx" TagName="TituloPopup" TagPrefix="uc4" %>

<%

@ Register Src="ReporteProcesos.ascx" TagName="ReporteProcesos" TagPrefix="uc3" %>

<

asp:Content ID="content" ContentPlaceHolderID="DefaultContent" Runat="Server">

<uc1:Titulo ID="Titulo1" runat="server" Titulo="<%$ Resources:Titulo1Titulo %>" />

<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">

<ContentTemplate>

<asp:Table ID="TablaValor" runat="server">

<asp:TableRow>

<asp:TableCell ColumnSpan="4" id="tcGeneracionValor" text="<%$ Resources:tcGeneracionValor %>" CssClass="TdCeldaSubTituloSeccion">

</asp:TableCell>

</asp:TableRow>

</asp:Table>

<telerik:RadTreeView ID="RadTreeView1" runat="server" >

</telerik:RadTreeView>

15 Answers, 1 is accepted

Sort by
0
Mark Richards
Top achievements
Rank 1
answered on 16 Jan 2008, 10:16 PM
I did see this error a few times and if you use a HTTP monitor like Fiddler or HTTPWatch you'll see that there are a couple references back to the server that are returning 404.  I can't remember off hand what those were but once I saw that it was pretty easy to fix.
0
Jefferson
Top achievements
Rank 1
answered on 16 Jan 2008, 11:47 PM
I found there are five .js  that are given the 404 error, where can i get the files?,.. thanks!!

# Result Protocol Host URL Body Caching Content-Type User-defined
15 404 HTTP localhost:3801 /MicrosoftAjaxLibrary/Telerik.Web.UI/2007.3.1218.20/Telerik.Web.UI.Common.Toolkit.CommonScripts.js 2.297 private text/html; charset=utf-8
16 404 HTTP localhost:3801 /MicrosoftAjaxLibrary/Telerik.Web.UI/2007.3.1218.20/Telerik.Web.UI.Common.Toolkit.TimerScripts.js 2.296 private text/html; charset=utf-8
17 404 HTTP localhost:3801 /MicrosoftAjaxLibrary/Telerik.Web.UI/2007.3.1218.20/Telerik.Web.UI.Common.Toolkit.AnimationScripts.js 2.300 private text/html; charset=utf-8
18 404 HTTP localhost:3801 /MicrosoftAjaxLibrary/Telerik.Web.UI/2007.3.1218.20/Telerik.Web.UI.Common.Toolkit.BaseScripts.js 2.295 private text/html; charset=utf-8
21 404 HTTP localhost:3801 /MicrosoftAjaxLibrary/Telerik.Web.UI/2007.3.1218.20/Telerik.Web.UI.TreeView.RadTreeViewScripts.js 2.296 private text/html; charset=utf-8
0
Mark Richards
Top achievements
Rank 1
answered on 18 Jan 2008, 04:08 PM
Check if you have this in your web.config.

      <controls> 
        <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>  
      </controls> 
0
Jefferson
Top achievements
Rank 1
answered on 18 Jan 2008, 06:43 PM
hi.... thank for your replies... I have that line in the web.config... but what i need is to extract the js source files from the assembly.. i used a tool call extractjsfromassembly.exe , but it doesn't extract all the files that i need.. so I need a way to get those js files from the telerik assembly.. do you know any kind of method to do that.. thanks!!!
0
Atanas Korchev
Telerik team
answered on 21 Jan 2008, 07:53 AM
Hello Jefferson,

You seem to have set the ScriptPath property of the ScriptManager. This effectively makes all scripts registered with the SriptManager to be requested from that location.

Regards,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jefferson
Top achievements
Rank 1
answered on 21 Jan 2008, 01:32 PM
H!.. I can't find the  telerik js scripts... can you help me to find them!!..
0
Atanas Korchev
Telerik team
answered on 21 Jan 2008, 02:47 PM
Hi Jefferson,

We are currently not shipping the JavaScript files separately. They are only available as embedded resources in the Telerik.Web.UI.dll assembly. If you are not setting the ScriptPath property everything should work as expected.

Regards,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jefferson
Top achievements
Rank 1
answered on 21 Jan 2008, 02:58 PM
Hi, thanks for your replies, I have set the scrippath property, but it doesn't work if I don´t have all the js scripts, do you know another way to solve this problem of js references..how to configure the scrippath to resolve the js reference problem..
thanks!
0
Atanas Korchev
Telerik team
answered on 21 Jan 2008, 03:33 PM
Hi Jefferson,

The solution would be to avoid setting the ScriptsPath property of the ScriptManager control. If you set it all script references will be requested from the path specified by ScriptsPath.

Regards,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jefferson
Top achievements
Rank 1
answered on 21 Jan 2008, 03:44 PM
Hi, thanks for your replies, but I had performance problems without setting the scriptpath property, so we decide to include it... so there is no way to work with telerik with the scriptpath???.. that could be a big problem for buying your product.. thanks!
0
Atanas Korchev
Telerik team
answered on 21 Jan 2008, 03:59 PM
Hello Jefferson,

As I said before currently we are not shipping the JavaScript files of the Prometheus suite. As a result you cannot use them along with the ScriptsPath property. As with performance related problems - by default the ScriptManager output debug scripts which could potentially cause performance issues. You can try with setting the debug attribute of the <compilation> tag to "false" or setting the ScriptMode property of the ScriptManager to "Release".

I hope this helps,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jefferson
Top achievements
Rank 1
answered on 21 Jan 2008, 06:03 PM
Hi, I´ve remove the scriptpath tag, but i've got another javascript exception when i Include a context menu in a radtreeview. the error is: telerik:RadTreeViewContextMenu is not define?.. do you know what refference should I include?

thanks
0
Atanas Korchev
Telerik team
answered on 22 Jan 2008, 08:57 AM
Hello Jefferson,

Please check our online example demonstrating how to use the treeview context menu:

http://www.telerik.com/demos/aspnet/prometheus/Treeview/Examples/Functionality/ContextMenu/DefaultCS.aspx

Here is a simple setup of a treeview with one context menu:

<telerik:RadTreeView ID="RadTreeView1" Runat="server"
    <ContextMenus> 
        <telerik:RadTreeViewContextMenu Skin="Outlook" ID="MainContextMenu" runat="server"
            <Items> 
                <telerik:RadMenuItem Text="One" /> 
                <telerik:RadMenuItem Text="Two" /> 
            </Items> 
        </telerik:RadTreeViewContextMenu> 
    </ContextMenus> 
    <Nodes> 
        <telerik:RadTreeNode Text="One"
                <Nodes> 
                    <telerik:RadTreeNode Text="Two" /> 
                </Nodes> 
        </telerik:RadTreeNode> 
    </Nodes> 
</telerik:RadTreeView> 

I hope this helps,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jefferson
Top achievements
Rank 1
answered on 22 Jan 2008, 06:53 PM
Hi, thnks for your help..
I've got another problem, when I'm using a radtreeview inside a datalist i need to bind all the data in code, it doesn't work the contextmenu, what should I do?
this is some code, of aspx

<asp:DataList ID="dtlProcesosValor" runat="server" RepeatDirection="Horizontal" RepeatColumns="3"

ItemStyle-CssClass="treeSoporte">

<ItemTemplate>

<telerik:RadTreeView ID="trvProcesosValor" runat="server" OnContextMenuItemClick="RadTreeView1_ContextMenuItemClick"

>

<ContextMenus >

<telerik:RadTreeViewContextMenu ID="MainContextMenu" runat="server" Skin="Outlook">

<Items>

<telerik:RadMenuItem Value="Editar" Text="Editar" ></telerik:RadMenuItem>

<telerik:RadMenuItem Value="Eliminar" Text="Eliminar" PostBack="true" ></telerik:RadMenuItem>

<telerik:RadMenuItem Value="Detalle" Text="Detalle" ></telerik:RadMenuItem>

<telerik:RadMenuItem Value="Ver Diagrama" Text="Ver Diagrama" PostBack="true"></telerik:RadMenuItem>

<telerik:RadMenuItem Value="Eliminar Diagrama" Text="Eliminar Diagrama" PostBack="true"></telerik:RadMenuItem>

</Items>

</telerik:RadTreeViewContextMenu>

</ContextMenus>

</telerik:RadTreeView>

</ItemTemplate>

</asp:DataList>

0
Accepted
Atanas Korchev
Telerik team
answered on 23 Jan 2008, 08:44 AM
Hi Jefferson,

We had a problem with context menus being cleared after databinding the treeview. Please make sure you are using our latest bits where this problem has been fixed. The version number of the assembly should be
2007.3.1314.20

Regards,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
TreeView
Asked by
Jefferson
Top achievements
Rank 1
Answers by
Mark Richards
Top achievements
Rank 1
Jefferson
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or