I finally got Intellisense for JQuery by applying patch KB958502 to Visual Studio 2008 and including this line:
at the top of my .js files. Now I'm trying to figure out how to get JavaScript intellisense for client proxies generated by ScriptManager ScriptReference elements (as shown here):
<asp:ScriptManager ID="ScriptManager1" runat="Server" EnablePartialRendering="false" AsyncPostBackTimeout="999999">
<Services>
<asp:ServiceReference path="../Services/DocLookups.svc" />
</Services>
</asp:ScriptManager>
Proxies work, that is, I can make calls through them, but I do not receive Intellisense.
My service is defined using a .svc file:
<%@ ServiceHost Language="C#" Debug="true" Service="Documents.Services.DocLookups" CodeBehind="~/App_Code/DocLookups.cs" %>
The code behind the file is as follows:
[ServiceContract(Namespace = "Documents.Services", Name = "DocLookups")]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
[ServiceBehavior(IncludeExceptionDetailInFaults = true)]
public class DocLookups {
...
An example of a method in this class:
[OperationContract]
public SelectOption[] GetCategoriesForSelectList()
{
SelectOption[] Result;
IDocumentRepository repository = new DocumentEntityRepository(ConnectionString);
Result = (from cat in repository.GetDocCategories()
select new SelectOption(cat.Category_ID.ToString(), cat.CategoryName)).ToArray();
if (Result.Length > 0)
Result[0].Selected = true;
return Result;
}
and he uses a data contract defined as follows:
namespace Documents.Services {
[DataContract]
public class SelectOption
{
public SelectOption(string optionValue, string optionText) {
OptionValue = optionValue;
OptionText = optionText;
Selected = false;
}
public SelectOption(string optionValue, string optionText, bool selected) {
OptionValue = optionValue;
OptionText = optionText;
Selected = selected;
}
[DataMember]
public string OptionValue { get; set; }
[DataMember]
public string OptionText { get; set; }
[DataMember]
public bool Selected { get; set; }
}
}
In my javascript files, calling this service looks like this:
Documents.Services.DocLookups.GetCategoriesForSelectList(...
Intellisense (, , ). intellisense [DataContract], .
, , Intellisense , , . .