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

Intellisense in javascript files

11 Answers 156 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
JP
Top achievements
Rank 1
JP asked on 13 Dec 2011, 11:44 AM
Hi,

I read through a couple of posts regarding this problem, but somehow I can't get the intellisense for Telerik working.

I included a reference to jquery.js which works (so intellisense works generally) but for Telerik it doesn't work:

///<reference name="MicrosoftAjax.js"/>
///<reference name="Telerik.Web.UI.Common.Core.js" assembly="Telerik.Web.UI"/>
///<reference path="~/include/js/jquery.js" />

I'm using the current Telerik version Q3 2011.

This is my aspx page:

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Workplace.aspx.cs" Inherits="MyApp.Workplace" %>
 
<!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" style="height: 100%; overflow-y: hidden">
<head runat="server">
    <title></title>
</head>
<body style="height: 100%">
    <form id="form1" runat="server" >
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"/>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" />
    </form>
</body>
</html>

And these are the parts from the web.config where Telerik is added:

...
<appSettings file="fm.config">
    <add key="AsyncPostBackTimeout" value="600"/>
    <add key="Telerik.Skin" value="Windows7"/>
    <add key="Telerik.ScriptManager.TelerikCdn" value="Disabled"/>
    <add key="Telerik.StyleSheetManager.TelerikCdn" value="Disabled"/>
  </appSettings>
...
 
<system.web>
    <pages>
      <controls>
        <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI"/>
      </controls>
    </pages>
...
<httpHandlers>
      <!-- AJAX: -->
      <remove path="*.asmx" verb="*"/>
      <add path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
      <add path="*_AppService.axd" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
      <add path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
      <!-- Chart Reporting: -->
      <add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
 
      <!-- -->
      <add verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
      <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>
...
 
<system.webServer>
 <handlers>
      <remove name="WebServiceHandlerFactory-Integrated"/>
      <remove name="ScriptHandlerFactory"/>
      <remove name="ScriptHandlerFactoryAppServices"/>
      <remove name="ScriptResource"/>
      <!-- Chart Reporting: -->
      <remove name="ChartImageHandler"/>
      <!-- -->
      <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <!-- Chart Reporting: -->
      <add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      <!-- -->
      <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>
....

Maybe there is something wrong in my web.config file? 

Thanks!

11 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 13 Dec 2011, 01:05 PM
Hi Jp,

If I judge by the versions of the assemblies in your web.config, you could be using Visual Studio 2008. The IntelliseSense, automatically enabled by RadScriptManager works in Visual Studio 2010 only. Could that be the case?

Kind regards,
Simon
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
JP
Top achievements
Rank 1
answered on 13 Dec 2011, 02:21 PM
Hi,

I'm using Visual Studio 2010. We recently upgraded from VS 2008, thats because the web.config looks like we're using VS 2008.
0
Genady Sergeev
Telerik team
answered on 19 Dec 2011, 09:06 AM
Hello Jp,

The intellisense should be working out of the box in VisualStudio 2010 environment. Could you please try the following:

1) Create new Web Site
2) Place RadScriptManager on the page and add reference to Telerik.Web.UI (you can use the Telerik extensions to create such website with clicking only)
3) Press ctrl + shift + j - this will refresh the JavaScript intellisense
4) Open a ScriptTag in the following manner:

<script type="text/javascript">
     
     
 
    </script>

inside the script tag type $telerik.

Upon typing the dot you should see the JavaScript intellisense. Does this happen? Also, do you have Visual Studio 2010 service pack 1 installed?


Greetings,
Genady Sergeev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
JP
Top achievements
Rank 1
answered on 02 Jan 2012, 09:46 AM
Do I have to place a RadScriptManager on the page for getting the intellisense to work?
Referencing MicrosoftAjax.js works fine.
0
Genady Sergeev
Telerik team
answered on 05 Jan 2012, 09:32 AM
Hi Jan-Patrick,

Yes, there should be RadScriptManager present on the page. Did you manage to get it working?

Greetings,
Genady Sergeev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
JP
Top achievements
Rank 1
answered on 10 May 2012, 08:39 AM
Hi,

I want to get back on resolving this issue for me.
The ScriptManager is added in code-behind, in a derived class of "Page" (we use an own class derived from page where the scriptmanager is added), could this be an issue?

I also tried your example:
<html xmlns="http://www.w3.org/1999/xhtml" style="height: 100%">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server" style="height: 100%">
       <asp:ScriptManager ID="S1"></asp:ScriptManager>
       <script type="text/javascript">
       $telerik.
    </script>
    </form>
</body>
</html>

But it doesn't work, even if I use the RadScriptManager instead of the ScriptManager and refreshing the intellisense. The rpoject has a reference to Telerik.Web.UI.dll

Is there anything else which could lead to such problems? Is there anything wrong with my web.config? 
Are there any other thing I can check?
0
Genady Sergeev
Telerik team
answered on 15 May 2012, 08:39 AM
Hello,

The intellisense is available only with the RadScriptManager, not the standard one. There used to be an issue with Visual Studio 2008 where the intellisense was not available unless service upgrade was applied. Do you by any chance use Visual Studio 2008?

Regards,
Genady Sergeev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
JP
Top achievements
Rank 1
answered on 15 May 2012, 08:46 AM
We are using Visual Studio 2010 SP1 with ASP.NET 4.0 and Telerik Q3 2011.
Do I have to add the RadScriptManager to the aspx page? The javascript is in another assembly and embedded as ScriptResource.
0
Genady Sergeev
Telerik team
answered on 17 May 2012, 05:14 PM
Hello Jan-Patrick,

I am afraid that I am having hard time understanding your scenario. What do you mean by saying that the JavaScript is in another assembly? Are you trying to enable JavaScript on custom JavaScript files, no the telerik framework?

If you want intellisense for Telerik, sipmly placing the RadScriptManager on the page should enable it. If you are using Master pages, put RadScriptManagerProxy on the content page and please let us know how it is going.

Kind regards,
Genady Sergeev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
JP
Top achievements
Rank 1
answered on 21 May 2012, 08:45 AM
Hi,

the javascript I'm editing is located in another assembly (not the assembly of the application). In this javascript I want to activate intellisense for telerik.


I also tried to add the RadScriptManager to my aspx page (I picked the startup page - is this enough?) but in javascript files which are added to the web application the intellisense won't work too.

That is my aspx page:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="start.aspx.cs" Inherits="xyz.Web.Apps.MyApp.Start" %>
<!DOCTYPE html>
 
<html xmlns="http://www.w3.org/1999/xhtml" style="height: 100%">
<head runat="server">
    <title></title>
</head>
<body style="height: 98%">
    <form id="form1" runat="server" style="height: 100%">
       <telerik:RadScriptManager ID="RadScriptManager1" runat="server"/>
    </form>
</body>
</html>

And this is the header of the javascript file which is part of this project:

///<reference name="MicrosoftAjax.js"/>
///<reference name="Telerik.Web.UI.Common.Core.js" assembly="Telerik.Web.UI"/>

Intellisense works fine for MicrosoftAjax (intellisense finds e.g. $add, $create) but not for Telerik.
0
Genady Sergeev
Telerik team
answered on 24 May 2012, 12:23 PM
Hello Jan,

Please note that the VisualStudio intellisense must load  the underlying VSDoc file, in the case of Telerik - Core.VSDOC.js. This file is located in the telerik assembly and in regular ASPX pages the RadScriptManager makes it load in the run time effectively providing intellisense. In your custom dll on the JS page there is no RadScriptManager so no one is loading the VSDOC file. This means that there wont be intellisense.

Unfortunately I cannot think of a possible workaround at the moment. It is very hard to provide intellisense support for JavaScript and VisualStudio has a long way to go until it can automatically load such JS files. Lets hope that in VisualStudio 2011 the situation would be better.

As for when working in ASPX pages, well, placing the RadScriptManager on the page is sufficient in order to trigger the intellisense, as long as VisualStudio 2010 is used.

Greetings,
Genady Sergeev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
General Discussions
Asked by
JP
Top achievements
Rank 1
Answers by
Simon
Telerik team
JP
Top achievements
Rank 1
Genady Sergeev
Telerik team
Share this question
or