Bunch's Blog

  Home  |   Contact  |   Syndication    |   Login
  48 Posts | 0 Stories | 36 Comments | 0 Trackbacks

News

Tag Cloud


Archives

Green

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.
 
VB.Net
<System.Web.Script.Services.ScriptService()> _
<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class WebService
    Inherits System.Web.Services.WebService

C#
[System.Web.Script.Services.ScriptService]

[WebService(Namespace = "http://tempuri.org/")]

[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]


Technorati Tags: ,
posted on Friday, September 26, 2008 1:25 PM