Questions tagged [webmethod]

WebMethod is an attribute that is marked to indicate that a function (usually in .NET) in a web service is exposed to the consumers of the web service.

The WebMethod attribute is attached to a public method (cannot be attached to a private/protected) that you want the method exposed as part of the .NET Web service. It is also used to further configure the behavior of the method by passing additional attributes. Check out the MSDN link for more information, How to: Use the WebMethod Attribute.

1317 questions
-2
votes
1 answer

Format of JSON data

I try to get data in json format like this [{month: 'July',data: [14]}, {month: 'June', data: [3]}, {month: 'May', data: [4] }] I try this code [WebMethod] public static string summarydata() { try { …
user6628729
  • 323
  • 1
  • 7
  • 25
-2
votes
2 answers

How to get data from C# WebMethod as Dictionary<> and display response using jquery ajax?

Here is return type I want to return Dictionary where structure of classes as: Class ReportDetail { ReportID, ReportName, ReportShortName, List } Class ReportFields { SystemName, …
Kaishu
  • 377
  • 1
  • 7
  • 21
-2
votes
2 answers

How to get response from .net webservice (JSON response) method to android application

I already created Webservice in asp.net which give me JSON output but when I call that webservice from android device, it give me error. I tried below code but I getting error. LoginActivity.java public class LoginActivity extends Activity { …
Bhavesh Butani
  • 281
  • 2
  • 18
-2
votes
2 answers

"Message":"Invalid object passed in (JSON data formatting issue)

I am trying to send json to my webmethod but its showing below error. {"Message":"Invalid object passed in, \u0027:\u0027 or \u0027}\u0027 expected. (17): { \"mappingData :\"\"[\"Ref No,0\",\"Date,0\",\"Amt,0\",\"Sender Name,0\",\"Sender…
Gaurav123
  • 5,059
  • 6
  • 51
  • 81
-2
votes
2 answers

Create and add a button from WebMethod

I make a webmethod call and get an answer from the server if the current user can/can't print a document. If the user can print, I want to display a print button. Otherwise not. Is there a way to add a print button to an existing "div" from a web…
Inbal
  • 909
  • 2
  • 28
  • 46
-2
votes
1 answer

Inconsistent LinkButton PageMethod behavior in different browsers

I have a LinkButton on a page that performs a post-back, but also has an onClientClick event. The idea is to set some session variables in the background from client-side data (don't ask). I've placed a break point in the web method to step through…
LittleBobbyTables - Au Revoir
  • 32,008
  • 25
  • 109
  • 114
-2
votes
1 answer

Making a HTTP POST SOAP request with JSON

I am making a SOAP request to a web method using HTTP Post. The request and response are both JSON. But while making the POST request i am getting an error : The server cannot service the request because the media type is unsupported. This is…
ankit_rck
  • 1,796
  • 2
  • 14
  • 24
-3
votes
1 answer

Fullcalendar.io - trying to use code behind webmethod but does not fire

I see it move in the full calendar but the web method is not being called. I set a breakpoint in the code behind just to determine if anything is happening and nothing. I have tried stepping through the js part and the ajax style call. My values are…
bbcompent1
  • 494
  • 1
  • 10
  • 25
-3
votes
4 answers

Get the url parameters in php

I have a url : http://localhost:17080/SMSService/Getsms.php?to=100001&body=6260575535299&from=09350000008 ‏ and I want to get the value of "to" , "body" , "from" . how can I do this in php? Thanks a lot
-5
votes
1 answer

Operator '+' cannot be applied to operands of type 'string' and 'void' C# WebMethod

I have this link to send in gmail: "
< a href = '" + HttpContext.Current.Response.Redirect("CS_Activation.aspx?ActivationCode=",false) + "' >Click here to change your password."; When I do this code it gives me this error Operator '+'…
-5
votes
1 answer

how to use fetch api in javascript to get response from C# Web method?

Java script Code : var AllTeams; function GetAllTeams_ProductSamplePerClass() { return fetch("../Pages/Product.aspx/GetAllTeams", { method: 'POST', dataType: 'MyTeam' } ).then(response => { AllTeams =…
1 2 3
87
88