<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>Jarred Nicholls</title>
    <description>.NET, RoR/Merb, iPhone, ExtJS, &amp; more</description>
    <link>http://www.jarrednicholls.com/</link>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>BlogEngine.NET 1.4.0.0</generator>
<language>en-US</language><blogChannel:blogRoll>http://www.jarrednicholls.com/opml.axd</blogChannel:blogRoll><dc:creator>Jarred Nicholls</dc:creator><dc:title>Jarred Nicholls</dc:title><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/JarredNicholls" type="application/rss+xml" /><feedburner:browserFriendly></feedburner:browserFriendly><item><title>Ext.tree.MultiSelectionModel Doesn't Unselect</title><description>&lt;p&gt;
The Ext.tree.MultiSelectionModel handles multiple selections very well by utilizing the well known Ctrl+Click action to do multiple selections of tree nodes.&amp;nbsp; However, doing Ctrl+Click on an already selected node does not unselect it, which is quite unintuitive to the Ctrl+Click action.&amp;nbsp; To add this behavior, simply override the private onNodeClick method of the MultiSelectionModel class:
&lt;/p&gt;
&lt;p&gt;
&lt;div class="codeSnippet"&gt;
	&lt;div class="codeHeader"&gt;
		&lt;img src="http://blog.furred.net/pics/page_white_code.png" /&gt;
		&lt;a href="" onclick="document.getElementById('snippet_2104').style.display = document.getElementById('snippet_2104').style.display == 'none' ? 'block' : 'none'; return false;"
		title="Click for expanding.."&gt;JavaScript-Code: &lt;/a&gt;
	&lt;/div&gt;
	&lt;pre id="snippet_2104" class="codeContainer"&gt;Ext.override(Ext.tree.MultiSelectionModel, {
&amp;nbsp;&amp;nbsp;&amp;nbsp; onNodeClick: &lt;span style="color:#0000FF"&gt;function&lt;/span&gt;(node, e){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000FF"&gt;if&lt;/span&gt; (e.ctrlKey &amp;amp;&amp;amp; &lt;span style="color:#0000FF"&gt;this&lt;/span&gt;.isSelected(node))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000FF"&gt;this&lt;/span&gt;.unselect(node);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000FF"&gt;else&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000FF"&gt;this&lt;/span&gt;.select(node, e, e.ctrlKey);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
});&lt;/pre&gt;
&lt;/div&gt;
&lt;script type="text/javascript"&gt;
	document.getElementById('snippet_2104').style.display='none';
&lt;/script&gt;
&lt;/p&gt;
</description><link>http://www.jarrednicholls.com/post/2008/08/19/ExttreeMultiSelectionModel-Doesnt-Unselect.aspx</link><author>jarred.nicholls.nospam@nospam.gmail.com (jarred)</author><comments>http://www.jarrednicholls.com/post/2008/08/19/ExttreeMultiSelectionModel-Doesnt-Unselect.aspx#comment</comments><guid>http://www.jarrednicholls.com/post.aspx?id=efd0a030-3d7c-4a0a-a5bc-d2b66bbfe20d</guid><pubDate>Tue, 19 Aug 2008 09:38:00 -1000</pubDate><category>ExtJS</category><dc:publisher>jarred</dc:publisher><pingback:server>http://www.jarrednicholls.com/pingback.axd</pingback:server><pingback:target>http://www.jarrednicholls.com/post.aspx?id=efd0a030-3d7c-4a0a-a5bc-d2b66bbfe20d</pingback:target><slash:comments>2</slash:comments><trackback:ping>http://www.jarrednicholls.com/trackback.axd?id=efd0a030-3d7c-4a0a-a5bc-d2b66bbfe20d</trackback:ping><wfw:comment>http://www.jarrednicholls.com/post/2008/08/19/ExttreeMultiSelectionModel-Doesnt-Unselect.aspx#comment</wfw:comment><wfw:commentRss>http://www.jarrednicholls.com/syndication.axd?post=efd0a030-3d7c-4a0a-a5bc-d2b66bbfe20d</wfw:commentRss></item><item><title>ColumnTree - Headers Always Up Top</title><description>&lt;p&gt;
A popular user extension to ExtJS, Ext.tree.ColumnTree (originally just a demo), suffers from a few lacking features.&amp;nbsp; These features include: 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Header isn&amp;#39;t anchored at the top&lt;/li&gt;
	&lt;li&gt;Cannot resize column width&lt;/li&gt;
	&lt;li&gt;Cannot reorder columns&lt;/li&gt;
	&lt;li&gt;Cannot click headers for sortability&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Because all of these features are found in the GridPanel, people have grown to love these features, and thus expect them in any column-based data layout.&amp;nbsp; There is a user extension named TreeGrid, rumored to be adopted as a part of the Ext widget library, that provides these features.&amp;nbsp; However, the extension is currently a little immature, and is more geared to being a Grid than it is to being a Tree (if that makes any sense?).&amp;nbsp; So in the meantime, while it&amp;#39;s being matured, I extended the ColumnTree to at least have an anchored column header bar, and will perhaps add the other features in the near future. 
&lt;/p&gt;
&lt;p&gt;
Another small edition is that I have added the xtype registration of &amp;#39;columntreepanel&amp;#39;, so you can create the ColumnTree via an xtype config object, rather than its constructor. 
&lt;/p&gt;
&lt;p&gt;
&lt;a rel="enclosure" href="http://www.jarrednicholls.com/file.axd?file=ux-columnnodeui.js"&gt;ux-columnnodeui.js (4.46 kb)&lt;/a&gt;
&lt;/p&gt;
</description><link>http://www.jarrednicholls.com/post/2008/08/19/ColumnTree-Headers-Always-Up-Top.aspx</link><author>jarred.nicholls.nospam@nospam.gmail.com (jarred)</author><comments>http://www.jarrednicholls.com/post/2008/08/19/ColumnTree-Headers-Always-Up-Top.aspx#comment</comments><guid>http://www.jarrednicholls.com/post.aspx?id=f3526e15-d897-497a-acd5-daa91ddff68a</guid><pubDate>Tue, 19 Aug 2008 08:30:00 -1000</pubDate><category>ExtJS</category><dc:publisher>jarred</dc:publisher><pingback:server>http://www.jarrednicholls.com/pingback.axd</pingback:server><pingback:target>http://www.jarrednicholls.com/post.aspx?id=f3526e15-d897-497a-acd5-daa91ddff68a</pingback:target><slash:comments>0</slash:comments><trackback:ping>http://www.jarrednicholls.com/trackback.axd?id=f3526e15-d897-497a-acd5-daa91ddff68a</trackback:ping><wfw:comment>http://www.jarrednicholls.com/post/2008/08/19/ColumnTree-Headers-Always-Up-Top.aspx#comment</wfw:comment><wfw:commentRss>http://www.jarrednicholls.com/syndication.axd?post=f3526e15-d897-497a-acd5-daa91ddff68a</wfw:commentRss></item><item><title>ExtJS iPhone Extensions</title><description>&lt;p&gt;With the release of the iPhone and especially the iPhone 3G, the demand to create iPhone-compatible and iPhone-enriched web pages and applications has sky rocketed.&lt;/p&gt;&lt;p&gt;In my humble opinion, there is no better framework to create rich internet applications than the famous ExtJS.&amp;nbsp; Being an early contributor and active community member for ExtJS, I believe in it whole-heartedly.&amp;nbsp; While ExtJS does a lot of, if not all of, the heavy lifting for the average application and will create iPhone-compatible applications with ease, it has not been extended to create iPhone-enriched applications.&lt;/p&gt;&lt;p&gt;An iPhone-enriched application takes advantage of the Safari and iPhone specific additions to the DOM and Javascript API.&amp;nbsp; Such things as iPhone orientation events, SQLite integration, and native CSS selectors are a couple of the major iPhone specific features that ExtJS should extend itself to use or wrap with friendly code.&lt;/p&gt;&lt;p&gt;Stay tuned, as I have volunteered myself to Aaron and Jack from ExtJS to create this extension for the community. &lt;/p&gt;</description><link>http://www.jarrednicholls.com/post/2008/08/16/ExtJS-iPhone-Extensions.aspx</link><author>jarred.nicholls.nospam@nospam.gmail.com (jarred)</author><comments>http://www.jarrednicholls.com/post/2008/08/16/ExtJS-iPhone-Extensions.aspx#comment</comments><guid>http://www.jarrednicholls.com/post.aspx?id=39fd19b1-d89e-4297-91b0-08faa5b82b83</guid><pubDate>Sat, 16 Aug 2008 07:10:00 -1000</pubDate><category>ExtJS</category><category>iPhone</category><dc:publisher>jarred</dc:publisher><pingback:server>http://www.jarrednicholls.com/pingback.axd</pingback:server><pingback:target>http://www.jarrednicholls.com/post.aspx?id=39fd19b1-d89e-4297-91b0-08faa5b82b83</pingback:target><slash:comments>2</slash:comments><trackback:ping>http://www.jarrednicholls.com/trackback.axd?id=39fd19b1-d89e-4297-91b0-08faa5b82b83</trackback:ping><wfw:comment>http://www.jarrednicholls.com/post/2008/08/16/ExtJS-iPhone-Extensions.aspx#comment</wfw:comment><wfw:commentRss>http://www.jarrednicholls.com/syndication.axd?post=39fd19b1-d89e-4297-91b0-08faa5b82b83</wfw:commentRss></item><item><title>ExceptFilterAttribute - ASP.NET MVC</title><description>&lt;p&gt;
First of all, kudos to Scott Gu and the rest of the .NET/MVC team for doing a great job on ASP.NET MVC thus far.&amp;nbsp; Today I just upgraded a project of mine to Preview 4 and so far so good.
&lt;/p&gt;
&lt;p&gt;
When I first started working with ASP.NET MVC and its built in Action Filtering capability -&amp;nbsp; which are implemented via Attributes on both the Action methods and the Controller class - I began to run into many situations where a particular filter of mine applied to the majority of actions in my controller, but not necessarily all of them.&amp;nbsp; One of my pet peeves is code clutter, and I couldn&amp;#39;t find it in myself to tag 25 actions with the same filter attribute while leaving those other 3 actions untouched.&amp;nbsp; I really wanted to just put it on the controller class and somehow tag those 3 actions to ignore my controller-wide filter.
&lt;/p&gt;
&lt;p&gt;
Thus was born my ExceptFilterAttribute class, as shown below.&amp;nbsp; This filter serves as a base class to a lot of my other filters that gives me the ability to declare actions to which the filter should &lt;strong&gt;not&lt;/strong&gt; apply.&amp;nbsp; What this allows me to do is to put my filter on the controller class to satisfy those 25 actions I wish to target, and to specify the 3 actions I wish to leave untouched.&amp;nbsp; While this may incur a small amount of CPU overhead on all actions, it&amp;#39;s almost negligent when weighed against its convenience.
&lt;/p&gt;
&lt;p&gt;
&lt;div class="codeSnippet"&gt;
	&lt;div class="codeHeader"&gt;
		&lt;img src="http://blog.furred.net/pics/page_white_code.png" /&gt;
		&lt;a href="" onclick="document.getElementById('snippet_2105').style.display = document.getElementById('snippet_2105').style.display == 'none' ? 'block' : 'none'; return false;"
		title="Click for expanding.."&gt;C#-Code: &lt;/a&gt;
	&lt;/div&gt;
	&lt;pre id="snippet_2105" class="codeContainer"&gt;&lt;span style="color:#0000FF"&gt;using&lt;/span&gt; System;
&lt;span style="color:#0000FF"&gt;using&lt;/span&gt; System.Linq;
&lt;span style="color:#0000FF"&gt;using&lt;/span&gt; System.Web.Mvc


&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000FF"&gt;public&lt;/span&gt; &lt;span style="color:#0000FF"&gt;class&lt;/span&gt; ExceptFilterAttribute : ActionFilterAttribute
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000FF"&gt;public&lt;/span&gt; &lt;span style="color:#0000FF"&gt;string&lt;/span&gt; Except { &lt;span style="color:#0000FF"&gt;get&lt;/span&gt;; &lt;span style="color:#0000FF"&gt;set&lt;/span&gt;; }

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000FF"&gt;public&lt;/span&gt; &lt;span style="color:#0000FF"&gt;bool&lt;/span&gt; IsException(ActionExecutingContext filterContext)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000FF"&gt;if&lt;/span&gt; (Except != &lt;span style="color:#0000FF"&gt;null&lt;/span&gt;)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000FF"&gt;string&lt;/span&gt;[] exceptions = Except.Split(&amp;quot;&lt;span style="color:#8B0000"&gt;,&lt;/span&gt;&amp;quot;.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000FF"&gt;if&lt;/span&gt; (exceptions.Contains(filterContext.ActionMethod.Name))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000FF"&gt;return&lt;/span&gt; &lt;span style="color:#0000FF"&gt;true&lt;/span&gt;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000FF"&gt;else&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000FF"&gt;return&lt;/span&gt; &lt;span style="color:#0000FF"&gt;false&lt;/span&gt;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000FF"&gt;return&lt;/span&gt; &lt;span style="color:#0000FF"&gt;false&lt;/span&gt;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/pre&gt;
&lt;/div&gt;
&lt;script type="text/javascript"&gt;
	document.getElementById('snippet_2105').style.display='none';
&lt;/script&gt; 
&lt;/p&gt;
&lt;p&gt;
Subclasses take advantage of the ExceptFilterAttribute class by calling its &lt;em&gt;IsException&lt;/em&gt; method in an overridden OnActionExecuting event handler.&amp;nbsp; Below is an example of my own custom RequiresAuthenticationAttribute class that is a subclass of ExceptFilterAttribute:
&lt;/p&gt;
&lt;p&gt;
&lt;div class="codeSnippet"&gt;
	&lt;div class="codeHeader"&gt;
		&lt;img src="http://blog.furred.net/pics/page_white_code.png" /&gt;
		&lt;a href="" onclick="document.getElementById('snippet_2106').style.display = document.getElementById('snippet_2106').style.display == 'none' ? 'block' : 'none'; return false;"
		title="Click for expanding.."&gt;C#-Code: &lt;/a&gt;
	&lt;/div&gt;
	&lt;pre id="snippet_2106" class="codeContainer"&gt;&lt;span style="color:#0000FF"&gt;public&lt;/span&gt; &lt;span style="color:#0000FF"&gt;class&lt;/span&gt; RequiresAuthenticationAttribute : ExceptFilterAttribute
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000FF"&gt;private&lt;/span&gt; &lt;span style="color:#0000FF"&gt;bool&lt;/span&gt; _redirect = &lt;span style="color:#0000FF"&gt;true&lt;/span&gt;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000FF"&gt;public&lt;/span&gt; &lt;span style="color:#0000FF"&gt;bool&lt;/span&gt; Redirect
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000FF"&gt;get&lt;/span&gt; { &lt;span style="color:#0000FF"&gt;return&lt;/span&gt; _redirect; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000FF"&gt;set&lt;/span&gt; { _redirect = &lt;span style="color:#0000FF"&gt;value&lt;/span&gt;; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000FF"&gt;public&lt;/span&gt; &lt;span style="color:#0000FF"&gt;override&lt;/span&gt; &lt;span style="color:#0000FF"&gt;void&lt;/span&gt; OnActionExecuting(ActionExecutingContext filterContext)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000FF"&gt;if&lt;/span&gt; (IsException(filterContext))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000FF"&gt;return&lt;/span&gt;;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#008000"&gt;//redirect if not authenticated&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000FF"&gt;if&lt;/span&gt; (!filterContext.HttpContext.User.Identity.IsAuthenticated)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#008000"&gt;//use the current url for the redirect&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000FF"&gt;string&lt;/span&gt; redirectOnSuccess = filterContext.HttpContext.Request.Url.AbsolutePath;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#008000"&gt;//send them off to the login page&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000FF"&gt;string&lt;/span&gt; redirectUrl = &lt;span style="color:#0000FF"&gt;string&lt;/span&gt;.Format(&amp;quot;&lt;span style="color:#8B0000"&gt;?ReturnUrl={0}&lt;/span&gt;&amp;quot;, redirectOnSuccess.URLEncode());
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000FF"&gt;string&lt;/span&gt; loginUrl = FormsAuthentication.LoginUrl + redirectUrl;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filterContext.Cancel = &lt;span style="color:#0000FF"&gt;true&lt;/span&gt;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000FF"&gt;if&lt;/span&gt; (Redirect)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filterContext.HttpContext.Response.Redirect(loginUrl, &lt;span style="color:#0000FF"&gt;true&lt;/span&gt;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/pre&gt;
&lt;/div&gt;
&lt;script type="text/javascript"&gt;
	document.getElementById('snippet_2106').style.display='none';
&lt;/script&gt; 
&lt;/p&gt;
&lt;p&gt;
Notice the call to &lt;em&gt;IsException&lt;/em&gt; and if it returns true, the filter returns and doesn&amp;#39;t execute its primary code.&amp;nbsp; If your filter handles OnActionExecuted, OnResultExecuting, or OnResultExecuted and you want to implement the ExceptFilterAttribute functionality, simply implement the OnActionExecuting event handler and if IsExecuting returns true, then set the OnActionExecutingContext&amp;#39;s &lt;em&gt;Cancel&lt;/em&gt; property to true to cancel the filter execution altogether.
&lt;/p&gt;
&lt;p&gt;
Below is an example controller using the RequiresAuthenticationAttribute.&amp;nbsp; Each action that is to be an exception is put into a comma-delimited string and is case-sensitive. 
&lt;/p&gt;
&lt;p&gt;
&lt;div class="codeSnippet"&gt;
	&lt;div class="codeHeader"&gt;
		&lt;img src="http://blog.furred.net/pics/page_white_code.png" /&gt;
		&lt;a href="" onclick="document.getElementById('snippet_2107').style.display = document.getElementById('snippet_2107').style.display == 'none' ? 'block' : 'none'; return false;"
		title="Click for expanding.."&gt;C#-Code: &lt;/a&gt;
	&lt;/div&gt;
	&lt;pre id="snippet_2107" class="codeContainer"&gt;[RequiresAuthentication(Except = &amp;quot;&lt;span style="color:#8B0000"&gt;Login,Logout&lt;/span&gt;&amp;quot;)]
&lt;span style="color:#0000FF"&gt;public&lt;/span&gt; &lt;span style="color:#0000FF"&gt;class&lt;/span&gt; MyController : Controller
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000FF"&gt;public&lt;/span&gt; ActionResult MyProtectedAction1()
&amp;nbsp;&amp;nbsp;&amp;nbsp; { ... }

&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000FF"&gt;public&lt;/span&gt; ActionResult MyProtectedAction2()
&amp;nbsp;&amp;nbsp;&amp;nbsp; { ... }

&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000FF"&gt;public&lt;/span&gt; ActionResult MyProtectedAction3()
&amp;nbsp;&amp;nbsp;&amp;nbsp; { ... }

&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000FF"&gt;public&lt;/span&gt; ActionResult Login()
&amp;nbsp;&amp;nbsp;&amp;nbsp; { ... }

&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000FF"&gt;public&lt;/span&gt; ActionResult Logout()
&amp;nbsp;&amp;nbsp;&amp;nbsp; { ... }
}&lt;/pre&gt;
&lt;/div&gt;
&lt;script type="text/javascript"&gt;
	document.getElementById('snippet_2107').style.display='none';
&lt;/script&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;
The ExceptFilterAttribute class is attached.&amp;nbsp; It&amp;#39;s small and not much to it, but certainly has proven useful for me.
&lt;/p&gt;
&lt;p&gt;
&lt;a rel="enclosure" href="http://www.jarrednicholls.com/file.axd?file=ExceptFilterAttribute.cs"&gt;ExceptFilterAttribute.cs (559.00 bytes)&lt;/a&gt;
&lt;/p&gt;
</description><link>http://www.jarrednicholls.com/post/2008/08/12/ExceptFilterAttribute-ASPNET-MVC.aspx</link><author>jarred.nicholls.nospam@nospam.gmail.com (jarred)</author><comments>http://www.jarrednicholls.com/post/2008/08/12/ExceptFilterAttribute-ASPNET-MVC.aspx#comment</comments><guid>http://www.jarrednicholls.com/post.aspx?id=954008fe-b41d-44ef-acb9-b0c1c3b2a32b</guid><pubDate>Tue, 12 Aug 2008 20:06:00 -1000</pubDate><category>ASP.NET MVC</category><category>ASP.NET</category><dc:publisher>jarred</dc:publisher><pingback:server>http://www.jarrednicholls.com/pingback.axd</pingback:server><pingback:target>http://www.jarrednicholls.com/post.aspx?id=954008fe-b41d-44ef-acb9-b0c1c3b2a32b</pingback:target><slash:comments>0</slash:comments><trackback:ping>http://www.jarrednicholls.com/trackback.axd?id=954008fe-b41d-44ef-acb9-b0c1c3b2a32b</trackback:ping><wfw:comment>http://www.jarrednicholls.com/post/2008/08/12/ExceptFilterAttribute-ASPNET-MVC.aspx#comment</wfw:comment><wfw:commentRss>http://www.jarrednicholls.com/syndication.axd?post=954008fe-b41d-44ef-acb9-b0c1c3b2a32b</wfw:commentRss></item><item><title>Welcome</title><description>&lt;p&gt;
My name is Jarred Nicholls and I&amp;#39;m Chief Architect of DigitalSports, Inc. (&lt;a href="http://www.digitalsports.com" target="_blank"&gt;http://www.digitalsports.com&lt;/a&gt;)&amp;nbsp; I&amp;#39;ve decided to start my own technology blog, discussing my favorite software topics including all of the latest happenings in .NET, Ruby on Rails, Merb, ExtJS, the iPhone, and more.
&lt;/p&gt;
&lt;p&gt;
Along the way I plan to share my knowledge from over the years of being a software architect, and also plan to share code that I have found to be useful to myself and my colleagues past and present.
&lt;/p&gt;
&lt;p&gt;
Please do subscribe to my blog&amp;#39;s feed to stay tuned to my latest postings.&amp;nbsp; I will try to be fairly active inbetween my many hours of work and being a new father of a (currently) 3 week old son &lt;img src="/editors/tiny_mce/plugins/emotions/images/smiley-laughing.gif" border="0" alt="Laughing" title="Laughing" /&gt;
&lt;/p&gt;
</description><link>http://www.jarrednicholls.com/post/2008/08/12/Welcome.aspx</link><author>jarred.nicholls.nospam@nospam.gmail.com (jarred)</author><comments>http://www.jarrednicholls.com/post/2008/08/12/Welcome.aspx#comment</comments><guid>http://www.jarrednicholls.com/post.aspx?id=215fcb17-4cdb-4054-9dcd-a36096e15789</guid><pubDate>Tue, 12 Aug 2008 18:56:00 -1000</pubDate><dc:publisher>jarred</dc:publisher><pingback:server>http://www.jarrednicholls.com/pingback.axd</pingback:server><pingback:target>http://www.jarrednicholls.com/post.aspx?id=215fcb17-4cdb-4054-9dcd-a36096e15789</pingback:target><slash:comments>0</slash:comments><trackback:ping>http://www.jarrednicholls.com/trackback.axd?id=215fcb17-4cdb-4054-9dcd-a36096e15789</trackback:ping><wfw:comment>http://www.jarrednicholls.com/post/2008/08/12/Welcome.aspx#comment</wfw:comment><wfw:commentRss>http://www.jarrednicholls.com/syndication.axd?post=215fcb17-4cdb-4054-9dcd-a36096e15789</wfw:commentRss></item></channel>
</rss>
