Archives for ASP.NET MVC
Using Asynchronous methods in .NET–Quick Notes
I developed these notes just as a way to keep myself sane while writing Async methods in C#. Quick Recap - Two types of threads for an programmer 1. Regular…
Rendering PDF in a modal popup – asp.net mvc
Recently, I had to display a PDF (a pdf report, sent to my app as a byte stream) in a popup window. In MVC, using bootstrap, I was able to…
MetadataException: Unable to load the specified metadata resource
When you move your data layer to another project or another folder - you may encounter the following exception MetadataException: Unable to load the specified metadata resource The Solution: The…
MVC apps–set as start page
Of course, MVC does not have the concept of a web page – it is more a web view. The view cannot be accessed directly (unlike a page) – and…
Windows (AD) Authentication and the Authorize Attribute–Login Popup
The attribute kept throwing a 'login' popup even though the user was logged in via windows problem is that the attribute uses the following line to determine if a user…
Custom authentication filter in ASP.NET MVC
First, I approached this by trying to implement the IAuthorizationFilter interface. THis provides an OnAuthorization method that can be implemented for your custom authentication (see example below). However, as I…
Async Await in Web API Controller
Introduction In WebAPI (part of mvc 4), controllers are view-agnostic. They do not return data to a view – rather they return pure, formatted data (either JSON or XML –…
Using CSS Templates with ASP.NET MVC
Find a CSS layout that you like – one good source is In your MVC solution, in the shared views folders, there should be a file. This file contains razor…