LA.NET [EN]
Ramblings about C#, .NET and Programming
Browse by Tags
All Tags
»
ASP.NET
»
MVC
(
RSS
)
C#
JQuery
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
The MVC framework: the Repeater control
Mon, Mar 16 2009 11:25
Today we’re going to look at the last available control on the futures assembly: we’re talking about the Repeater control. If you’ve dealt with web forms server controls in the past, then looking at the code of the Repeater class shouldn’t make you have any “haha moment”. As you might expect, the class expands the MvcControl class and adds a couple of properties...
Read More...
More Posts
Next page »
Search
Go
This Blog
Home
Contact
About
Tags
ASP.NET
Books
C#
DDD
Design by Contract
Gadgets
Javascript
JQuery
LINQ
MS AJAX
Multithreading
MVC
NHibernate
PowerShell
S#arp
Silverlight
Software
Tools
Trivia
VS
VS 2010
WCF
WF
Windows 7
WPF
Community
Home
Blogs
Media
Groups
Archives
November 2009 (18)
October 2009 (70)
September 2009 (35)
August 2009 (52)
July 2009 (48)
June 2009 (48)
May 2009 (44)
April 2009 (39)
March 2009 (39)
February 2009 (23)
January 2009 (22)
December 2008 (18)
November 2008 (20)
October 2008 (22)
September 2008 (31)
August 2008 (3)
July 2008 (25)
June 2008 (26)
May 2008 (30)
April 2008 (5)
March 2008 (11)
February 2008 (9)
January 2008 (15)
December 2007 (10)
November 2007 (20)
October 2007 (19)
September 2007 (29)
August 2007 (12)
July 2007 (20)
June 2007 (33)
May 2007 (44)
April 2007 (28)
March 2007 (27)
February 2007 (21)
January 2007 (37)
December 2006 (8)
November 2006 (17)
October 2006 (14)
September 2006 (5)
August 2006 (7)
July 2006 (4)
Syndication
RSS for Posts
Atom
RSS for Comments
Email Notifications
Go
News
My books