Asp Net Webmethod Internal Server Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions webmethod 500 internal server error you might have Meta Discuss the workings and policies of
Asp Net Webmethod Upload File
this site About Us Learn more about Stack Overflow the company Business Learn more about hiring asp net webmethod json developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is
Asp Net Webmethod Enablesession
a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up ASP.NET 500 Internal Server Error while calling webmethod from javascript up vote 0 down vote favorite 2 I'm trying to call the webmethod fucntionality using AJAX but unable to get the appropriate asp net webmethod ajax results. I have googled my problem and found many solution but those didn't worked for me. Please guide me what I'm doing wrong. Help will be appreciated. Cheers Code Snippet function checkUserNameExists() { //initialization var pagePath = window.location.pathname + "/getUsername"; var value = document.getElementById('control_userName').value; var dataString = "{ 'value':'" + value + "' }"; $.ajax({ type: "GET", url: pagePath, data: dataString, contentType: "application/json; charset=utf-8", dataType: "json", error: function (XMLHttpRequest, textStatus, errorThrown) { }, success: function (result) { var flag = true; if (result != null) { flag = result.d; if (flag == "True") { alert('okay fine you are good'); } else { alert('try again'); } } } }); } Method in Behind Code file [WebMethod] [ScriptMethod(UseHttpGet = true)] public string getUsername(string value) { return "True"; } EXCEPTION ExceptionType: "System.InvalidOperationException" Message: "An attempt was made to call the method 'getUsername' using a POST request, which is not allowed." javascript c# asp.net ajax share|improve this question edited
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us
Asp Net Webmethod Get Request
Learn more about Stack Overflow the company Business Learn more about hiring developers
Asp Net Webmethod Security
or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow asp net webmethod non static Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up jQuery: Ajax call to asp.net webservice fails, server http://stackoverflow.com/questions/30011998/asp-net-500-internal-server-error-while-calling-webmethod-from-javascript return 500 error up vote 3 down vote favorite Ok, so I created a test project just to verify that jQuery AJAX works with asp.net service, and it does no problems. I used a default HelloWorld service created in VS studio. I am calling the service via jQuery like this: in Default.aspx: in TestService.asmx using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Services; namespace WebServiceTestWitJQuery { ///
Server Error 500 WebMethod Session=true - ASP.NET Web Services Hi all, Please excuse me if this topic has already been covered however I think I may have found quite a major bug in the way ASP.net sessions and webservices work together. I have created a simple webservice: [WebMethod (EnableSession=true)] public string HelloWorld(string test) { return test + " HALLO"; } and am testing it using a HTTP post
doing so I get a fatal Internal Server Error 500... completely dead :( Setting: EnableSession=False everything works fine... removing the parameter to the webmethod ... Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode September 9th,07:07 PM #1 Internal Server Error 500 WebMethod Session=true Hi all, Please excuse me if this topic has already been covered however I think I may have found quite a major bug in the way ASP.net sessions and webservices work together. I have created a simple webservice: [WebMethod (EnableSession=true)] public string HelloWorld(string test) { return test + " HALLO"; } and am testing it using a HTTP post doing so I get a fatal Internal Server Error 500... completely dead :( Setting: EnableSession=False everything works fine... removing the parameter to the webmethod again everything works fine... in my web.config file I have sessions setup to use cookieless methodolgy if I change it to use cookies then everything works fine... Seems like a major bug to me has anyone got any suggestions or come across a fix for this?? My guess is that the sessions filter is doing some kind of server.transfer or response.redirect and losing its state and not failing gracefully. Note that I also tried using HTTP GET methodology in my test page and I still get the same result. Many thanks in advance Best Regards Ashley Rajaratnam Ash Guest October 23rd,12:26 PM #2