Browse by Tags

SerialSeb’s MVC best practices
Fri, May 8 2009 9:42
I’ve just finished seeing Sebastien Lambla ’s (aka SerialSeb ) MVC best practices presentation . It’s cool and I’m recommending it (especially if you’re new – and, of course, if you have the time for it). I’m in favor of most of his recommendations (the only that I don’t really agree is the code-behind rule -  as I said, I understand that most people shouldn... Read More...
by luisabreu | with no comments
Filed under:
MVC Action filter project on Codeplex
Tue, Apr 28 2009 10:46
Roni Schuetz informed me of a new Codeplex project he created for building a common library of ASP.NET MVC action filters. If you’re into MVC and you’d like to contribute, then check it out . Read More...
by luisabreu | with no comments
Filed under: ,
The MVC framework: the ActionLink control
Mon, Apr 13 2009 21:43
Ok, so today I’ve finally updated my local copy of the MVC source code (which I’m doing through my preferred SVN client) and lo-and-behold: new stuff to talk about in the MVC futures source code! Today we’re going to talk about the ActionLink control. As you might expect (from the name), this is a really simple control which extends the base MvcControl. Currently... Read More...
by luisabreu | 3 comment(s)
Filed under: ,
The MVC framework: the AcceptAjaxAttribute
Thu, Apr 9 2009 0:01
There might be some scenarios where you have methods that should only be invoked for AJAX requests. In those cases, you can use the AcceptAjaxAttribute to decorate those methods. This is an ActionMethodSelectorAttribute which overrides the IsValidForRequest and delegates all its work to the Request.IsAjaxRequest extension method. When you’re not in an AJAX request... Read More...
by luisabreu | with no comments
Filed under: ,
The MVC framework: setting a timeout
Tue, Apr 7 2009 21:58
In the last posts, we’ve taken a look at how we can add asynchronous action to a controller. Today, we’re going to dig a little deeper and see how we can specify a timeout that limits the maximum amount of time that the asynchronous operations can take to complete. By default, you inherit a default timeout: all actions must complete under 30 seconds (as you can... Read More...
by luisabreu | with no comments
Filed under: ,
The MVC framework: the RequireSslAttribute
Mon, Apr 6 2009 22:00
The RequireSslAttribute is a filter attribute which you can apply to a class or method and which is responsible for overriding the OnAuthorization method and seeing if the current request is being done over SSL. The filter exposes a single property, called Redirect. When it detects that the current request is not under SSL, it checks the Redirect property: if... Read More...
by luisabreu | 3 comment(s)
Filed under: ,
The MVC framework: the “delegate” pattern for asynchronous actions
Sun, Apr 5 2009 22:13
This is the last post in the asynchronous action pattern series. In this post, we’re going to present the (so called) “delegate” pattern. This is really similar to the “event” pattern. The difference is that, in this case, we return a parameterless delegate from our begin method which will be called when all the asynchronous operations end. To illustrate this... Read More...
by luisabreu | 2 comment(s)
Filed under: ,
The MVC framework: simplifying the “event” pattern
Sun, Apr 5 2009 22:01
In the previous post , we’ve taken a look at the “event” pattern. In this post, we’re going to see how we can simplify the needed code for using this pattern. The AsyncManager exposes a RegisterTask method which simplifies the needed code when we decide to use this pattern. We’ll improve the previous example by using this method. Here’s the code: public void... Read More...
by luisabreu | 3 comment(s)
Filed under: ,
The MVC framework: the “event” pattern
Sun, Apr 5 2009 21:37
Today we’re going to keep looking at the MVC framework and we’ll see how we can use the “event” pattern for invoking an action asynchronously. This pattern is really simple. You start by adding two methods: the first is responsible for kicking off the asynchronous processing and the second will be called when all the asynchronous actions complete (as you’ll see... Read More...
by luisabreu | 2 comment(s)
Filed under: ,
The MVC framework: the IAsyncResult pattern
Thu, Apr 2 2009 22:19
In this post we’re going to keep looking at the asynchronous features introduced by the MVC futures and we’ll see an example of how to use the IAsyncResult pattern for adding an asynchronous action to a controller. The idea is simple: you need to add two methods with the following signatures: public IAsyncResult BeginActionMethod(Int32 id, AsyncCallback callback... Read More...
by luisabreu | 1 comment(s)
Filed under: ,
The MVC framework: invoking actions asynchronously I
Thu, Apr 2 2009 19:34
As we’ll see, the MVC futures assembly adds several classes which help you in executing asynchronous actions. In this post, we’ll take a quick look at the infrastructure code needed to start adding asynchronous actions to your controllers. As you’ll that it would be good to make a small incursion into the internals that support asynchronous requests in the MVC... Read More...
by luisabreu | 2 comment(s)
Filed under: ,
Asynchronous controllers in MVC
Thu, Apr 2 2009 8:40
In these last days I’ve been busy with the source code of the futures assembly. I’ve already written one post (not published yet) and was planning on writing a couple more of them that showed how to use the asynchronous features introduced by the future bits. Well, it seems like my posts have just become redundant (though I’ll probably publish them anyway) because... Read More...
by luisabreu | 13 comment(s)
Filed under: ,
The MVC framework: the ContentTypeAttribute attribute
Fri, Mar 27 2009 0:07
Another short post on the features available on the MVC futures assembly…today, we’re going to take a look at the ContentTypeAttribute. This attribute is an action filter attribute and you can use it to setup the content type of the current response (ie, you can apply this attribute to an action method to influence the value of the ContentType property of the... Read More...
by luisabreu | with no comments
Filed under: ,
The MVC framework: pay one take several
Wed, Mar 25 2009 23:12
Ok, not really! It’s still free…today I didn’t really had the time to dig into the stuff I wanted to investigate. So, I’ll just present several interesting topics about the MVC futures assembly: Binders: the MVC future has some offers in this area. Let’s start with the ByteArrayModelBinder. This binder will recover a byte array from an existing field (as you... Read More...
by luisabreu | with no comments
Filed under: ,
The MCV framework: view extensions
Tue, Mar 24 2009 23:17
Ok, here we are again for another episode on the inner workings of the MVC futures assembly. Today, we’re going to take a look at the HtmlHelper extension methods defined on the ViewExtension class. The current release of this class introduces two (static extension) methods which you can use to execute an action “in-place” during the current request: RenderRoute... Read More...
by luisabreu | 1 comment(s)
Filed under: ,
The MVC framework: maintaining TempData on cookies
Mon, Mar 23 2009 23:14
A few months back, we’ve seen how TempData is implemented and how it should be used. Today we’re going to keep looking at the future assembly and we’ll take a look at the CookieTempDataProvider class. The class implements the ITempDataProvider interface and you can use it it you intend to persist the temp data dictionary in cookies instead of relying in the traditional... Read More...
by luisabreu | 1 comment(s)
Filed under: ,
The MVC framework: more on the future’s helpers
Sun, Mar 22 2009 22:54
Ok, so in the previous posts I kept talking about some of the helpers available on the future assembly. In this short post we’re going to complement that information with some more methods that let you expressions for specifying form actions (yes, this can be seen as form extensions , part III). The future assembly introduces 2 new extension methods with these... Read More...
by luisabreu | with no comments
Filed under: ,
The MVC framework: the Button helper
Sun, Mar 22 2009 15:05
Today we’re going to keep looking at other helps available on the future assembly. The topic for today is: ButtonBuilder and using the available extension methods for adding HTML button type elements to the page. We’re going to start looking at the functionalities available on the ButtonBuilder class (keep in mind that you won’t probably be calling these methods... Read More...
by luisabreu | 6 comment(s)
Filed under: ,
The MVC framework: more on links
Sat, Mar 21 2009 23:55
Ok, now that codeplex is up again, I’ve already downloaded the latest bits for the ASP.NET MVC framework. In the past, we’ve already seen that there are several helpers for generating links for specific actions. As we’re going to see today, the future assemblies adds more ActionLink extension method helpers that let you specify the url of an anchor in a strongly... Read More...
by luisabreu | 3 comment(s)
Filed under: ,
The MVC framework: working with uploaded files
Tue, Mar 17 2009 11:43
Today we’re going to keep looking at the futures assembly. In a previous post , we’ve seen how we can easily return a file from an action method. Today, we’re going to take a look at how we can use the FileCollectionModelBinder to get access to a group of files that have been uploaded to the server. The first thing you need to do when you want to use this binder... Read More...
by luisabreu | 1 comment(s)
Filed under: ,
More Posts Next page »

Search

This Blog

Tags

Community

Archives

Syndication

Email Notifications

News




  • View Luis Abreu's profile on LinkedIn


    Follow me at Twitter

    My books

    Silverlight 4.0: Curso Completo

    ASP.NET 4.0: Curso Completo

    Portuguese LINQ book cover

    Portuguese ASP.NET 3.5 book cover

    Portuguese ASP.NET AJAX book cover

    Portuguese ASP.NET AJAX book cover