Software Developer
Posts tagged action
Pattern for efficiently paging database rows on a web page
Jun 6th
The technique I use for paging through database rows which I’ve found works efficiently and is easy to re-use. It works well for both traditional and AJAX requests and handles sorting and filtering requirements as well. This is based on ASP.NET MVC, jQuery and NHibernate + SQL Server but the principals will be the same for other technologies.
Absolute URLs using MVC (without extension methods)
Feb 3rd
Do you need to generate absolute URLs within your MVC application? Often this will be in the form of URLs used outside of the web-browser such as those used within Atom Publishing Protocol collections or maybe links that are going to be sent out in emails. Basically, anything where the regular relative URL won’t do.
When to use RenderAction vs RenderPartial with ASP.NET MVC
Feb 21st
At first glance, RenderAction and RenderPartial both do a very similar thing – they load ‘some other content’ into the view being rendered at the place they are called. Personally, I think they should be used for different scenarios so these are my thoughts on where each one should be used and why. First though,
RenderSubAction alternative to RenderAction for Sub-Controllers in MVC
Feb 21st
The ASP.NET MVC Futures assembly contains several RenderAction extension methods for HtmlHelper to allow another action to be rendered at some point within a view. Typically, this allows each controller to handle different responsibilities rather than things being combined into the parent. So, for example, a PersonController is responsible for retrieving and assembling the model