Archives for ASP.NET - Page 2
Prevent URI (XSS) rewrites in asp.net
The method is well suited to check for any malformed URLs. It can be used to validate the address and the entire query newUrl = ; if (!(newUrl, )) {…
The directory ‘/App_GlobalResources/’ is not allowed because the application is precompiled
Publishing an website gives the following error.: The directory '/App_GlobalResources/' is not allowed because the application is precompiled. All you need to do, if your site is Precompiled (which will…
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 –…
Missing 4.5 IIS Application Pool, Upgrading to 4.5
Introduction If you have just upgraded to .NET for web app, you may be wondering how to ensure that your application actually is running on and not on the older…
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…
Building Rapid, Testable Web-Forms– Conclusion
Conclusion If your application relies on rich user controls (either 3rd party or your own in-house controls), WebForms may be the best option. The reports of WebForms being un-testable are…
Building Rapid, Testable Web-Forms–Comparing the MVC Framework with ASP.NET WebForms
Web Forms Web Application Advantages The old Web Forms framework is a mature framework that is being used in a lot of applications and web sites. The advantages of Web…
Building Rapid, Testable Web-Forms–Hello World with ASP.NET MVC
“Hello World” with MVC This is a simple hello world example with MVC, to help you build your first application step by ’ll create a web application with two additional…