Search Posts

Category: asp.net-web-api2

Microsoft Edge Issue – The requested resource requires user authentication

I have a website and api hosted on IIS 8.5 and lately users of the site are getting the following console error when attempting to POST data to the api when using Microsoft Edge: HTTP401: DENIED – The requested resource requires user authentication. (XHR)OPTIONS – http://my-local-address/api/customers/approval/post Note: Users are authenticated by using Windows Authentication. This occurs spontaneously and to get around the issue the users are forced to do a hard refresh (Ctrl + F5) […]

Calling Web API via angularjs returns strange data format

this is my first post, my apologies if I’m a bit unorthodox. I’ve thoroughly searched for this issue, and have found plenty on angularjs and web api, but I cannot find any post the reflects the same issue I’m having. Essentially, I’ve created a web api, along with a database that is seeded upon build (MVC 5 web api project in Visual Studio 2015). I’ve included an angular controller that calls the web api, and […]

Issue with angularjs typeahead and async api call

I’ve the following implementation, html: <input id=”myField” name=”myField” class=”form-control” type=”text” placeholder=”myField” ng-model=”myController.myObj.FieldValue” typeahead-editable=”false” uib-typeahead=”item as item.Description for item in myController.fieldDS($viewValue)” required> controller: var vm = this; vm.fieldDS = myService.getFieldDS; service: function getFieldDS() { return [{‘Description’: ‘ItemA’}, {‘Description’: ‘ItemB’}, {‘Description’: ‘ItemC’}]; } And it works fine. The issue starts when I’m trying to invoke remote async api. I changed service using ngResource and I tried with following functions: function getFieldDS() { return Resource.query(); } function getFieldDS() […]

Is there anyway to configure WEB API endpoints in Single page application so that it won’t be visible to the browser’s view source?

If I am building a SPA with AngularJS and ASP.NET Web API, is there a way that the API end points are hidden, so that the end user cannot know the actual endpoint that is getting hit for a certain functionality? Like storing it in some secured container in your server so that AngularJS app can read it, but its not viewable on the view source of the client browser? Just want to know best […]

Unable to find uploaded files in HttpContext.Current.Request.Files [duplicate]

how to Unable to find uploaded files in HttpContext.Current.Request.Files [duplicate] This question already has an answer here: How to correctly attach file to formData before POSTing to server? 1 answer This question may have been asked many times already, but I couldn’t find any specific answer to my problem. Problem: can’t find already uploaded file although content length is > 0 I’m using FormData.append in client side to append my file and send the file […]

Missing or Permissive Content-Security-Policy HTTP Response Header

how to Missing or Permissive Content-Security-Policy HTTP Response Header Hi I have added some headers in IIS to remove clickjacking vulnerability in my site as per some research. These are the headers Content-Security-Policy: default-src ‘self’ X-Frame-Options: SAMEORIGIN X-XSS-Protection : 1; mode=block My client run a scan but found that it is failure. In the report it shows like this Title: Missing or Permissive Content-Security-Policy HTTP Response Header Synopsis: The remote web server does not take […]

How to Implement MVW Pattern in existing asp.net web form application

how to How to Implement MVW Pattern in existing asp.net web form application I am working on asp.net web form application which is consist of aspx(html), code behind and JavaScript code. Now we want to upgrade our application into new technology using asp.net MVW (Model View Whatever) pattern but the base line is that the new pattern should be integrated in existing web form application so that the existing old web form should work as […]

How to pass DateTime from Angular JS to HTTP GET WEB API

how to How to pass DateTime from Angular JS to HTTP GET WEB API I have Date Field and Time Field in HTML. I want to pass Datetime from Angular JS to WEB API in HTTP GET Request but I am unable to do so. HTML <label>Appointment Start Date</label> <p class=”input-group”> <input type=”text” class=”form-control” uib-datepicker-popup=”dd.MM.yyyy” ng-model=”empappt.appstart” is-open=”popup1.opened” show-button-bar=”false” /> <span class=”input-group-btn”> <button type=”button” class=”btn btn-default” ng-click=”open1()”><i class=”glyphicon glyphicon-calendar”></i></button> </span> </p> <label>Appointment Start Time</label> <input type=”time” […]

Is it safe to store token in browser local storage after web api authentication

I am building angular js 1.X application using Asp.net Web API 2 for backend. In web API 2 i can easily get Token by posting my credentials on token end point (ApplicationOAuthProvider) . Now as angular JS is client side so i need a place on client side to save this token so that i can send this token in all subsequent HTTP calls to validate client . For this i am have stored my […]

URL length exceeding when using kendo grid

When I am filtering kendo grid columns, the filters are sending as a query string to the API and the url length is exceeding the limit. I don’t want to increase the limit. So I am trying the http POST method for getting the data. Using OData with WEBAPI at the server side. We have a custom post action in the oDataController //My odata controller HTTP POST method and it is exposed in model configuration […]

Next Page »