While one of my web service was running on local IIS express, everythiing was working fine, but then I was supposed to provide cross platform team to hit the servive locally in debug mode so that they find the exact reason of error. For that I tried to change IIS express to local IIS. After making changes I noticed that it started yelling Bad Request 400. Lets see who to resolve this problem as its very common scenario that anyone case face during development. Every developer should be familiar to have a work around to such type of common issues.

In this post, we will see how can we upload any file using ASP.NET Web Api Core 2.1 . We need to learn about CORS as we will see how we can enable CORS in order to accept cross origin resouce sharing.

Cross Origin Resource Sharing (CORS) is a W3C standard that allows a server to relax the same-origin policy. Using CORS, a server can explicitly allow some cross-origin requests while rejecting others. CORS is safer and more flexible than earlier techniques such as JSONP. This tutorial shows how to enable CORS in your Web API application.

Here I used code first approach of entity framework to generate the database and in that application, use jqGrid and perform the CRUD operation using jqGrid with ASP.NET MVC with async operations.

jqGrid Introduction

jqGrid is an AJAX enabled grid plugin for the java script which provides complete solutions for representing our data in the tabular format. This provides lots of features to manipulate data. Because it is a jQuery plugin it will work only on client side not on server side but for binding the data which will be on server side it can be loaded dynamically using ajax call. This is a free and open source library, which is distributed under MIT licence.