Gunnar Peipman's ASP.NET blog
ASP.NET, C#, SharePoint, SQL Server and general software development topics.
-
ASP.NET MVC 3: Using HttpNotFoundResult in controller tests
Lately I blogged about HttpNotFoundResult and HttpStatusCodeResult action results that come with ASP.NET MVC 3. These results are ideal for controller tests as we don’t have to mess with HttpContext and Response objects anymore. In this posting I will show you how to use HttpNotFoundResult in controller tests to check if errors are given correctly to user.
-
ASP.NET MVC 3: Introducing Razor view engine
ASP.NET MVC 3 brings us new view engine called Razor. Razor view engine was made available with WebMatrix first beta. Razor brings us new and very short syntax for writing views. In this posting I will introduce you shortly ASP.NET MVC Razor view engine.
-
ASP.NET MVC 3: Global action filters
ASP.NET MVC 3 supports global action filters. Global action filters are applied to all actions in web application. By example, you can use global action filters for common security checks. In this posting I will show you how to write dummy action filter, register it as global and test it.
-
Example: Creating workflow to request songs from radio station
Today I played with WF 4.0 declarative workflows. This posting shows you simple workflow that you can extend to add songs to online radio station queue. My main focus here is workflow and I will provide here no logic for actual queue implementation. You can find here also Visual Studio 2010 sample solution.
-
There is no context attached to the incoming message for the service and the current operation is not marked with "CanCreateInstance = true"
I got this error when testing my example WF 4.0 workflow that runs on WCF. To get over this error just open your workflow, select Receive activity and make check to checkbox called CanCreateInstance (click on image at right to see it at original size).
-
ASP.NET MVC 3: Using multiple view engines in same project
One of nice features of ASP.NET MVC 3 is support for multiple view engines. There will be two out-of-box view engines: one for classic ASPX-based views and one for Razor-based views. In this posting I will show you this new feature and demonstrate how to use different view engine in same project.
-
ASP.NET MVC 3: Creating HttpStatusCodeResult with view based body
My last posts described new action results in ASP.NET MVC 3 – HttpNotFoundResult and HttpStatusCodeResult. Unfortunately these result have no body to send to client but there are times we need it to inform our visitor about problems the way that we don’t go out of information context where visitor is. In this example I will show you how to write your own HttpStatusCodeResult that has also body.
-
ASP.NET MVC 3: Using HttpStatusCodeResult
ASP.NET MVC 3 also introduces new action result HttpStatusCodeResult. This action result provides you way how to specify HTTP status code and status description in your controllers. In this posting I will show you how to use HttpStatusCodeResult in your real-world applications providing meaningful status code for products that were online once but are now gone and we don’t expect them to be back in future.
-
Overview of my MVP year
Another MVP year is over. Today I sent my activity report to my MVP lead and in October it should be clear if my MVP will be continued or not. I hope it will continued, of course. Now it is time to make one little overview about my MVP year that just ended in terms of public activities. It was year full of action and interesting people – something that is hard to forget. You should be proud too – without you there is no MVP program, this blog and many other things. So, feel yourselves as part of action!
-
ASP.NET MVC 3: New ViewModel is dynamic ViewData
ASP.NET MVC 3 introduces new ViewModel property of Controller that you can use to assign different properties to the model of your view. ViewModel is dynamic by type. In this posting I will show you how to use ViewModel property in your ASP.NET MVC applications.