Geeks With Blogs
Bunch's Blog One day I'll have a catchy subtitle, one day
Here was some more Ajax fun I recently had. I was trying to use a CascadingDropDown using Ajax 1.0 (the version for VS2005). I had everything setup the DropDownList and CascadingDropDown controls on my aspx page, the data access functions in a class and the web methods in the asmx's code behind. Everything was also in one project.
No matter what I did I would only get ‘Method Error 500’ in the drop down and when I put a break point in the function of the asmx it would never get hit. I searched around the Internet but I ended up finding the fix in a book, go figure! I had to add in <System.Web.Script.Services.ScriptService()>. Evidently it is there and commented out when using the Ajax with VS2008 but you need to type it in for the older version.
Many thanks to Wrox’s Professional ASP.NET 3.5 In C# and VB for pointing me in the right direction, so now my page has the cascading wonders of Ajax.
<System.Web.Script.Services.ScriptService()> _
<WebService(Namespace:="")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class WebService
    Inherits System.Web.Services.WebService


[WebService(Namespace = "")]

[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]

Technorati Tags: ,
Posted on Friday, September 26, 2008 1:25 PM ASP.Net , Ajax | Back to top

Comments on this post: Web Service Not Called From Ajax Control

# re: Web Service Not Called From Ajax Control
Requesting Gravatar...
I had the exact same problem and your suggestion did the trick.

Thanks so much!
Left by david on Mar 22, 2012 11:24 AM

Your comment:
 (will show your gravatar)

Copyright © Bunch | Powered by: