Subscribe to this list via RSS Blog posts tagged in asp.net mvc

Posted by on in Blogs
ASP.NET MVC TempData Is Really RedirectData Update: This post was written for MVC 1. TempData behaves completely differently in MVC 2 Beta and higher. In these versions, TempData is cleared only when it is read (or when the session expires). Many people seem to be confused about the TempData feature in ASP.NET MVC. TempData behaves like the ViewData dictionary, except that it persists until the next request from the same browser. Because of this, TempData should only be used when you know exactly what the next request is going to be...

Posted by on in Blogs
Lightweight Frameworks, Again A couple weeks ago, I wrote a post noting that I liked the lightweight nature of the Ruby web framework Merb. Today comes the news that Merb and Rails will be merging in Rails 3. People who see Merb as the "anti-Rails" seem to find this surprising. But people who see Merb as "Rails done right/better" are enthusiastic about it. It's hard to blame the developers for being more interested in pleasing the latter group. When you read through the list of "What Does That Mean, Exactly?" at this link, I...

Posted by on in Blogs
Lightweight Frameworks I came across this interview with Yehuda Katz about Merb, an interesting web framework for Ruby.  Although I have less actual experience with Merb than with Rails, I've always liked the general design philosophy of Merb. Whereas Rails appears to be designed as a complete MVC framework (and a nice one, too; I'm not writing this post to critique Rails), Merb allows you to build your own framework by combining existing tools. It doesn't try and reinvent a new ORM or package manager, for example. Li...

Posted by on in Blogs
Generics: Not Just for Lists It appears that the next version of Delphi, code-named Tiburón, will include support for generic types in the Win32 compiler.  Developers without .NET experience may not be familiar with use cases for generics.  Of course, generics work really well for typed containers, and this is often the first example that people give as a use case.  But they have many other uses as well.  I'll give a few examples; I hope this will help Delphi developers think about how they might want to use the feature in ...

Posted by on in Blogs
Alternate View Folders in ASP.NET MVC Stephen Walther recently posted a tip on how to load an ASP.NET MVC View from a folder other than Views\{controller}\ or Shared. He notes that it's possible to hardcode the path to a View in your Controller action.  He also states that you should not do this: Now, I want to be the first to warn you that you should never, never, never use this tip (Please delete this entry from your news aggregator immediately). There is a good reason for following the conventions inherent in an MVC application....

Posted by on in Blogs
Moq and MvcMockHelpers I'm working on some unit tests for an ASP.NET MVC application I'm developing.  One of the tests ensures that if I construct a URL using Html.ActionLink that the URL which is returned, when fed into the routing system, becomes a correct representation of the route data used to build the URL originally.  I'll discuss this further in a future post, but today I'm going to talk about Moq. Unfortunately, this type of testing requires more mocking than you'd really prefer, despite the significant impro...

Posted by on in Blogs
ASP.NET MVC Membership One of my disappointments with Ruby on Rails is that it provides no support whatsoever for site logins/membership, which I consider to be a fundamental part of many database-driven websites. Of course, the Rails community has responded — and responded, and responded, and responded — to this need. The Rails wiki notes that there are about a "gazillion" different systems for solving this problem in Rails. I've tried acts_as_authenticated, which does work, but, at least at the time I tried it, req...

Posted by on in Blogs
Updating an ASP.NET MVC App to Preview 2 There's a whole lot of ground not covered in the official update instructions. The MVC Web UI helpers are now in the framework. But they've changed quite a bit. So you must: Remove the assembly from your project. UpdateFrom is no longer an extension method. It's now a static method in System.Web.Mvc.BindingHelperExtensions. So you have to change anywhere you called that. Just to keep you on your toes, System.Web.Mvc.BindingHelperExtensions will probably be renamed soon. RedirectToAc...

Check out more tips and tricks in this development video: