views:

2976

answers:

1

Hi

I've downloaded the Ajax Control toolkit

When I create a website from the Ajax control Toolkit template, I can create a web service in a single file (asmx) and hook this up to different Ajax controls provided in the toolkit.

However if I add the Toolkit to an existing ASP.Net 2.0 appliction web project I cannot create web services in a single asmx file. If I create a web service VS always creates a code behind file as well. As a result of this calls to the web service (or loading the service directly in the browser) generate the following error:

Parser Error 
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not create type 'AddAjaxToApplication.List'.
Source Error: 

Line 1:  <%@ WebService Language="C#" CodeBehind="List.asmx.cs" Class="AddAjaxToApplication.List" %>

Does anyone know how to resolve this?

Thanks,

Tim

+3  A: 

I fixed this in the end.

In VS 2005 I just needed to right click on the web service and select "View Markup". I just changed the markup to use the correct namespace:

Line 1:  <%@ WebService Language="C#" CodeBehind="List.asmx.cs" Class="List" %>

I Just removed the project name from the namespace to match the namespace used by List.asmx and this error went away.

Thanks Tim

You'd think Visual Studio would do this automatically ... if you didn't already know better.
Kenny Evitt