58
votes
10answers
14k views

JSONP with ASP.NET Web API

I am working on creating a new set of services in ASP.MVC MVC 4 using the Web API. So far, it's great. I have created the service and gotten it to work, and now I am trying to consume it using ...
5
votes
3answers
125 views

Restful Webservices comparison WebAPI vs MVC

I was told to design an API for a client to manipulate some data. Now, trying to keep up with the Jones', I've designed this using WebAPI. I post to my Restful Webservice an object via $.Ajax Why is ...
5
votes
1answer
655 views

How to download CSV file from ASP.NET Web Api using jQuery Ajax call

I am working on how to download CSV file from ASP.NET Web Api from jQuery ajax call. The CSV file is generated dynamically from Web API server based on custom CsvFormatter. Ajax from jQuery: ...
4
votes
5answers
221 views

AJAX & Web Api Post Method - How does it work?

I am trying to write to my database using AJAX / Jquery and c#. Whenever I pass the parameter in to the C# code it shows as null. I am using the default template that visual studio generates when ...
4
votes
1answer
178 views

jQuery tabs with MVC4 content

I'm trying to get some MVC4 views to display in jQuery tabs. Here's my code: <div id="tabs"> <ul> <li><a href="#appone">App One</a></li> ...
3
votes
2answers
8k views

ASP.NET MVC 4 Web Api ajax file upload

I am developing some sort of service using asp.net mvc 4 web api. On one form user must upload few files and then submit form to server. Problem is in ajax file upload to asp.net mvc web api. I have ...
3
votes
1answer
506 views

Passing IEnumerable parameter to WebAPI

I'm getting started with WebAPI and for the most part all is going well. I'm running into a problem with one particular function. This one differs from the other because it's only parameter is of type ...
3
votes
1answer
3k views

ASP.net WebAPI ajax GET - How to pass complex model from client to server?

I have some data "Foo" that I want to pass from the browser to the server and retrieve predicted statistics based on the information contained within foo. $.ajax({ type: 'GET', url: ...
3
votes
1answer
90 views

I am not able to post data collection from knockout to my webapi service

I am not able to post data collection from knockout to my webapi service. My knockout code: $.ajax("/api/tasks/PostTask", { data: ko.toJSON({ tasks: self.tasks }), ...
3
votes
2answers
778 views

How to Implement Separate Projects for ASP.NET MVC 4 and ASP.NET Web API

I'm working on a large ASP.NET MVC/Web API project and wanted to separate out the controllers into their own project (as described in this article ...
2
votes
3answers
2k views

ASP.NET WEBAPI file upload, issues with IE9

I have created a file upload method using ASP.NET WEBAPI, below the code: [DataContract] public class FileDesc { [DataMember] public string name { get; set; } ...
2
votes
1answer
2k views

jQuery $.ajax call to Web Api with string arrays

I am trying to call a .net Web Api method via jquery's $.ajax. When I pass in var process = "first process", var nameArray = ["first", "second"], var valueArray = ["val1", "val2"] and then: ...
2
votes
1answer
131 views

ApiController doesn't receive my DateTime?

My ApiController doesn't receive my DateTime object wrapped in a view model. Here's my controller's contents. public class FlowApiController : ApiController { // GET api/flowapi public async ...
2
votes
4answers
2k views

Sending JSON object to Web API

I am trying to figure out how I can send some information from a form to a Web API action. This is the jQuery/AJAX I'm trying to use: var source = { 'ID': 0, 'ProductID': ...
2
votes
4answers
310 views

Confused whether to used GET or POST when passing multiple parameters to action in MVC 4

I am working on MVC 4 Web Api with Jquery and Jqgrid, till now I was posting multiple data to my post controller action. My action looked like the one below... [ActionName("FetchProducts")] public ...
2
votes
1answer
82 views

Unable to retrieve custom headers on $ajax post request

I'm using a .NET Web API. For authorization i add custom tokens in the headers like this: The problem is that i am not able to retrieve the "Authorization-Token" from the response on the client ...
2
votes
3answers
389 views

Web API send multiple objects via jQuery POST

I have a Web API controller that accepts an Inspection model, i.e. public class Inspection { public int ID {get; set;} } and I have create a POST method on the controller. This works fine and I ...
2
votes
2answers
173 views

Empty parameter on a MVC 4 ApiController action

I am passing a Javascript array of a collection of strings to a post action on my apicontroller, there is a data being sent ( i know this via fiddler ) but it doesn't seem to actually get to the ...
2
votes
1answer
154 views

HTML client login by calling webapi

After spending numerous months trying to figure this out, I finally have to ask for your help. Scenario: Ajax call to webapi method passing in username and password. If user is valid, a session Id / ...
2
votes
1answer
1k views

Jquery Call to Asp.Net WebApi

Hi Have been creating an ASP.net WebApi. Currently I have used the Thinktecture.IdentityModel.40 to setup a Basic Authentication Service. When I browse to my API Url in the browser, a username and ...
2
votes
1answer
225 views

Kendo UI datasource custom transport for supporting CORS in IE 8 and IE 9

Same Origin Policy (SOP) prevents Kendo jQuery-based controls from performing CRUD operations to an API (example: ASP.NET WebAPI) on a different domain. Our javascript front-end is on a different ...
1
vote
2answers
4k views

ASP.NET WebAPI - how to pass object with $.getJSON

I've a ASP.NET WebAPI control below : public SomeObject GetBenchMarkData(Comment comment) { //do stuff } On Client side I'm trying this below: var comment = { ID: 0, ...
1
vote
1answer
1k views

Passing an JSON array to MVC Web API via GET

I know there are tons of answers for this topic, but couldn't find the solution to my issue. I have an ASP.NET MVC Web API that looks like this: [HttpGet] public IList<Country> ...
1
vote
1answer
1k views

File upload using jquery works in Firefox but not in Internet Explorer

This javascript code $(document).ready(function () { var uploader = new qq.FileUploader({ element: document.getElementById('file-uploader'), action: ...
1
vote
1answer
344 views

jQuery 'POST' being seen as 'GET' in ASP.NET Web API beta

I am sending a 'POST' request to a web API controller - "/api/customers". However, checking the request object is showing a 'GET' request instead. $.ajax({ url: "/api/customers", type: ...
1
vote
3answers
282 views

jQuery put with WebApi - Not even calling the Controller method

Sorry to ask a question about this so soon after asking another question but I'm now struggling with the PUT. I have a jQuery method which collects the data and passes it to a PUT function in the ...
1
vote
1answer
375 views

ASP.Net Web Api in separate web app or not?

I want to use an ASP.Net Web API to access using JQuery AJAX. The Web API should have authorized and unauthorized methods. When integrating the Web API inside the existing MVC project, it works out of ...
1
vote
3answers
60 views

POST Json to MVC Controller - No action was found on controller

I've got the following AJAX request: var recordToRevert = $(this); var umbrellaId = $(this).data("id"); var requestData = { umbrellaId: umbrellaId, }; $.ajax({ url: ...
1
vote
2answers
74 views

aspmvc post datetime with json error

When i post a DateTime with Json i have the following error: Error 500 Can't cast object of type "System.DateTime" to type "System.Array". I don't understant why ! Can you help me please ? the ...
1
vote
1answer
151 views

Latest Web API + Cors Fail

I'm getting really frustrated with jsonp or cors etc. jsonp results on jquery thinking it's an error if it's just a status code that comes back, and no body. It also thinks that an error code coming ...

1 2 3 4
15 30 50 per page