My scenario is: OS=Vista, VS2008, Telerik.Web.UI version 2011.1.413.35
web.config httpHandlers:
<
httpHandlers
>
<
remove
verb
=
"*"
path
=
"*.asmx"
/>
<
add
verb
=
"*"
path
=
"*.asmx"
validate
=
"false"
type
=
"System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
/>
<
add
verb
=
"*"
path
=
"*_AppService.axd"
validate
=
"false"
type
=
"System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
/>
<
add
verb
=
"GET,HEAD"
path
=
"ScriptResource.axd"
validate
=
"false"
type
=
"System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
/>
<
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
>
I'm using Master Page, so I've placed a RadScriptManager in the MasterPage
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
</
telerik:RadScriptManager
>
Now, if I insert a script block in the master page, I have Intellisense with all the ajax library standard functions, like $find.
If I insert a script block in a content page, in intellisense I don't get the ajax library functions (just standard Javascript).
Same behavior if a substitute RadScriptManager with MS ScriptManager.
Then I've added the <scripts> section to the (Rad)ScriptManager, like this:
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
asp:ScriptManager
ID
=
"ScriptManager1"
runat
=
"server"
>
<
Scripts
>
<
asp:ScriptReference
Name
=
"Telerik.Web.UI"
Assembly
=
"Telerik.Web.UI.Common.Core.js"
/>
</
Scripts
>
</
asp:ScriptManager
>
The same if using RadScriptManager instead of MS ScriptManager.
Which is the right way to work with client intellisense with VS2008 ?
TIA
Ubaldo
9 Answers, 1 is accepted
Intellisense works only with the ASP.NET ScriptManager, so you will have to put it on your pages instead of RadScriptManager whenever you want Intellisense.
With Master/Content pages, you have to put the SM wherever you want Intellisense, e.g. if you are in a Content page, put a SM there.
Currently these are the two most important things to have in mind when using JavaScript Intellisense in Visual Studio.
Below you can find more info:
- jQuery Intellisense - help article;
- ASP.NET Ajax Controls and jQuery IntelliSense - blog post;
Kind regards,
Simon
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
right, but what about the "only one" Instance Problem of a ScriptManager?
Is there any workaround or trick to have the Main ScriptManger on the Master Page and "only VS2010 visible"
JScript Intellisense ScriptManager in the Content Page?
Kind regards.,
okay found a solution by myself.... See my blog post :-)
JavaScript Intellisense with Telerik in ASP.NET Master Page Project with VS 2010
Thank you for sharing your workaround with the community.
Hopefully VS vNext will fix this so that no workaround is necessary.
Greetings,
Simon
the Telerik team
It is not possible to fix the problem at all. Lets hope that the new Visual Studio will have better intellisense support for JavaScript. For now the only workaround is to have ScriptManager placed on the content page while developing.
Greetings,
Genady Sergeev
the Telerik team
I've extended that a little bit adding the 'PersistenceMode' which allow the control to be analysed by VS before you work on the design file and give you the intellisence.
This is the class:
Imports Telerik.Web.UI
Namespace IntellisenseJavascript
<PersistenceMode(PersistenceMode.InnerProperty)> _
<ToolboxData("<{0}:IntelliJS runat=""server"" ID=""intelliJS"" />")> _
Public Class IntelliJS
Inherits RadScriptManager
Protected Overrides Sub OnInit(e As System.EventArgs)
End Sub
Protected Overrides Sub OnPreRender(e As System.EventArgs)
End Sub
Protected Overrides Sub OnLoad(e As System.EventArgs)
End Sub
Protected Overrides Sub Render(writer As System.Web.UI.HtmlTextWriter)
End Sub
Public Overrides Sub RenderControl(writer As System.Web.UI.HtmlTextWriter)
End Sub
Public Sub New()
Dim scr As UI.ScriptReference = New UI.ScriptReference("~/MyScriptFolder/MyScriptFile.js")
Me.Scripts.Add(scr)
scr = New UI.ScriptReference("~/MyScriptFolder/MySecondScriptFile.js")
Me.Scripts.Add(scr)
End Sub
End Class
End Namespace
And this is what you need to place on your page to get the javascript intellisense:
<VSFix:IntelliJS runat="server" ID="intelliJS" />
Note that if you do that modification, you will have to rebuild your project to see the effect.
For those who didn't see the message from One, you also need to add this in your web.config:
<configuration>
*It's working now* JavaScript Intellisense with Telerik in ASP.NET Master Page Project with Visual Studio 2012
http://ext-net.blogspot.de/2012/08/its-working-now-javascript-intellisense.html
/// <reference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
/// <reference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
/// <reference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
/// <reference path="Common/Scripts/MyScript1.js" />
/// <reference path="Common/Scripts/MyScript2.js" />
This eliminated the need for a .aspx file so I can just have a simple .js text file instead.