CORS issue on Put

When i send a put to my Api i first get method OPTIONS and an error. It then hits my select action method again and it contains the put info. public HttpActionDescriptor SelectAction(HttpControllerContext controllerContext) { ...
more »

2017-02-14 19:02 (1) Answers

Retrieving a subset of rows from an OData endpoint

I've an ASP.NET Web API 2 exposing an OData endpoint. In the front-end I'm using ASP.NET MVC 5. To consume the endpoint I'm using a WCF Services References. The problem I'm facing is that I need to retrieve a subset of rows from the endpoint given ...
more »

2017-02-14 17:02 (1) Answers

Task.Run vs null SynchronizationContext

In an ASP.NET 4.5 application, which of these is better for calling an async method from a sync method? var result = Task.Run(() => SomethingAsync()).GetAwaiter().GetResult(); // or var temp = SynchronizationContext.Current; try { Synchron...
more »

2017-02-14 11:02 (0) Answers

Token based auth for aspnet-core web api

Dears, I've followed https://stormpath.com/blog/token-authentication-asp-net-core to authenticate the user for my web apis I managed to create a successful access-token when calling api/token My problem is the use of [Authorize], authorize filter...
more »

2017-02-13 17:02 (2) Answers

Get Filtered Datas in dataAdapter in JQXGrid

I have used JQXGrid in my application. In Initial Load, datas are retrieved from server and loaded into dataAdapter and that dataAdapter is used as source for grid. When I filter any column in the grid i need to have those filtered datas alone in the...
more »

2017-02-13 15:02 (1) Answers

ASP.Net Core Sqlite in Azure

I have a ASP.NET Core Web Application using a SQlite database. This works perfect, but now I want to host it in azure. Where should i put my *.db file? I suppose the wwwroot folder is not the best place as it can be browsable! There used to be the A...
more »

2017-02-13 10:02 (2) Answers

Redirecting to Another Controller

At the risk of sounding dumb. I am trying to redirect to an action in another controller here is my code return this.RedirectToAction("s", "profile", new { id = CleanerId }); why is it not working? "s" is the controller, "profile" is the a...
more »

2017-02-13 04:02 (2) Answers

Saving dropdown menu selection in a cookie

I saw this post - Saving dropdown menu selection in a cookie?. I got a dropdown menu which has 2 languages in it and when I press on one of them it changes the language, but the problem was, it always selects the top entry after refreshing the page. ...
more »

2017-02-12 18:02 (0) Answers

Many to Many Code first Insert New Record

i have 3 table Ads AdsCategory AdsAdsCategory when i try add new Ads, new Ads insert into Ads table and new AdsAdsCategory insert into AdsAdsCategory, but a new recored insert into AdsCategory how i can solve this problem public class Ads {...
more »

2017-02-12 12:02 (1) Answers

consuming web api, ports on different machine

my simple web app has web api and web mvc project. from mvc app I'm consuming web api service using ajax. Right now my uri looks like this var uri = 'http://localhost:2266/api/cars'; and on web api side I need to enable cors for communication wi...
more »

2017-02-11 18:02 (3) Answers

Response GZIP Compression not working .net

I need to compress json response, I have tried IIS dynamic compression and used below code to compress but compression is not working it always Content-Type:application/json; charset=utf-8, Gzip headers are properly send to server. I have tried the c...
more »

2017-02-11 08:02 (0) Answers

How do I edit from a view using a viewmodel

I have a large entity (organization), and I've broken out some of the fields into separate views with a smaller subset of fields with several ViewModels. I'd also like to use these same views if a user needs to update these fields later. I'm confus...
more »

2017-02-11 00:02 (2) Answers

Allow string ID with ASP.NET MVC route

I have the 2 following routes setup and they are working fine when a valid request is sent. config.Routes.MapHttpRoute("DefaultApiWithId", "{controller}/{id}", new { id = RouteParameter.Optional }, new { id = @"\d+" }); config.Routes.MapHttpRoute("D...
more »

2017-02-10 17:02 (1) Answers

Asp Mvc Resources Global doesn't work

this is my scenario: I have a multilanguage Asp.Net Mvc Application. Here is my localized default route: routes.MapRoute( name: "DefaultLocalized", url: "{lang}/{controller}/{action}/{id}", constraints: new { lang = @"(\w{2})|(\w{2}-\w{...
more »

2017-02-10 08:02 (1) Answers

Override UrlResolver

I've been working through the Angular 2 tutorial (in TypeScript) when I got stuck on this part. They now want to separate templates into separate files. That's fine and dandy, but I've got a quirky setup: I'm serving up the files with ASP.NET MVC, an...
more »

2017-02-09 21:02 (1) Answers