パッチ KB958502 を Visual Studio 2008 に適用し、次の行を含めることで、最終的に Intellisense が JQuery で動作するようになりました。
/// <reference path="JQuery\jquery-1.3.2.js"/>
私の.jsファイルの上部にあります。現在、ScriptManager の ScriptReference 要素によって生成されたクライアント プロキシの JavaScript インテリセンスを取得する方法を見つけようとしています (ここに示すように)。
<asp:ScriptManager ID="ScriptManager1" runat="Server" EnablePartialRendering="false" AsyncPostBackTimeout="999999">
<Services>
<asp:ServiceReference path="../Services/DocLookups.svc" />
</Services>
</asp:ScriptManager>
クライアント プロキシは機能しています。つまり、それらを介して呼び出しを行うことはできますが、Intellisense が得られません。
私のサービスは .svc ファイルで定義されています:
<%@ ServiceHost Language="C#" Debug="true" Service="Documents.Services.DocLookups" CodeBehind="~/App_Code/DocLookups.cs" %>
コード ビハインド ファイルは次のようになります。
[ServiceContract(Namespace = "Documents.Services", Name = "DocLookups")]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
[ServiceBehavior(IncludeExceptionDetailInFaults = true)]
public class DocLookups {
...
このクラスのサンプル メソッドは次のとおりです。
//Called at the begining of the page to fill in the category list
[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; //Select first item
return Result;
}
そして、次のように定義されたデータ コントラクトを使用します。
namespace Documents.Services {
[DataContract]
public class SelectOption
{
//A useful DTO to use when filling a <select> element with options
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; }
}
}
私の JavaScript ファイルでは、このサービスへの呼び出しは次のようになります。
Documents.Services.DocLookups.GetCategoriesForSelectList(...
しかし、Intellisense が表示されません (たとえば、Documents. と入力しても何も表示されません)。生成されたメソッドまたはメソッドで使用される [DataContract] 型のいずれについても、インテリセンスを取得できません。
これらのプロキシとタイプに対して Intellisense を取得することになっていると思いますが、何が間違っているのかわかりません。ティア。