Posts

Showing posts with the label asp.net-web-api

How can we populate jsGrid with stored procedure?

Image
Clash Royale CLAN TAG #URR8PPP How can we populate jsGrid with stored procedure? I have to populate jsgrid with result returned by stored procedure. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

DelegatingHandlers not executing when routes not defined

Image
Clash Royale CLAN TAG #URR8PPP DelegatingHandlers not executing when routes not defined I am working on a WebAPI 2 project which currently uses attribute-based routing exclusively, to the point that there are no routes defined in registration, and everything is working as expected. However, I am now adding a DelegatingHandler to provide a heartbeat that I can ping with a HEAD request: DelegatingHandler public class HeartbeatMessagingHandler : DelegatingHandler { protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) { if (IsHeartbeat(request)) { if (request.Method == HttpMethod.Head) { var response = new HttpResponseMessage(HttpStatusCode.NoContent) { Content = new StringContent(string.Empty) }; var task = new TaskCompletionSource<HttpResponseMessage>(); task.SetResult(response); return task.Task; ...

routing in iis 8.5 for mvc and webapi apps

Image
Clash Royale CLAN TAG #URR8PPP routing in iis 8.5 for mvc and webapi apps I am running windows 8 IIS 8.5. I created my site on IIS and created another site in a directory below for my webapi service So my site looks like this: www.mysite.com www.mysite.com/api // this exists on disk in a directory called api below the site dir. Configured in IIS as a site not a virtual dir. Of course iis is unable to implement routing for either site. ww.mysite.com works if I add /index.html. If I type www.mysite.com into browser I get a 404. The api site simply gives me 404 errors no matter what I do. Both sites work perfectly fine when running in visual studio. www.mysite.com is a mvc 5 application www.mysite.com/api is a webapi 3 application. Some questions such as this one: ASP.NET 4.5 MVC 4 not working on Windows Server 2008 IIS 7 recommend <modules runAllManagedModulesForAllRequests="true" /> which does not work and is suboptimal even if it did work. Other problems others hav...