Tag: CSharp
All the articles with the tag "CSharp".
-
ASP.NET MVC framework preview 3 released!
Don't know how I do it, but I think this blog post is yet again the first one out there mentioning a new release of the ASP.NET framework (preview 3) The official installation package can be downloaded from the Microsoft site. Source code is also available from CodePlex. Update instructions from preview 2 to preview 3 are contained in the download. If you created a project based on the "preview-preview" version, here's what you'll have to update:
-
Creating a custom ViewEngine for the ASP.NET MVC framework
Have you ever seen a presentation of ScottGu about the ASP.NET MVC framework? There is one particular slide that keeps coming back, stating that every step in the ASP.NET MVC life cycle is pluggable. Let's find out if replacing one of these components is actually easy by creating a custom ViewEngine and corresponding view. After a route has been determined by the route handler, a Controller is fired up. This Controller sets ViewData, which is afterwards passed into the ViewEngine. In short, the ViewEngine processes the view and provides the view with ViewData from the Controller. Here's the base class: [code:c#] public abstract class ViewEngineBase { public abstract void RenderView(ViewContext viewContext); } [/code]
-
ASP.NET MVC custom ActionResult (ImageResult)
The ASP.NET MVC framework introduces the concept of returning an ActionResult in Controllers since the "preview preview" release on CodePlex. The purpose of this concept is to return a generic ActionResult object for each Controller method, allowing different child classes returning different results. An example ActionResult (built-in) is the RenderViewResult. Whenever you want to render a view, you can simply return an object of this class which will render a specific view in its ExecuteResult method. Another example is the HttpRedirectResult which will output an HTTP header (Location: /SomethingElse.aspx).
-
New Team Foundation Server projects on CodePlex!
Busy times... Lots of work, some holidays here in Belgium, ... But there's always time to browse CodePlex! It is actually a good thing to do that from time to time. In the past few days, I spotted two great new projects on Team Foundation Server. Thumbs up for their authors! "Use this Visual Studio Add-In to leverage Team System and the Visual Studio code object model for in-IDE code review feedback, demonstration, and review replay. The inspiration for this project are the many code reviews we've experienced that have been generally underwhelming experiences and less than optimal outcomes. To make code review less painful, and to greatly assist in distributed environment code reviews this project will add Code Review squarely into the VS.Net Team System tools."
-
ASP.Net MVC Membership Starter Kit alternative authentication
Last week, I blogged about the ASP.Net MVC Membership Starter Kit and some of its features. Since then, Troy Goode and I are developing at warp-speed to provide a complete (Forms)Authentication starter kit for the MVC framework. Scott Guthrie also noticed our efforts, which forced us to do an official release earlier than planned. Now when I say warp-speed, here's what to think of: we added Visual Studio item templates, a nice setup program, a demo application, ... We started with FormsAuthentication, but we have evolved into some alternatives... You can add a route to the OpenID login action, and have an out-of-the box OpenID login form: Simply enter your OpenID URL, click login. The MVC Membership Starter Kit will handle the rest for you!
-
ASP.Net MVC Membership Starter Kit
Yesterday, I read a cool blog post from Troy Goode about his new CodePlex project MvcMembership. I also noticed his call for help, so I decided to dedicate some of my evening hours to his project. Almost every (ASP.NET) website is using some form of authentication, in most cases based on ASP.NET membership. With this in mind, Troy started an ASP.NET MVC version of this. The current release version provides a sample application containing some membership functionality: After an evening of contributing code, there's additional functionality in the source control system:
-
ASP.NET MVC Framework out on CodePlex
This morning, I was browsing the new projects page on CodePlex and noticed something nice! The ASP.NET MVC team already rumoured around making the ASP.NET MVC framework source code available on CodePlex, but here it is: the ASP.NET MVC project on CodePlex. The CodePlex project does not allow people to make their own contributions, but you can easily look under the hood or fix bugs for your production environment. How cool is that! Happy coding! Update 4:45 PM: Seems like I've stolen the thunder from Scott Guthrie :-) To be complete: the official announcement was made a little bit later than my unofficial announcement. You can read about it here.
-
ASP.NET MVC - Testing issues Q and A
When playing around with the ASP.NET MVC framework and automated tests using Rhino Mocks, you will probably find yourself close to throwing your computer trough the nearest window. Here are some common issues and answers: A: When testing a controller action which expects Request.Form to be a NameValueCollection, a NullReferenceException is thrown... This is due to the fact that Request.Form is null. Use Scott's helper classes for Rhino Mocks and add the following extension method: [code:c#] public static void SetupFormParameters(this HttpRequestBase request) { SetupResult.For(request.Form).Return(new NameValueCollection()); } [/code]
-
March 18 ASP.NET MVC links
Too busy this week to write large blog posts myself... Luckily other people do write interesting things on ASP.NET MVC! Happy coding!
-
Heroes happen here - Microsoft TechDays 2008 in Belgium
Just to inform you: together with a numer of colleagues from Dolmen, I'll be attending the Microsoft TechDays 2008 in Ghent, Belgium on 12 and 13 March 2008. Want to spot me, Joris, Jeroen, Danny, ... and meet in person? Search for one of the guys in a Dolmen shirt! Update 17/03/2008: Jeroen posted an overview of the inspiring sessions on his blog.