Subscribe to this Blog

Subscribe to this Blog

Stephen Walther on ASP.NET MVC

Recent Posts

6
Comments

ASP.NET MVC Tip #15 – Pass Browser Cookies and Server Variables as Action Parameters by swalther

In this tip, I demonstrate how you can pass browser cookies and HTTP server variables to controller action methods in the same way as you can pass form and query string parameters. Imagine that you make the following browser request against an ASP.NET...
Filed under: , ,
8
Comments

ASP.NET MVC Tip #14 – Create a Template Helper Method by swalther

In this tip, you learn how to create and use templates in the MVC framework that you can use to display database data. I show you how to create a new MVC Helper method named the RenderTemplate() method. While I was back home in California during the 4...
Filed under: , ,
2
Comments

ASP.NET MVC Tip #13 – Unit Test Your Custom Routes by swalther

In this tip, I demonstrate how you can create unit tests for the routes in your ASP.NET MVC applications. I show how to test whether a URL is being mapped to the right controller, controller action, and action parameters. If you are being virtuous about...
Filed under: , , ,
9
Comments

ASP.NET MVC Tip #12 – Faking the Controller Context by swalther

In this tip, I show you how to test ASP.NET intrinsics when building unit tests for an ASP.NET MVC application. I show you how to create a standard set of fake objects that enables you to fake the current user, the current user roles, the request parameters...
Filed under: , , ,
4
Comments

An Introduction to xUnit.net for ASP.NET MVC Developers by swalther

The purpose of this blog entry is to provide you with an introduction to the xUnit.net unit testing framework, the newest unit testing framework for the .NET framework. I want to demonstrate how you can use the xUnit.net framework when practicing test...
Filed under: , ,
5
Comments

ASP.NET MVC Tip #11 – Use Standard Controller Action Names by swalther

In this tip, I recommend that you use standard names for your controller actions in order to make your code more transparent to other developers. Adopting naming conventions makes your code easier to read for other developers and your future self. Naming...
Filed under: , ,
2
Comments

ASP.NET MVC Tip #10 - Prevent URL Manipulation Attacks by swalther

In this tip, Stephen Walther explains how hackers can steal sensitive information from an ASP.NET MVC website by manipulating URLs. I also discuss how you can build unit tests to prevent this type of attack by mocking the ControllerContext....
Filed under: , ,
5
Comments

ASP.NET MVC Tip #9 – Create a GridView View User Control by swalther

In this tip, Stephen Walther demonstrates how to build an ASP.NET MVC View User Control that accepts a set of database records and renders the records in an HTML table automatically. The advantage of using a View User Control is that you can customize the rendering of particular columns. ...
Filed under: , ,
10
Comments

ASP.NET MVC Tip #8 – Create an ASP.NET MVC GridView Helper Method by swalther

In this tip, Stephen Walther shows you how to extend the ASP.NET MVC framework with a new helper method that displays an HTML table of database data. ...
Filed under: , ,
6
Comments

ASP.NET MVC Tip #7 – Prevent JavaScript Injection Attacks with Html.Encode by swalther

In this tip, Stephen Walther convinces you that JavaScript Injection attacks are much more serious than you might think. I show you how to do very evil things with an ASP.NET MVC website using a JavaScript Injection attack and then I explain an easy way to prevent this type of attack. ...
More Posts Next page »