c# - jquery Ajax responsetext "There was an error processing the request" -


I am getting this error "There was an error processing the request" < / Strong> In my local environment, the code starts working properly

This line Utility. WrightLogEvent ("TestService", strmessage); Anyway, if this line has failed or not, I should still be able to receive messages coming from the server because it is handled properly.

But since I did not get any feedback from the server, it means that my webmath is not accessible.

Given that the code below works, do I need to set something in the Web to do such a thing? Config? Or can I start inspecting the IIS, which can give me some clues?

Thank you.

  $ ('# lnkTest'). Click (function ('click event firing!'); $ .ajax ({type: "post", url: "/_layouts/ServiceForm.aspx/TestService", data: "{}", Datatype: "Jason", Content Type: "Application / Jason; Charset = UTF-8", Success: Work (Response) {If (reaction D & amp; Response D. Lang and gt; 0) {alert (feedback); }}, Error: work (Xhr, err) {warning ('response text:' + xhr.responsetext);}});});   

Here is my C # web method

  [WebMethod] public static string TestService () {string strMessage = string.Empty; Try {strMessage = "service is running."; Utility. WrititeLogEvent ("TestService", strmessage); } Hold (exception before) {strMessage = "TestService failed."; } Return stromas; } When calling a Webmath with the parameter,    

Make sure no logic is empty because it throws the same error without a proper error. Provide a solution to prevent empty logic from clearing the method on the client side. Maybe a if statement .

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -