Issue I have been posting data to a Full Audited Entity via the API. As it is FullAuditedEntity, it should automatically be created with creatorId, creationTime and a couple other column values. But when I checked in the database, CreatorUserID
Continue readingTag: asp.net-web-api
How to use caching in ASP.NET Web API?
Issue I am using ASP.NET MVC 4 with WEB API I have the following action, in the action shown below, my service method makes a db call to DoMagic() method and returns an integer value which I am then using
Continue readingSetting HTTP cache control headers in Web API
Issue What’s the best way to set cache control headers for public caching servers in WebAPI? I’m not interested in OutputCache control on my server, I’m looking to control caching at the CDN side and beyond (I have individual API
Continue readingOutput caching for an ApiController (MVC4 Web API)
Issue I’m trying to cache the output of an ApiController method in Web API. Here’s the controller code: public class TestController : ApiController { [OutputCache(Duration = 10, VaryByParam = “none”, Location = OutputCacheLocation.Any)] public string Get() { return System.DateTime.Now.ToString(); }
Continue readingAngularJS $resource DELETE item in collection
Issue I have an ASP.NET Web Api (1) controller with GET, POST and DELETE actions. I am calling this from an Angular 1.2.0 RC3 app with $resource. Let’s call the controller Foos. I do a GET that returns a list
Continue readingag-grid not loading data rows from web api output in angular2
Issue I am calling web api to get rows and then load this data in ag-grid. But grid gets initialized before the json data is returned, so not able to show. Here is my code. myComponent.component.html <ag-grid-ng2 style=”width: 400px; height:
Continue readingAngularJs, Passing optional parameters to the URL based on user input
Issue I am trying to consume my ASP.NET Web API using AngularJs. The problem is that i want to pass optional parameters to the url based on the user input(2 Html Text Boxes) but i don’t know how. This is
Continue readingUsing Angular route in webapi application
Issue I’m not sure how can I implement proper Angular routing in web api application. I’m able to open the pages using this approach: http://localhost:52876/HTML/app/borrower.html The Angular controller loads fine and all functionality is there from the angular side. Now,
Continue readingAngular 2 HTTP post to Web API without [FromBody]
Issue I have a sample Angular 2 code below. this.headers = new Headers({ ‘Content-Type’: ‘application/json’ }); this.options = new RequestOptions({ headers: this.headers }); this.http.post(‘/api/todo/create’, JSON.stringify(todo), this.options); I also have an API action as seen below (ASP.NET Core) [HttpPost] [Route(“create”)] public
Continue readingCan we pass array as parameter to Delete() action in WebAPI from jQuery Ajax call?
Issue I am using WebAPI and implemented a controller method Delete with HTTP verb as [HTTPDELETE]. Please find the syntax below: [HttpDelete] public Resonse Delete([FromBody]Guid[] input) { \\method processing } I am using RestAngular to call this method. let so
Continue readingCross Origin preflight request in Nginx Proxy
Issue Getting this error when accessing from browser Access to XMLHttpRequest at ‘https://api.example.com/users/authenticate’ from origin ‘https://example.com’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource
Continue readingWhat additional settings are needed to change Angular default port from 4200 to other numbers?
Issue I am learning asp.net core webapi and angular 13 using Visual Studio Community 2022. The solution consists of two projects with the following templates: Standalone TypeScript Angular Project Asp.Net Core Web API I did the following modifications: Changing the
Continue readingHow to pass NTLM credentials using angular http post call?
Issue I am working on localhost where angular and web api using 2 different ports that’s causing issue now. I am trying to call web api c# from angular like this this.http.post<AccessToken>(`${this.url}/api/Home/Eid/?code=12345sfffs`,{headers:this.httpHeaders}) .pipe(Response => { console.log("hi"); console.log(Response); return Response; });
Continue reading415 Content type not support when making GET request to Web API
Issue I am getting a weird issue, where one of my API endpoints is failing with 415 Content type not supported when making an GET request, which I am beating my head off the wall trying to figure out why.
Continue reading415 Content type not support when making GET request to Web API
Issue I am getting a weird issue, where one of my API endpoints is failing with 415 Content type not supported when making an GET request, which I am beating my head off the wall trying to figure out why.
Continue readingHow to implement a client_credentials grant type in an angular http request?
Issue I’ve created an OAUTH2 authorization server which uses client credentials for authentication and is responsible for the issuing of JWT tokens. When I place my request using postman I get the JWT token as expected, but when I place
Continue readingHow to implement a client_credentials grant type in an angular http request?
Issue I’ve created an OAUTH2 authorization server which uses client credentials for authentication and is responsible for the issuing of JWT tokens. When I place my request using postman I get the JWT token as expected, but when I place
Continue readingStoring data per session in asp .net core with angular front end web app
Issue I’ll start by mentioning I’m new to angular and I’m new to ASP.NET. I am working on a web app that combines pdf documents into one pdf document. The tool is an angular front end and ASP.NET core back
Continue readinghow to manage user roles and permission in a full stack application made up of angular and .net core web api
Issue Am developing a full stack web application where in client part of the app am using angular and .net core web api as the backend part of the application, am stack on how i can get the user roles
Continue readingHow to redirect a user to an external site though a POST request
Issue How to redirect a user to an external site though a POST request,which is better using backend-asp.net core web api or frontend- angular? I am working with a payment gateway. For confirming 3D secure I need to redirect the
Continue readingDoes not trigger the Web API from Angular 5
Issue I have attached my Component.ts, service.TS, AND in Web Api. Can you help me to get data from SP. I am using MVC . This is my component.ts GetComponentListForGrid() {this._componentservice.getAllComponentList(this.compartid_auto,this.progid,this.ComponentId,this.ComponentDescription,this.ComponentType, this.ComponentMake,this.EquipModel).subscribe(result => { console.log(‘GetAvailableCompartsAll’, result); this._componentList.push(…result); }, error =>
Continue readingAngular5 WebApi token authorization not working
Issue I’m trying to implement token authorization for Angular5 client and WebApi server application. I have managed to create WebApi part of the project in question and when I try to get the token via “POSTMAN” I get a good
Continue readinghow to deploy angular 5 with asp.net mvc structure on azure
Issue i have project with asp.net mvc and webApi i added angular 5 in it using this method. this works fine on localhost but when i deploy it on azure all other mvc view are working fine but the index(angular
Continue readingCan Web API get input from angular client for confirmation and continue execution?
Issue In our system we allow users to save draft data (draft table) and then user can submit that data for final save (FinalData table) whenever he wants. Now here is the case that multiple user can save draft as
Continue readingadvance search text box in angular
Issue I work on an online search project I want to make a search textbox that works like: if I want to search about a book that Joe wrote it with title my book and publisher is tia. I type
Continue readingDo I have set anything else to make Web api working?
Issue I made an asp.net core project and added a controller and the controller looks like the below. And I installed a SPA theme and the route module is as below. I run this application by executing ng server. Challenges:
Continue readingag-grid not showing any data
Issue I am using ag-grid with angularjs. so in controller I am populating rows of grid with the sql DB source. For this I am making webapi call which returns array of object. Following is the code. var module =
Continue readingRefused to display in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'
Issue I am developing a website that is supposed to be responsive so that people can access it from their phones. The site has got some secured parts that can be logged into using Google, Facebook, …etc (OAuth). The server
Continue readingIs that a best practice to host WebApi as a seperate project
Issue I am working on an Single Page Application with Web Api and Angular JS. I want to grab all the best practices for a great spa applications. I want to know that is that a best practice to host
Continue readingDifferentiate between HTTP request and Ajax request
Issue I am currently working on ASP.NET WebApi and Angularjs WebApi have a method [System.Web.Http.AcceptVerbs(“POST”)] [System.Web.Http.HttpPost] public HttpResponseMessage SearchAddress(SearchDetails searchDetail) { //13.03993,80.231867 try { if (!WebSecurity.IsAuthenticated) { HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.NotAcceptable); return response; } List<CollegeAddress> CollegeAddress = addressService.GetAddressFromDistance(17.380498, 78.4864948, 2000);
Continue readingAssertionUrl for AngularJS Application
Issue The flow of my application is that, User enter the Url and AngularJS Login page is displayed User click on Login with SAML and calls the Web API endpoint which returns the SAML login URL AngularJS UI receives the
Continue readingHttp headers passed from Angular 8 are not appearing in HttpContext in ASP.NET Core API 3.1
Issue I am passing some header values to my API call in an Angular application: httpOptions = { headers: new HttpHeaders({ "Content-Type": "application/json", "Access-Control-Allow-Origin": "*", "xibm-clientid": "Test" }) }; submitSomething(myData: IMyData): Observable<any> { return this.httpClient .post<any>(apiURL, JSON.stringify(myData), this.httpOptions) .pipe(catchError(this.errorHandler)); }
Continue readingThe 'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed
Issue I’m using Angular and ASP.NET API. The issue I’m facing: when I add CORS in the API code, it works on Internet Explorer but does not work on Chrome and Firefox. Here is the error: XMLHttpRequest cannot load http://localhost:41028/api/values/abc.
Continue readingAPI return image path but image is not showing in Angular 10
Issue My API returns the image path which belongs to the product but my angular application is not showing the image. HTML Code <ng-container *ngFor="let prod of productData"> <div class="row p-2 bg-white border rounded" style="margin-bottom: 10px;"> <div class="col-md-3 mt-1"> <img
Continue readingMy Id Key doesn't "restart" and always only increments in database during POST request
Issue I’m trying to create an application using Angular and Web API for some simple CRUD operations. I succeeded in connecting the Web API and Angular to my database, but whenever I make a POST request (even if I don’t
Continue readingMy Id Key doesn't "restart" and always only increments in database during POST request
Issue I’m trying to create an application using Angular and Web API for some simple CRUD operations. I succeeded in connecting the Web API and Angular to my database, but whenever I make a POST request (even if I don’t
Continue readingWeb API Error – This request has been blocked; the content must be served over HTTPS
Issue We have deployed the api on azure and trying to consume in our web app written in angular 5. However when we try to consume the api we are getting following errors. Chrome Mixed Content: The page at ‘https://somedevapp.azurewebsites.net/#/managesomething‘
Continue readingCannot find a differ supporting object '[object Object]' of type 'object'. NgFor Angular 9
Issue I tried so many solutions none of them are not working. please help me to solve this. I need to loop through JSON objects. below is what I tried and my JSON code. I can print the Section name
Continue readingDeleting row by id not working in Asp.net core web API + Angular 9
Issue I am trying to delete the column by passing id from Angular 9+ to ASP.NET Core Web API, but I am not able to hit in the controller. What mistake I have done here? I am using table data
Continue readingI can't add new component with angular cli in asp.net core spas
Issue I want to add a new component in asp.net core 2.0 SPAs with angular 4 with angular cli with this version: @angular/cli: 1.4.2 node: 8.4.0 os: Linux x64 when I running this command ng g c vehicle-form on a
Continue readingASP.NET WebAPI and Angular integration. Collection not found
Issue first of all, sorry for my English. I am trying to integrate an asp.net web api with Angular. At the moment I have only implemented the get method and when I call it in Angular, I always get 404
Continue readingAngular and WebApi Cors Request from origin has been blocked by CORS policy
Issue I have An angular application (angular version Angular CLI: 8.3.26 Node: 10.13.0 OS: win32 x64 Angular: 8.2.14) In environment.ts I have the link with my backend export const environment = { baseUrlNG: ‘http://localhost:4200/’, baseUrlApi: ‘http://localhost:8082/backend/api/’ } The backend is
Continue readingWhy 'src' appears in address bar in Angular App?
Issue I am learning Angular 4 with ASP.NET Web API Template in Backend. I added routing in my app. It works fine but there is redundant folder name appears in Address Bar Like this. How can I remove this? My
Continue readingangular 4 post method
Issue I am new in angular 4 web api. I want to save some data to database using angular 4 web api. When i call a GET method from angular it works fine, but not working on POST method. I
Continue readingHow to Pass data between two sibling components?
Issue <container> <navbar> <summary></summary> <child-summary><child-summary> </navbar> <content></content> </container> So, in I have a select that do send value to and . OnSelect method is well fired with (change) inside component. So, I tried with @Input, @Output and @EventEmitter directives, but
Continue readingSetup IIS Routing to allow Angular Routing to work
Issue I deployed an angular application (front-end app) in IIS server and deploy an asp.net web API application (back-end app) on another server (using different server for angular application and asp.net web API application). When I go to the angular
Continue readinghow to add a button in a table so that it will let me add new row and columns?
Issue <head> <!– Here is my code –> <h1>this form is to reserve halls</h1> <form class=”form-horizontal”> <table class=”form-group table table-bordered table-hover”> <caption>Reservation times</caption> <thead> <tr> <th></th> <th>From time</th> <th>To time</th> <th>Date</th> <th>Hall</th> </tr> </thead> <tbody> <tr *ngFor=”let date of dates;
Continue readingResponse to preflight: “No 'Access-Control-Allowed-Origin'” despite CORS-enabled
Issue I am having trouble figuring out an issue with an angular 4 preflight request not passing a CORS access-control check: “No ‘Access-Control-Allowed-Origin’”. I am able to successfully get data from the db but not able to post/save data. I
Continue readingAngular 7 multiply a value returned from web api by a number
Issue I am very new to Angular… I have a html5 meter and I want to set the low variable to a value returned from a web api by 0.25. I have the following from within my meter: low=”{{com.highlimit |
Continue readingHow to get the list of employees according to mat-radio-button click [active / inactive / all]
Issue I have a list of employee’s including (active, inactive employee’s) displayed in dashboard. So now I want to display by default only active employee’s list. If I click on Inactive radio button, then it should display only Inactive list.
Continue readingAngular 8 – Can not call webapi
Issue I am trying to get data from web api using parameter.i can’t get data.no t showing error message also. dash board component Countrymodel: Country = { country_id: ”, country_name: ”, status: false } Countries: Observable; constructor(private api: RestApiService, private
Continue readingParameters passed from angular 7 to my Asp.net core WebApi controller are all null
Issue I have this code below and I want to pass two parameters from Angular 7 app to my Asp.Net Core WebApi controller, I just don’t know the syntax for the Angular http post call to the controller. The controller
Continue readingHow do I fill a material dropdownlist in angular 7 from my c# web api?
Issue I am new to angular and trying to figure out how to bind a dropdownlist in angular from C# .NET Web API. Here is what I am doing in my application: MVC Web API Model [Table(“tblShirt”)] public class Shirt
Continue readingRouting an Angular 2 app with Web API
Issue I have an Angular 2 application created with Angular CLI. This has to call a .NET 4.6 Web API. The route setup of this is driving me nuts. For Angular, the default folder for output is /dist. Angular CLI
Continue readingFile upload issue in angular-Access to XMLHttpRequest at from origin has been blocked by CORS policy
Issue I used to upload files by using angular and web api and it all works fine with below code. But when i tried to upload .zip files it failed with below error Access to XMLHttpRequest at ‘upload’ from origin
Continue readingAngular – ERROR TypeError: Cannot read properties of undefined (reading 'message') at AuthComponent.tokenHandler
Issue I have ASP.NET Core Web API as backend and Angular-13 as frontend. When successful, the endpoint on POSTMAN gives: { "status_code": 200, "message": "Successfully Logged In", "result": { "token": "gggggffffffffffffdddddddddddd", "user": { "id": 3, "user_name": "smith", "last_login": "2022-01-03T12:35:26.0305649" },
Continue reading