the type or namespace name ‘webmethod’ could not be found
18 September 2009
1,278 views
No Comment
If you are adding Page Method on your ASP .Net page and you see this compile error:
the type or namespace name ‘webmethod’ could not be found….
then you are missing one of these things:
A. Make sure you have reference to System.Web.Services on your class.
using System.Web.Services;
B. Make sure on your web.config you have
<system.web>
<httpModules>
<add name=”ScriptModule” type=”System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″/>
</httpModules>
</system.web>
C. Make sure you have EnablePageMethods set to true on your ScriptManager
<asp:ScriptManager ID=”ScriptManager1″ EnablePageMethods=”true” runat=”server”>
</asp:ScriptManager>










Leave your response!