Introduction:
Here I will explain how to solve the problem “Method error 500/12031 in ajax cascadingdropdown extender” using asp.net.
Description:
In previous post I explained clearly about Ajax cascading dropdownlist sample. Generally during implementation of cascading dropdonlist we will see our dropdowns shows error like “Method error 500 or Method Error 12031”. This error is occurred because of missing following line of code in WebService.
Here I will explain how to solve the problem “Method error 500/12031 in ajax cascadingdropdown extender” using asp.net.
Description:
In previous post I explained clearly about Ajax cascading dropdownlist sample. Generally during implementation of cascading dropdonlist we will see our dropdowns shows error like “Method error 500 or Method Error 12031”. This error is occurred because of missing following line of code in WebService.
[System.Web.Script.Services.ScriptService()] |
After add above line of code to our web service page code would be like this
[WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.Web.Script.Services.ScriptService()] // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. // [System.Web.Script.Services.ScriptService] public class CascadingDropdown : System.Web.Services.WebService { |
After add above line of code try to run application it will work for you.
Still if you’re getting same error try to add ValidateRequest="false" in @Page line of web page like <%@ Page ...... ValidateRequest ="false" %>
Happy Coding………
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
|
|||
10 comments :
Hi, I have writen same with all the mention things u say, bt still its gigving error Method Error 500
Still i m getting this error plz give some solution
tomra tale baal chero
thank i soo much.. with ur help i solved my problem in just 2min
sir i m geeting error method 500 plz sir so solved it this issue nad another thing whre is the page load code means that default.cs page code and where we add cascading .asmx ?
These are not the solution for this error.
one reason for this method is
public class DropdownWebService : System.Web.Services.WebService
here the name of class sholud be same as the name of your webservice file
for example:-
if your file name is cascade.asmx
then class name should be like this
public class cascade : System.Web.Services.WebService
give it a try it solved my problem...
after adding this code also same error is repeated. how can i solve this error 500
srtill i am getting error
Excellent solution.After adding that particular code,method error 500 is gone.Thanks a lot,SureshDasari
Note: Only a member of this blog may post a comment.