Hi.
I am trying to get ASP.NET (Framework 3.5), AJAX, and JSON to work. I have two questions along those lines. This first is, when I add the below tag as required by ASP.NET:
[AspNetCompatibilityRequirements(RequirementsMode =
AspNetCompatibilityRequirementsMode.Allowed)]
I find that I cannot add it above an interface declaration, only a class. I want this code to be an interface. Can somebody tell me what I am doing wrong? The error is as follows:
Attribute AspNetCompatibilityRequirements is not valid on this declaration type. It is only valid on 'class' declarations.
[ServiceContract(Namespace = "API.Trade")]
[AspNetCompatibilityRequirements(RequirementsMode =
AspNetCompatibilityRequirementsMode.Allowed)]
public interface ITradeService
{
[OperationContract(Name = "GetAllCategories")]
string GetCategories(string itemtype, string keywordstring);
[OperationContract(Name = "GetCategoryByNodeLevel")]
string GetCategories(int NodeLevel);
[OperationContract]
int GetTrades(string KeywordString, string TradeType);
}
THE SECOND question is, in the ASPX ScriptManager tag:
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="?" />
</Services>
</asp:ScriptManager>
I notice that the Path= attribute should be pointing to a .SVC file. So far, I have successfully been using a WCF Class Library to accomplish what I need. The Class Library has the Trade.cs, TradeService.cs, and ITradeService.cs files which I compile and then reference as my Web Service in my Web project.
So, what should "Path=" be pointing to? Or, what do I need to add?
I am learning as I go and I appreciate your patience. Thanks in advance.