通过将补丁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; }
}
}
Documents.Services.DocLookups.GetCategoriesForSelectList(...
但是我没有得到Intellisense(例如,如果我输入Documents.什么都不会弹出).对于生成的方法或这些方法使用的[DataContract]类型,我都没有智能感知.
我认为应该为这些代理和类型获取Intellisense,但无法弄清楚我可能做错了什么. TIA.
解决方法:
做过
///<参考路径=“ ../ Services / DocLookups.svc” />
不行?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。