var newRecords = [];
values: [
{
"id": 7,
"name": "Raddish",
"rate": 30,
"weight": "5",
"amountperweight": 150
},
{
"id": 8,
"name": "Peas",
"rate": 35,
"weight": "6",
"amountperweight": 210
}
]
$.ajax({
method: "post",
url: "http://localhost:36551/Orders/GenerateOrder",
data: { "values": newRecords },
dataType: "json",
success: function (response) {
},
error: function (error) {
}
});
[HttpPost]
[Route("GenerateOrder")]
[ActionName("GenerateOrder")]
public List<OrderCart> GenerateOrder(List<OrderCart> generateOrder)
{
return generateOrder;
}
Why ajax passing null or 0 value to controller?
461 Views Asked by Dani At
1
There are 1 best solutions below
Related Questions in C#
- Passing arguments to main in C using Eclipse
- kernel module does not print packet info
- error C2016 (C requires that a struct or union has at least one member) and structs typedefs
- Drawing with ncurses, sockets and fork
- How to catch delay-import dll errors (missing dll or symbol) in MinGW(-w64)?
- Configured TTL for A record(s) backing CNAME records
- Allocating memory for pointers inside structures in functions
- Finding articulation point of undirected graph by DFS
- C first fgets() is being skipped while the second runs
- C std library don't appear to be linked in object file
- gcc static library compilation
- How to do a case-insensitive string comparison?
- C programming: Create and write 2D array of files as function
- How to read a file then store to array and then print?
- Function timeouts in C and thread
Related Questions in JQUERY
- In Datatables, start value resets to 0, when column sorting
- Bootstrap modal not showing at the desired position on a web page when the screen size is smaller
- window.location.href redirects but is causing problems on the webpage
- Using JQuery Date Slider
- Storing selected language in localStorage
- How to stop other divs from still showing when i click a different button?
- Check multiple values with jQuery
- Bootstrap component does not want to render in Datatables function
- put white spaces when entering an amount moneytype symfony
- Trouble accessing custom header in AJAX response using jQuery in Fiware Keyrock
- I just cant make it work, HTML, JS and Firebase error
- Didn't declared variable still not getting any error in JavaScript
- Move element horizontally while scrolling vertically in pure JavaScript
- allow multi carousel in same page
- Embedded TikTok posts / thumbnail styling issue
Related Questions in AJAX
- window.location.href redirects but is causing problems on the webpage
- Js variable to php using ajax
- TypeError: Failed to execute 'arrayBuffer' on 'Blob': Illegal invocation - Insert blob into database
- how do I change a URL with form to include additional selection
- why i have to put extra space in before write option selected because it show error if i don't ' option:selected'
- Opening modal through Update button with specified ID using ajax
- Events disappear randomly for full calendar module
- Ajax call reloads page in FrontAccounting, a PHP ERP solution
- Add newly added record to select2 element
- AJAX query cascading dropdown in django
- Failed to load resource: the server responded with a status of 403 () - SCRIPT - WordPress
- Maintaining search and sort state across paginated results in web application
- Getting POST 500 Internal server error while sending request via ajax call
- Wordpress server side datatable filtering
- Having a problem in datatables and fullcalendar scripts
Related Questions in CONTROLLER
- godot lean mechanic makes camera glitch
- Why Jackson needs a default constructor?
- How to convert an HTML string to an escaped one?
- how to connect acb-004 controller using python
- Store files on gdrive from controller
- Laravel form action not accepting $order->id but accepting hard coded value
- Input Field Required
- Can you help a tag look at the static resource path without looking at the controller
- Reuse controller paths for a Spring Boot Controller
- How do i change a single value data into an array table in Laravel Jetstream vue stack?
- No route found in Shopware6/symfony
- Player sprite not changing when moving left or right when using a Playstation 5 Controller, but sprite changing when using keyboard controls
- problem with laravel view not extending layout.blade.php with out assets file . What can possibly be the problem?
- How apply machine learning code to ryu controller
- Nginx custom error page unexpected error reading return code: strconv.Atoi: parsing "": invalid syntax. Using 404
Related Questions in WEBAPI2
- IIS Express: Runtime library haspdnert.dll is too old (E0001)
- Web API Allow Anonymous Not Working With Web API 2
- webAPi2 Invalid cast converting JSON to structure
- Need rules/doc for casting JSON to c# class
- Recieve Bytearray in API Method
- Autofac inject different services based on HTTP request
- Problem on CORS configuration with Web Api 2, OWIN and Identity Server
- Is it possible to pass more than one complex type parameter separately in the web API 2 Controller post method?
- How to return BadRequest response with custom error model? WEB API 2
- ASP.NET Web API 2 - User Email Confirmation while registration
- Why ajax passing null or 0 value to controller?
- How to skip global actionfilter from specific methos
- how to add success key in web api json array C# web api 2
- Autofac filters for specific 'async' action in a controller not working
- WebAPI .NET - POST request filter by parameters
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
On your javascript, make sure also that newRecords is equals to the following like this before you even call the ajax post.
Your js property name does not correspond directly to your controller action's property name. On your javascript block, change your
to