<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Mitch Labrador&#039;s Tech Blog</title>
	<atom:link href="http://mitchlabrador.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://mitchlabrador.com</link>
	<description>Less is more when you are focused.</description>
	<lastBuildDate>Sun, 20 May 2012 20:09:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='mitchlabrador.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/644e995c4592c58fe7b403bbfb2d9f56?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Mitch Labrador&#039;s Tech Blog</title>
		<link>http://mitchlabrador.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://mitchlabrador.com/osd.xml" title="Mitch Labrador&#039;s Tech Blog" />
	<atom:link rel='hub' href='http://mitchlabrador.com/?pushpress=hub'/>
		<item>
		<title>Add Date Greater Than validation to jQuery.Validate</title>
		<link>http://mitchlabrador.com/2011/12/26/add-date-greater-than-validation-to-jquery-validate/</link>
		<comments>http://mitchlabrador.com/2011/12/26/add-date-greater-than-validation-to-jquery-validate/#comments</comments>
		<pubDate>Tue, 27 Dec 2011 04:09:06 +0000</pubDate>
		<dc:creator>Mitch Labrador</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://mitchlabrador.com/2011/12/26/add-date-greater-than-validation-to-jquery-validate/</guid>
		<description><![CDATA[This method adds date or number greater than validation to jQuery.Validation plugin. From: http://stackoverflow.com/questions/833997/end-date-greater-than-start-date-jquery-validation   jQuery.validator.addMethod("greaterThan", function (value, element, params) {             if (!/Invalid&#124;NaN/.test(new Date(value))) {                 return new Date(value) &#62; new Date($(params).val());             }             return isNaN(value) &#38;&#38; isNaN($(params).val()) &#124;&#124; (parseFloat(value) &#62; parseFloat($(params).val()));         }, 'Must be greater than {0}.');<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mitchlabrador.com&#038;blog=8149074&#038;post=147&#038;subd=mitchlabrador1&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<pre>This method adds date or number greater than validation to jQuery.Validation plugin.</pre>
<pre>
From: <a href="http://stackoverflow.com/questions/833997/end-date-greater-than-start-date-jquery-validation">http://stackoverflow.com/questions/833997/end-date-greater-than-start-date-jquery-validation</a></pre>
<pre> </pre>
<blockquote><pre>jQuery.validator.addMethod("greaterThan", function (value, element, params) {
 
            if (!/Invalid|NaN/.test(new Date(value))) {
                return new Date(value) &gt; new Date($(params).val());
            }
            return isNaN(value) &amp;&amp; isNaN($(params).val()) || (parseFloat(value) &gt; parseFloat($(params).val()));
        }, 'Must be greater than {0}.');</pre>
</blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mitchlabrador1.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mitchlabrador1.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mitchlabrador1.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mitchlabrador1.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mitchlabrador1.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mitchlabrador1.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mitchlabrador1.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mitchlabrador1.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mitchlabrador1.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mitchlabrador1.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mitchlabrador1.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mitchlabrador1.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mitchlabrador1.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mitchlabrador1.wordpress.com/147/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mitchlabrador.com&#038;blog=8149074&#038;post=147&#038;subd=mitchlabrador1&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mitchlabrador.com/2011/12/26/add-date-greater-than-validation-to-jquery-validate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cb2641556206d241be4a511c963d7c4a?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">mitchlabrador</media:title>
		</media:content>
	</item>
		<item>
		<title>My Best Practices for Writing web Applications</title>
		<link>http://mitchlabrador.com/2010/11/19/my-best-practices-for-writing-web-applications/</link>
		<comments>http://mitchlabrador.com/2010/11/19/my-best-practices-for-writing-web-applications/#comments</comments>
		<pubDate>Fri, 19 Nov 2010 15:31:23 +0000</pubDate>
		<dc:creator>Mitch Labrador</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[mvc template guidance]]></category>

		<guid isPermaLink="false">https://mitchlabrador1.wordpress.com/2010/11/19/my-best-practices-for-writing-web-applications/</guid>
		<description><![CDATA[A few people have asked me what patterns do I use when developing web applications so I figured I would take a few minutes to write them down. Please note that these are the practices I have found work great for me. Warning: one size does not fit all First let me say that I’m [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mitchlabrador.com&#038;blog=8149074&#038;post=103&#038;subd=mitchlabrador1&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A few people have asked me what patterns do I use when developing web applications so I figured I would take a few minutes to write them down. Please note that these are the practices I have found work great for me. <strong>Warning: one size does not fit all</strong></p>
<p>First let me say that I’m a pragmatist at heart, and I write software for a living, so I must find a balance between perfection, maintainability, and profitability.</p>
<p>I’m sure there are other people out there that have created their own development style that works very well for them, for me however, after using most of the shiny three letter patterns, I have found that these principles give me the best of both worlds, RAD development and a Maintainable application. And best of all they help me enjoy my job.</p>
<h2>1. Hand Crafted Model</h2>
<p>I use POCO objects as my model. These objects are hand crafted by me instead of being generated by a tool, and they are the foundation of my app.</p>
<h2>2. No ORM</h2>
<p>I do not use an ORM, but rather I use my own tool <a href="http://bigfootsql.codeplex.com" target="_blank">BigfootSQL</a>. It gives me the best of worlds, complete control over my SQL while at the same time saving me from all the grunt work of object Hydration and query execution. I have been developing software for a while, and have fallen victim to the Microsoft fascination with changing data access technologies with almost every release. My strategy is to try to stay as close to SQL as possible while minimizing the manual work, BigfootSQL does this for me.</p>
<h2>3. Operation based validation</h2>
<p>I validate at the point of the operation execution, rather than performing model based validation. When validation must be shared across operations then a validation helper is employed in order to share this logic. Models rarely if ever are validated in a vacuum, validation changes depending on the type of operation being performed and depending on more than a single model object. Operation validation on the other hand, validates at the operation end, it simply looks at what the action itself is, and validates the action. This way you can effectively and simply validate against multiple types of operations against your object model while keeping your validation and business rules simple. It also keeps you from writing validation code that you won’t use. To achieve this, I use a modified version of TNValidate. TNValidate is an open source fluid interface style validation framework that makes validating my objects extremely simple. I’ve repackaged my modified version of TNValidate into BigfootSQL. I also use a set of Post helper methods that help me retrieve the values from a post while providing simple type validation and required validation. You can find my PostHelper class in my open source project <a href="http://bigfootmvc.codeplex.com" target="_blank">BigfootMVC</a>, this is an ongoing compilation of helper methods I use for MVC style development. I use these helpers when developing for classic ASP.NET, ASP.NET MVC, and DotNetNuke module applications.</p>
<h2>4. Highly specific and smart ViewModel</h2>
<p>For every view, I create a ViewModel whose job it is to handle all data requirements and operations for the view. These VMs are smart and self aware, they have static factory methods for creating themselves, and also handle all view operations which get executed by the Controller. They talk to the Repository to get data and execute operations against the Database. They help me keep my controllers thin by delegating a lot of the operations responsibility closer to where the action is.</p>
<h2>5. No IoC container</h2>
<p>It is ok to take a dependency on your own code. Most of of the time we find ourselves using IoC simply for the reason of making our code testable. Instead of adding complexity to the code to make it testable, I use a smart mocking framework that allows me to effectively mock any kind of dependency without having to use the IoC pattern, I use <a href="http://www.telerik.com/products/mocking.aspx" target="_blank">JustMock</a> by Telerik. This allows me to write my applications in a much simpler way while still keeping them completely testable. I know this is a religious topic for a lot of people, however in my experience, after using several IoC containers, you are simply adding undue complexity to 90% of your apps. I do acknowledge there is a 10% that need it, all I’m saying is, use it where required, be a craftsman, use the right tool for the right job. </p>
<h2>6. Highly Helped Views</h2>
<p>I have developed a set of Html helpers that allow me to perform most view operations, including complex ajax operations, in a very simple way. They help me be extremely productive while creating highly responsive web interfaces. As a developer of some experience with web development, highly responsive (ajax) web interfaces and productivity do not always go hand in hand. I set out to develop a rich set of helpers that allow me to perform the 80% case scenarios with one line or less of strongly typed code. I open sourced all of these helpers under my ongoing <a href="http://bigfootmvc.codeplex.com" target="_blank">BigfootMVC</a> project.</p>
<h2>7. Take a dependency on JavaScript</h2>
<p>For web applications, I take a dependency on JavaScript. This allows me to deal with older less capable browsers much more efficiently. While not all sites can do this, most applications are safe to take a dependency on JavaScript. I also use a strong master page that helps me deal with the browser differences. I use jQuery, Selectivizr, and a few other tricks to make working with IE6 and other non CSS3 HTML5 browsers much easier and less painful.</p>
<h2>8. Strong CSS reset with a rich set of helper classes</h2>
<p>I have published the CSS framework that I use, <a href="http://bigfootcss.codeplex.com" target="_blank">BigfootCSS</a>, it is a compilation of best practices I have found around the web published by really smart people like Eric Meyer, Paul Irish, and a few others. I have also loaded it with a lot of helper classes that I use over and over again in more utilitarian application interfaces. For me it provides a good middle ground between inline styles and 100% custom CSS. I reserve the use of custom CSS classes in my design for what is truly custom, and use helper classes for the common operations.</p>
<p>&#160;</p>
<h2>Summary</h2>
<p>If I had to sum up my strategy in one word – or one acronym rather – I would say “KISS”. <strong>Above all keep it simple, that is the secret to productivity and maintainability.</strong></p>
<p>So that’s it really, a few simple no non-sense principles that make my life easier when it comes to developing web applications.</p>
<p>Hope this helps!</p>
<p>Mitch</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mitchlabrador1.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mitchlabrador1.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mitchlabrador1.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mitchlabrador1.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mitchlabrador1.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mitchlabrador1.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mitchlabrador1.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mitchlabrador1.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mitchlabrador1.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mitchlabrador1.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mitchlabrador1.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mitchlabrador1.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mitchlabrador1.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mitchlabrador1.wordpress.com/103/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mitchlabrador.com&#038;blog=8149074&#038;post=103&#038;subd=mitchlabrador1&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mitchlabrador.com/2010/11/19/my-best-practices-for-writing-web-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cb2641556206d241be4a511c963d7c4a?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">mitchlabrador</media:title>
		</media:content>
	</item>
		<item>
		<title>How to load jQuery from within your DotNetNuke module safely</title>
		<link>http://mitchlabrador.com/2010/11/12/how-to-load-jquery-from-within-your-dotnetnuke-module-safely/</link>
		<comments>http://mitchlabrador.com/2010/11/12/how-to-load-jquery-from-within-your-dotnetnuke-module-safely/#comments</comments>
		<pubDate>Fri, 12 Nov 2010 15:56:49 +0000</pubDate>
		<dc:creator>Mitch Labrador</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">https://mitchlabrador1.wordpress.com/2010/11/12/how-to-load-jquery-from-within-your-dotnetnuke-module-safely/</guid>
		<description><![CDATA[If you are writing a module for DotNetNuke that depends on jQuery, you must find a reliable way to make sure jQuery is loaded. Furthermore, you must make sure the right version of jQuery is loaded and must also ensure the rest of the DNN installation is not affected. Here is how you can do [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mitchlabrador.com&#038;blog=8149074&#038;post=101&#038;subd=mitchlabrador1&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you are writing a module for DotNetNuke that depends on jQuery, you must find a reliable way to make sure jQuery is loaded. Furthermore, you must make sure the right version of jQuery is loaded and must also ensure the rest of the DNN installation is not affected. Here is how you can do that.</p>
<h2>Goals:</h2>
<p>1. Detect whether jQuery is installed</p>
<p>2. Determine whether the right version of jQuery is installed. I will use 1.4.2 as my base.</p>
<p>3. Make sure to not cause conflict with other libraries that might be using the $ variable</p>
<p>&#160;</p>
<h2>Code:</h2>
<pre class="csharpcode">&lt;script type=”text/javascript”&gt;

    <span class="rem">// Check whether jquery 1.4.2 or greater is loaded</span>
    var loadJQuery = (<span class="kwrd">typeof</span> (jQuery) == <span class="str">'undefined'</span> || 
                jQuery().jquery &lt; <span class="str">&quot;1.4.2&quot;</span>);

    <span class="rem">// Add a marker to invoke no conflict when the $ </span>
    <span class="rem">//    is mapped to a library other than jQuery</span>
    var callNoConflict = (<span class="kwrd">typeof</span> ($) != <span class="str">'undefined'</span> 
                &amp;&amp; <span class="kwrd">typeof</span> (jQuery) == <span class="str">'undefined'</span>)

    <span class="kwrd">if</span> (loadJQuery) {

        var filename= ‘your path to the jquery file’;
        var fileref=document.createElement(<span class="str">'script'</span>);
        fileref.setAttribute(<span class="str">&quot;type&quot;</span>,<span class="str">&quot;text/javascript&quot;</span>);
        fileref.setAttribute(<span class="str">&quot;src&quot;</span>, filename);
        document.getElementsByTagName(<span class="str">&quot;head&quot;</span>)[0].appendChild(fileref);

    }

    <span class="kwrd">if</span> (callNoConflict) {
        jQuery(function(){
            jQuery.noConflict();
        });
    }

&lt;/script&gt;</pre>
<p>&#160;</p>
<p><strong>Will Strohl has put together a </strong><a href="http://www.willstrohl.com/Blog/EntryId/382/jQuery-Tips-for-DotNetNuke-Developers"><strong>great article on the best practices for using jQuery within DNN</strong></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mitchlabrador1.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mitchlabrador1.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mitchlabrador1.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mitchlabrador1.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mitchlabrador1.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mitchlabrador1.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mitchlabrador1.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mitchlabrador1.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mitchlabrador1.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mitchlabrador1.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mitchlabrador1.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mitchlabrador1.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mitchlabrador1.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mitchlabrador1.wordpress.com/101/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mitchlabrador.com&#038;blog=8149074&#038;post=101&#038;subd=mitchlabrador1&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mitchlabrador.com/2010/11/12/how-to-load-jquery-from-within-your-dotnetnuke-module-safely/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cb2641556206d241be4a511c963d7c4a?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">mitchlabrador</media:title>
		</media:content>
	</item>
		<item>
		<title>How to change the way jQuery.validate handles error messages</title>
		<link>http://mitchlabrador.com/2010/11/05/how-to-change-the-way-jquery-validate-handles-error-messages/</link>
		<comments>http://mitchlabrador.com/2010/11/05/how-to-change-the-way-jquery-validate-handles-error-messages/#comments</comments>
		<pubDate>Fri, 05 Nov 2010 20:14:12 +0000</pubDate>
		<dc:creator>Mitch Labrador</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">https://mitchlabrador1.wordpress.com/2010/11/05/how-to-change-the-way-jquery-validate-handles-error-messages/</guid>
		<description><![CDATA[I use the jQuery.validate plugin to handle most of my html form validation. This is by far the most widely used jQuery plugin for form validation. To reinforce the importance and quality of this plugin a bit more, Microsoft recently announced that they were dropping their own validation implementation in favor of jQuery.Validate for ASP.NET [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mitchlabrador.com&#038;blog=8149074&#038;post=100&#038;subd=mitchlabrador1&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I use the <a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/" target="_blank">jQuery.validate</a> plugin to handle most of my html form validation. This is by far the most widely used jQuery plugin for form validation. To reinforce the importance and quality of this plugin a bit more, <a href="http://bradwilson.typepad.com/blog/2010/10/mvc3-unobtrusive-validation.html" target="_blank">Microsoft recently announced that they were dropping their own validation implementation in favor of jQuery.Validate for ASP.NET MVC 3</a>. This plug-in is really outstanding, but best of all it is incredibly simple to customize.</p>
<p>Right, so the the topic of this post. Whenever an element being validated by jQuery.Validate in your page is found to be invalid, jQuery.validate&#160; – referred to as “VAL” from now on – adds a label element next to it showing the error message for the particular validation being performed. This is fine for most situations, however sometimes you need to handle scenarios where the default placement of the error message is not quite right. The creators of VAL anticipated this and provided several built-in ways to customize this behavior with just a little bit of effort. These are the three scenarios I find myself using most often:</p>
<h4>Scenario 1: I want to show all my error messages inside a single error container as a UL element</h4>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(&quot;#addEventForm&quot;).validate({   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; errorContainer: &quot;#errorContainer&quot;,    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; errorLabelContainer: &quot;#errorContainer&quot;,    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; errorElement: &quot;li” </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; })</p>
<p><strong>errorContainer</strong> : is a space separated list of element ids that will be shown when the form is invalid and hidden when the form is valid.</p>
<p><strong>errorLabelContainer</strong> : this is the id (or any jquery selector string) of the element that will contain the error labels generated for each invalid field</p>
<p><strong>errorElement</strong> : by default the error element generated by VAL is a label control. If your container is a UL then you can set this variable to “li” in order to generate LI elements instead of label elements.</p>
<p>&#160;</p>
<h4>Scenario 2: I want to show the error control before the field it is validating rather than after it (which is the default location)</h4>
<p>&#160;</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(&quot;#addEventForm&quot;).validate({   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; errorPlacement: function (error, element) {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; error.insertBefore(element);&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; })</p>
<p><strong>errorPlacement</strong>: is the function that is called by VAL to inject the error element into the DOM. By overriding this function we are able to place it anywhere we want. Both the error and element parameters passed into the function are jQuery objects. Sky is the limit as to what you can do here.</p>
<p>&#160;</p>
<h4>Scenario 3: I have a form with two input fields, first name and last name. They are located next to each other, and they are both required. When either one of these fields is empty I want to show the error label generated by VAL inside a div element named “nameError” which is placed bellow the two input controls.</h4>
<p>To do this we are going to use the same trick as in scenario 2 except that we are going to inspect the name of the invalid element being passed into the errorPlacement function and do a custom injection of the error message for just the first and last name. For all other errors we do the default, which is append the error label next to the invalid input control.</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (&quot;#addEventForm&quot;).validate({   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; errorPlacement: function (error, element) {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (element.attr(“name”) == “fname” || element.attr(“name”) == “lname”)    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(“#nameError”).append(error);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; else    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; error.insertAfter(element);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; })</p>
<p>&#160;</p>
<p>That’s it! </p>
<p>Enjoy!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mitchlabrador1.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mitchlabrador1.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mitchlabrador1.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mitchlabrador1.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mitchlabrador1.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mitchlabrador1.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mitchlabrador1.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mitchlabrador1.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mitchlabrador1.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mitchlabrador1.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mitchlabrador1.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mitchlabrador1.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mitchlabrador1.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mitchlabrador1.wordpress.com/100/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mitchlabrador.com&#038;blog=8149074&#038;post=100&#038;subd=mitchlabrador1&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mitchlabrador.com/2010/11/05/how-to-change-the-way-jquery-validate-handles-error-messages/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cb2641556206d241be4a511c963d7c4a?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">mitchlabrador</media:title>
		</media:content>
	</item>
		<item>
		<title>HtmlDirect: A DotNetNuke module that outputs the content of an html file to the page</title>
		<link>http://mitchlabrador.com/2010/09/27/htmldirect-a-dotnetnuke-module-that-outputs-the-content-of-an-html-file-to-the-page/</link>
		<comments>http://mitchlabrador.com/2010/09/27/htmldirect-a-dotnetnuke-module-that-outputs-the-content-of-an-html-file-to-the-page/#comments</comments>
		<pubDate>Mon, 27 Sep 2010 20:59:24 +0000</pubDate>
		<dc:creator>Mitch Labrador</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">https://mitchlabrador1.wordpress.com/2010/09/27/htmldirect-a-dotnetnuke-module-that-outputs-the-content-of-an-html-file-to-the-page/</guid>
		<description><![CDATA[A few weeks back I blogged about wanting to create a module that would simply output the contents of an html file. After watching Will Morgenweck video on how to create a simple one page module in DotNetNuke 5.5 – an awesome feature by the way &#8211; I had the idea to do the same [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mitchlabrador.com&#038;blog=8149074&#038;post=91&#038;subd=mitchlabrador1&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A few weeks back <a href="http://mitchlabrador.com/2010/08/19/htmldirect-a-new-dotnetnuke-module-to-include-html-files-directly-in-your-page/" target="_blank">I blogged about wanting to create a module</a> that would simply output the contents of an html file. After watching <a href="http://www.screencast.com/users/ActiveModules/folders/Default/media/ab5d8307-8217-4524-962f-7ddea7c0b527" target="_blank">Will Morgenweck video</a> on how to create a simple one page module in DotNetNuke 5.5 – an awesome feature by the way &#8211; I had the idea to do the same thing for the HtmlDirect module. It should be a simple enough module, and it can be done in a single page. So here we go:</p>
<p><strong>This is the workflow I want to use when editing this static html content to be included in my portal:</strong></p>
<p>1. Open my favorite html editor</p>
<p>2. Create a new html file and write some cool / mean / clean html code</p>
<p>3. Reference some special css and js files if I want to</p>
<p>4. Upload it to my site</p>
<p>5. Add the html direct module, point it to the file and that’s it.</p>
<p>Editing is now simply opening the html file, editing it and republishing it. Rinse and repeat</p>
<p>&#160;</p>
<p><strong>Overview:</strong></p>
<p>1. Create a new module through the DNN interface</p>
<p>2. Edit the View.ascx file that gets created automatically, to render the file named in the module settings</p>
<p>3. Create an editor to edit the fileName module setting. This must be done in the same page. So I’ll show it when the module is editable, and hide it when it is not.</p>
<p>&#160;</p>
<p>Here is a video that shows the process, and you can download the source packaged module bellow.</p>
<p><a href="http://www.screencast.com/users/MitchLabrador/folders/Jing/media/193fd68d-d39e-41ea-ae14-67dd7eb86076" target="_blank"><img style="display:inline;border-width:0;" title="DNNRecording" border="0" alt="DNNRecording" src="http://mitchlabrador1.files.wordpress.com/2010/09/dnnrecording.png?w=504&h=284" width="504" height="284" /></a> </p>
<p>&#160;</p>
<h3>Code:</h3>
<div style="border-bottom:silver 1px solid;text-align:left;border-left:silver 1px solid;line-height:12pt;background-color:#f4f4f4;width:97.5%;font-family:&#039;direction:ltr;max-height:200px;font-size:8pt;overflow:auto;border-top:silver 1px solid;cursor:text;border-right:silver 1px solid;margin:20px 0 10px;padding:4px;" id="codeSnippetWrapper">
<div style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0;" id="codeSnippet">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum1">   1:</span> &lt;%@ Control Language=<span style="color:#006080;">&quot;C#&quot;</span> Inherits=<span style="color:#006080;">&quot;DotNetNuke.Entities.Modules.PortalModuleBase&quot;</span> %&gt;</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum2">   2:</span> &lt;%@ Import Namespace=<span style="color:#006080;">&quot;System.IO&quot;</span> %&gt;</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum3">   3:</span> &lt;%@ Import Namespace=<span style="color:#006080;">&quot;DotNetNuke.Entities.Modules&quot;</span> %&gt;</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum4">   4:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum5">   5:</span> &lt;script runat=<span style="color:#006080;">&quot;server&quot;</span>&gt;</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum6">   6:</span>     </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum7">   7:</span>     <span style="color:#0000ff;">protected</span> <span style="color:#0000ff;">void</span> Page_Load(<span style="color:#0000ff;">object</span> sender, EventArgs e)</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum8">   8:</span>     {</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum9">   9:</span>         <span style="color:#008000;">// Render the file</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum10">  10:</span>         RenderFile((<span style="color:#0000ff;">string</span>)Settings[<span style="color:#006080;">&quot;fileName&quot;</span>]);</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum11">  11:</span>         </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum12">  12:</span>         <span style="color:#008000;">// Show the editor</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum13">  13:</span>         <span style="color:#0000ff;">if</span> (IsEditable &amp;&amp; !IsPostBack)</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum14">  14:</span>         {</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum15">  15:</span>             fileNameDiv.Visible = <span style="color:#0000ff;">true</span>;</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum16">  16:</span>             fileName.Text = (<span style="color:#0000ff;">string</span>)Settings[<span style="color:#006080;">&quot;fileName&quot;</span>];</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum17">  17:</span>         }</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum18">  18:</span>     }</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum19">  19:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum20">  20:</span>     <span style="color:#008000;">// Render the html file</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum21">  21:</span>     <span style="color:#0000ff;">private</span> <span style="color:#0000ff;">void</span> RenderFile(<span style="color:#0000ff;">string</span> renderFileName)</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum22">  22:</span>     {</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum23">  23:</span>         <span style="color:#0000ff;">try</span> </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum24">  24:</span>         {</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum25">  25:</span>             <span style="color:#0000ff;">if</span> (!<span style="color:#0000ff;">string</span>.IsNullOrEmpty(renderFileName))</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum26">  26:</span>             {</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum27">  27:</span>                 <span style="color:#008000;">// Strip off the initial slash if any</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum28">  28:</span>                 <span style="color:#0000ff;">if</span> (renderFileName.StartsWith(<span style="color:#006080;">&quot;/&quot;</span>) || renderFileName.StartsWith(<span style="color:#006080;">&quot;\\&quot;)) </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum29">  29:</span>                     renderFileName = renderFileName.Substring(1);</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum30">  30:</span>                 </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum31">  31:</span>                 // convert into a physical path</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum32">  32:</span>                 renderFileName = &quot;</span>~/portals/<span style="color:#006080;">&quot; + PortalId + &quot;</span>/<span style="color:#006080;">&quot; + renderFileName;</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum33">  33:</span>                 </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum34">  34:</span>                 // render the text of the file</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum35">  35:</span>                 fileContent.Text = File.OpenText(Server.MapPath(renderFileName)).ReadToEnd();</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum36">  36:</span>             }</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum37">  37:</span>         }</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum38">  38:</span>         catch (Exception ex)</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum39">  39:</span>         {</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum40">  40:</span>             fileContent.Text = (IsEditable) ? ex.ToString() : &quot;</span>Error displaying module content. Unable to find file!<span style="color:#006080;">&quot;;</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum41">  41:</span>         }</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum42">  42:</span>     }</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum43">  43:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum44">  44:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum45">  45:</span>     // This changes the rendered file to a new file and saves in the module settings</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum46">  46:</span>     private void SaveFileNameButton_Click(object sender, EventArgs e)</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum47">  47:</span>     {</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum48">  48:</span>         ModuleController objModules = new ModuleController();</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum49">  49:</span>         objModules.UpdateTabModuleSetting(TabModuleId, &quot;</span>fileName<span style="color:#006080;">&quot;, fileName.Text);</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum50">  50:</span>         RenderFile(fileName.Text);</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum51">  51:</span>     }</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum52">  52:</span>     </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum53">  53:</span> &lt;/script&gt;</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum54">  54:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum55">  55:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum56">  56:</span> &lt;%--Edit the file name--%&gt;</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum57">  57:</span> &lt;div runat=&quot;</span>server<span style="color:#006080;">&quot; id=&quot;</span>fileNameDiv<span style="color:#006080;">&quot; visible=&quot;</span><span style="color:#0000ff;">false</span><span style="color:#006080;">&quot;&gt;</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum58">  58:</span>     File Name &lt;br /&gt; </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum59">  59:</span>     (i.e. HomePageFiles/Content.htm where &quot;</span>HomePageFiles<span style="color:#006080;">&quot; is a folder at the root of the portal): &lt;br /&gt;</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum60">  60:</span>     &lt;asp:TextBox runat=&quot;</span>server<span style="color:#006080;">&quot; ID=&quot;</span>fileName<span style="color:#006080;">&quot; width=&quot;</span>100%<span style="color:#006080;">&quot;&gt;&lt;/asp:TextBox&gt; &lt;br /&gt;</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum61">  61:</span>     &lt;asp:Button runat=&quot;</span>server<span style="color:#006080;">&quot; ID=&quot;</span>saveFileNameButton<span style="color:#006080;">&quot; Text=&quot;</span>Save File<span style="color:#006080;">&quot; OnClick=&quot;</span>SaveFileNameButton_Click<span style="color:#006080;">&quot; /&gt; &lt;br /&gt;</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum62">  62:</span>     &lt;br /&gt;&lt;br /&gt; </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum63">  63:</span> &lt;/div&gt;</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum64">  64:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum65">  65:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum66">  66:</span> &lt;%--Placeholder for the html content--%&gt;</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum67">  67:</span> &lt;asp:Literal runat=&quot;</span>server<span style="color:#006080;">&quot; ID=&quot;</span>fileContent&quot;&gt;&lt;/asp:Literal&gt;</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum68">  68:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#039;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum69">  69:</span>&#160; </pre>
<p><!--CRLF--></div>
</div>
<p>&#160;</p>
<h3>You can download the packaged module here</h3>
<p><a title="http://cdn.mitmar.com/HtmlDirect_01.00.00_Install.zip" href="http://cdn.mitmar.com/HtmlDirect_01.00.00_Install.zip" target="_blank">http://cdn.mitmar.com/HtmlDirect_01.00.00_Install.zip</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mitchlabrador1.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mitchlabrador1.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mitchlabrador1.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mitchlabrador1.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mitchlabrador1.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mitchlabrador1.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mitchlabrador1.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mitchlabrador1.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mitchlabrador1.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mitchlabrador1.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mitchlabrador1.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mitchlabrador1.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mitchlabrador1.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mitchlabrador1.wordpress.com/91/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mitchlabrador.com&#038;blog=8149074&#038;post=91&#038;subd=mitchlabrador1&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mitchlabrador.com/2010/09/27/htmldirect-a-dotnetnuke-module-that-outputs-the-content-of-an-html-file-to-the-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cb2641556206d241be4a511c963d7c4a?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">mitchlabrador</media:title>
		</media:content>

		<media:content url="http://mitchlabrador1.files.wordpress.com/2010/09/dnnrecording.png" medium="image">
			<media:title type="html">DNNRecording</media:title>
		</media:content>
	</item>
		<item>
		<title>DotNetNuke *must* hit reset on Design</title>
		<link>http://mitchlabrador.com/2010/09/14/dotnetnuke-must-hit-reset-on-design/</link>
		<comments>http://mitchlabrador.com/2010/09/14/dotnetnuke-must-hit-reset-on-design/#comments</comments>
		<pubDate>Tue, 14 Sep 2010 15:19:40 +0000</pubDate>
		<dc:creator>Mitch Labrador</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">https://mitchlabrador1.wordpress.com/2010/09/14/dotnetnuke-must-hit-reset-on-design/</guid>
		<description><![CDATA[Let me start by saying that I love DotNetNuke! I believe it to be the most powerful CMS in the market from both a 3rd party support perspective as well as from a developer perspective. I am however dumbfounded by the atrocious design decisions made on the main DNN site. I’m not a designer, I’m [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mitchlabrador.com&#038;blog=8149074&#038;post=89&#038;subd=mitchlabrador1&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Let me start by saying that I love DotNetNuke! I believe it to be the most powerful CMS in the market from both a 3rd party support perspective as well as from a developer perspective. I am however dumbfounded by the atrocious design decisions made on the main DNN site. I’m not a designer, I’m a developer, however even to me, a non-designer, it is absolutely obvious that DNN Corp must hit reset on their site’s design. </p>
<p>Rather than just complaining about it, I figured I would do a bit of constructive criticism. We are going to look at the blog post page. I got there by clicking a link on Twitter by Joe Brinkman. My main objective is to read the blog post and move on.</p>
<p><a href="http://mitchlabrador1.files.wordpress.com/2010/09/dnn_blogpage.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="DNN_BlogPage" border="0" alt="DNN_BlogPage" src="http://mitchlabrador1.files.wordpress.com/2010/09/dnn_blogpage_thumb.png?w=573&h=352" width="573" height="352" /></a> </p>
<h2>Use Case: Read the blog post </h2>
<ol>
<li>First I&#8217;m overwhelmed by everything going on in the page. The actual content of the blog post &#8211; higlighted in green – is deemphasized to the point that I have to hunt for it. Let’s not forget that the post is the reason I’m here, it is the main point of the page.</li>
<li>One third of the page fold is taken up by irrelevant data to the use case. The header menu must be deemphasized. It should not take 1/3rd of the page fold. </li>
<li>The left pane content should be completely removed. I came to the page to read the blog post, I don&#8217;t need to search for it, or care about the blog roll, this would be great for the landing page of the blogs section but not here. This page should be all about reading the post content. </li>
<li>Yes, I know it is a blog post that&#8217;s why I&#8217;m here is there a particular reason why &quot;DNN Blog&quot; must me more prominent than the actual blog post title? </li>
<li>The actual post content font, again the main point of the page, is small and does not have enough line height to make it easy to read. </li>
</ol>
<p><strong>Result: Joe&#8217;s *great* post has been relegated to the last position of visual importance in the page.</strong></p>
<p><strong></strong></p>
<h2>Here are a few sites that get it right:</h2>
<p>In everyone of these instances the most important emphasis in the design is given to the content, as it should be, everything else is noise. Notice how they all have other things going on in the page, but nothing takes precedence over the post content.</p>
<blockquote><h3 align="center">The chrome is not as important as the content!</h3>
<p>&#160;</p>
</blockquote>
<blockquote><p><a href="http://mitchlabrador1.files.wordpress.com/2010/09/wordpress.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="wordpress" border="0" alt="wordpress" src="http://mitchlabrador1.files.wordpress.com/2010/09/wordpress_thumb.png?w=554&h=416" width="554" height="416" /></a> </p>
</blockquote>
<p><a href="http://mitchlabrador1.files.wordpress.com/2010/09/snappages.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="snappages" border="0" alt="snappages" src="http://mitchlabrador1.files.wordpress.com/2010/09/snappages_thumb.png?w=572&h=428" width="572" height="428" /></a></p>
<p><a href="http://mitchlabrador1.files.wordpress.com/2010/09/37signals.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="37signals" border="0" alt="37signals" src="http://mitchlabrador1.files.wordpress.com/2010/09/37signals_thumb.png?w=566&h=426" width="566" height="426" /></a></p>
<p><a href="http://mitchlabrador1.files.wordpress.com/2010/09/rubyonrails.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="rubyonrails" border="0" alt="rubyonrails" src="http://mitchlabrador1.files.wordpress.com/2010/09/rubyonrails_thumb.png?w=574&h=434" width="574" height="434" /></a></p>
<p><a href="http://mitchlabrador1.files.wordpress.com/2010/09/sitefinity.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="Sitefinity" border="0" alt="Sitefinity" src="http://mitchlabrador1.files.wordpress.com/2010/09/sitefinity_thumb.png?w=571&h=429" width="571" height="429" /></a></p>
<p><a href="http://mitchlabrador1.files.wordpress.com/2010/09/twitter.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="twitter" border="0" alt="twitter" src="http://mitchlabrador1.files.wordpress.com/2010/09/twitter_thumb.png?w=572&h=430" width="572" height="430" /></a></p>
<p><a href="http://mitchlabrador1.files.wordpress.com/2010/09/umbraco.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="umbraco" border="0" alt="umbraco" src="http://mitchlabrador1.files.wordpress.com/2010/09/umbraco_thumb.png?w=580&h=436" width="580" height="436" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mitchlabrador1.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mitchlabrador1.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mitchlabrador1.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mitchlabrador1.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mitchlabrador1.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mitchlabrador1.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mitchlabrador1.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mitchlabrador1.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mitchlabrador1.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mitchlabrador1.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mitchlabrador1.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mitchlabrador1.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mitchlabrador1.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mitchlabrador1.wordpress.com/89/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mitchlabrador.com&#038;blog=8149074&#038;post=89&#038;subd=mitchlabrador1&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mitchlabrador.com/2010/09/14/dotnetnuke-must-hit-reset-on-design/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cb2641556206d241be4a511c963d7c4a?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">mitchlabrador</media:title>
		</media:content>

		<media:content url="http://mitchlabrador1.files.wordpress.com/2010/09/dnn_blogpage_thumb.png" medium="image">
			<media:title type="html">DNN_BlogPage</media:title>
		</media:content>

		<media:content url="http://mitchlabrador1.files.wordpress.com/2010/09/wordpress_thumb.png" medium="image">
			<media:title type="html">wordpress</media:title>
		</media:content>

		<media:content url="http://mitchlabrador1.files.wordpress.com/2010/09/snappages_thumb.png" medium="image">
			<media:title type="html">snappages</media:title>
		</media:content>

		<media:content url="http://mitchlabrador1.files.wordpress.com/2010/09/37signals_thumb.png" medium="image">
			<media:title type="html">37signals</media:title>
		</media:content>

		<media:content url="http://mitchlabrador1.files.wordpress.com/2010/09/rubyonrails_thumb.png" medium="image">
			<media:title type="html">rubyonrails</media:title>
		</media:content>

		<media:content url="http://mitchlabrador1.files.wordpress.com/2010/09/sitefinity_thumb.png" medium="image">
			<media:title type="html">Sitefinity</media:title>
		</media:content>

		<media:content url="http://mitchlabrador1.files.wordpress.com/2010/09/twitter_thumb.png" medium="image">
			<media:title type="html">twitter</media:title>
		</media:content>

		<media:content url="http://mitchlabrador1.files.wordpress.com/2010/09/umbraco_thumb.png" medium="image">
			<media:title type="html">umbraco</media:title>
		</media:content>
	</item>
		<item>
		<title>BigfootCSS, my CSS bag of tricks</title>
		<link>http://mitchlabrador.com/2010/08/25/bigfootcss-my-css-bag-of-tricks/</link>
		<comments>http://mitchlabrador.com/2010/08/25/bigfootcss-my-css-bag-of-tricks/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 20:15:16 +0000</pubDate>
		<dc:creator>Mitch Labrador</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">https://mitchlabrador1.wordpress.com/2010/08/25/bigfootcss-my-css-bag-of-tricks/</guid>
		<description><![CDATA[BigfootCSS is a 22k uncompressed / 6k compressed CSS stylesheet that can be used to aid you in the styling of your web pages. It is a collection of real world CSS classes, box model fixes, generic classes for various common styles, standard Ad sizes, and a solid browser reset based on Eric Meyer’s CSS [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mitchlabrador.com&#038;blog=8149074&#038;post=67&#038;subd=mitchlabrador1&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://bigfootcss.codeplex.com" target="_blank"><img style="display:inline;border:0;" title="BigfootCSS_Logo_whitebg" src="http://mitchlabrador1.files.wordpress.com/2010/08/bigfootcss_logo_whitebg1.png?w=240&h=59" border="0" alt="BigfootCSS_Logo_whitebg" width="240" height="59" /></a></p>
<p><a href="http://bigfootcss.codeplex.com" target="_blank">BigfootCSS</a> is a 22k uncompressed / 6k compressed CSS stylesheet that can be used to aid you in the styling of your web pages. It is a collection of real world CSS classes, box model fixes, generic classes for various common styles, standard Ad sizes, and a solid browser reset based on Eric Meyer’s CSS reset. It can be applied to the whole page, or it can simply be applied to a particular element within the page and its children. This latter option is very useful for CMS module development as it makes it easy to style just your module without being affected by or affecting the host page.</p>
<p>If you have written a module that sits inside of DotNetNuke, WordPress, Jumla, etc. you know what I mean. You can’t control the skin in which your module runs, but you have to provide a reasonable amount of protection to ensure the proper layout of your module. You must also be a good citizen of the ecosystem and not allow your styles to bleed into the rest of the skin. BigfootCSS solves this problem very easily by only targeting elements with a certain id.</p>
<h2>Why?</h2>
<p> </p>
<p>Over the years I have used a number of CSS frameworks. In them I found a lot of good techniques, and others… well not so great. So I started creating my own CSS bag of tricks, I’m not sure I would call it a framework, but rather a collection of real world CSS classes, hacks, and fixes. Most of the tools in this toolbox come from everything I’ve liked about the other frameworks I’ve used, most of the credit goes the guys that have figure out the different hacks to fix the IE box model, to create a proper reset, etc. I’ve lovingly named this compilation of ideas bigfootCSS.</p>
<h2>Context in which I use bigfootCSS:</h2>
<p> </p>
<p>1. I’m a developer creating business apps, not just websites. A lot of the utility classes found in the framework – for lack of a better word – are meant to aid in the utilitarian way in which business applications are styled.</p>
<p>2. I dislike inline styles, but do not mind a composition of classes to achieve a certain result. This is a good middle ground between a completely custom rule for the element and inline styles.</p>
<p>3. I reserve the creation of custom styles for the elements that truly are unique in your project. For example I don’t like to reinvent the wheel when doing grid layouts. I have a solid grid system that is tested across browsers.</p>
<p>4. I’ve said this before, but it bears repeating <strong>I’m a developer</strong>, not a designer.  This is a framework that has worked for me in my projects. It is not 100% perfect or bug free. For the 10% outlier, I simply write custom CSS to cover these use cases.</p>
<h2>What’s in it?</h2>
<p> </p>
<h4>A browser reset</h4>
<p>I believe <a href="http://meyerweb.com/eric/tools/css/reset/">Eric Meyer’s</a> is the best and longest standing browser reset out there. For you who are not familiar with browser resets, the short of it is, that every browser before they apply your styles, the browser’s default stylesheet gets applied, and it creates the base set of styles for the the page. Trouble is, every browser has a slightly different base style, which makes your design vary from browser to browser based on the inherited base style. To counter this, you can create a reset if you will, which neutralizes all default browser styling and creates a baseline which is the same across all your browsers.</p>
<h4>Baseline</h4>
<p>Once you have run a browser reset, you have created a consistent baseline accross all browsers by removing all (almost) styles, but now you don’t have any defaults. The baseline serves the purpose of creating a default look for the common elements like heading tags, paragraphs, etc.</p>
<h4>Fix for IE box model. The clearfix hack</h4>
<p>The clearfix hack is used in order to clear floated elements. While this should be a straightforward procedure, IE makes it very challenging, as is with most other issues in IE, it implements the html spec slightly different from other browsers. The included clearfix hack, fixes all these inconsistencies and renders correctly across IE5.5+ as well as Firefox, Chrome, Safari, Opera. See <a href="http://perishablepress.com/press/2008/02/05/lessons-learned-concerning-the-clearfix-css-hack/">this article</a> for a clear description of the problem and it’s solutions.</p>
<p>The short of it is, if you have this markup, if you are floating elements inside a container, all you have to do is apply the clearfix class to the parent container and all floated children will behave correctly. for example:</p>
<div id="codeSnippetWrapper" style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:97.5%;">
<div id="codeSnippet" style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;"><span id="lnum1" style="color:#606060;">   1:</span> <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">div</span> <span style="color:#ff0000;">class</span><span style="color:#0000ff;">="clearfix"</span><span style="color:#0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span id="lnum2" style="color:#606060;">   2:</span>     <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">div</span> <span style="color:#ff0000;">class</span><span style="color:#0000ff;">="fl"</span><span style="color:#0000ff;">&gt;</span>fl = Float left<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">div</span><span style="color:#0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;"><span id="lnum3" style="color:#606060;">   3:</span>     <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">div</span> <span style="color:#ff0000;">class</span><span style="color:#0000ff;">="fr"</span><span style="color:#0000ff;">&gt;</span>fr = Float right<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">div</span><span style="color:#0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span id="lnum4" style="color:#606060;">   4:</span> <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">div</span><span style="color:#0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
</div>
</div>
<p> </p>
<h4>Type</h4>
<p>As part of the baseline, it creates a base type setting which is as follows:</p>
<div id="codeSnippetWrapper" style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:97.5%;">
<div id="codeSnippet" style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;"><span id="lnum1" style="color:#606060;">   1:</span> {</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span id="lnum2" style="color:#606060;">   2:</span>     <span style="color:#0000ff;">font-family</span>:Segoe UI,Arial,Verdana,Helvetica,sans<span style="color:#006080;">-serif;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;"><span id="lnum3" style="color:#606060;">   3:</span>     <span style="color:#0000ff;">font-size</span>: <span style="color:#006080;">12px;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span id="lnum4" style="color:#606060;">   4:</span>     <span style="color:#0000ff;">text-align</span>:<span style="color:#006080;">left;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;"><span id="lnum5" style="color:#606060;">   5:</span> }</pre>
<p><!--CRLF--></p>
</div>
</div>
<p>This works well in most browsers, and while I understand the shortcomings of pixel based font sizes, it just works, like I’ve said before for the cases where this does not fit, then use a custom classes, or change the default.</p>
<p>There is also standard sizes represented by classes. Theses classes correctly fix the problem of being overridden by element direct styling typical in a, input, td, select, and textarea tags. When you assign one of these classes to any element, it insures that it takes precedence.</p>
<p><strong>s</strong> = small (13px)</p>
<p><strong>xs</strong> = extra small (10px)</p>
<p><strong>xxs</strong> = extra extra small (9px)</p>
<p><strong>m</strong> = medium (16px)</p>
<p><strong>l</strong> = large (19px)</p>
<p><strong>xl</strong> =extra large (24px)</p>
<p><strong>xxl</strong> = extra extra large (32px)</p>
<h4>Floats</h4>
<p>To float elements left or right simply apply these classes to the element. Remember to wrap them with a container that has the <strong>clearfix</strong> class applied as in the example above.</p>
<p><strong>fl</strong> = float left</p>
<p><strong>fr</strong> = float right</p>
<h4>Widths, Heights, Padding and Margins</h4>
<p>I know that some of you will balk at the idea of classes with preset sizes, but before you decide to start hurling stones, remember what I said before, every class that is there, is there because I use it often and find it to simplify and speed up my development. Like I’ve said this is a good middle ground before custom css rules for everything, and inline styles (which are evil).</p>
<p><strong>w{number}</strong> = Sets the width of the element to the {number} of pixels specified. for example w25, sets the width of the element to 25px.  Numbers from 1-10 are in 1 pixel increments, 10-200 are in 5 pixel increments and 200-600 are in 25 pixel increments and 600-980 are in 10 pixel increments. With the exception of the standard ad sizes as found <a href="http://www.iab.net/iab_products_and_industry_services/1421/1443/1452">here</a></p>
<p><strong>wp{number}</strong> = Sets the width of the element in percentages of it’s parent’s size. 1-10 and 95-100 are in 1% increments, the reset are in 5% point increments.</p>
<p><strong>h{number}</strong> = Sets the height of the element in pixels. Numbers from 1-31 are in 1 pixel increments, from 30-250 are in 5 pixel increments, 250-600 are in 10 pixel increments</p>
<p><strong>m{number}</strong> = Sets the margin for an element to the specified number. Numbers from 1-10 are in 1 pixel increments, 10-50 are in 5 pixel increments.</p>
<p><strong>mt{number} , mr{number}, mb{number}, ml{number}</strong> = Sets the margin-[top, right, bottom, left] correspondingly. Numbers from 1-10 are in 1 pixel increments, 10-50 are in 5 pixel increments.</p>
<p><strong>p{number}</strong> = Sets the padding for an element to the specified number. Numbers from 1-10 are in 1 pixel increments, 10-50 are in 5 pixel increments.</p>
<p><strong>pt{number} , pr{number}, pb{number}, pl{number}</strong> = Sets the padding-[top, right, bottom, left] correspondingly. Numbers from 1-10 are in 1 pixel increments, 10-50 are in 5 pixel increments.</p>
<h4>Colors and Backgrounds</h4>
<p>These are particularly useful in application development, as you often want to change the color or background to a preset set of colors, but it is not imperative that you be extremely precise with the color as you would with the palette of a hand crafted site. In these cases having some preset colors greatly improves the consistency and speed with which you can achieve relevance through design in your applications.</p>
<p><strong>bg{color}</strong> = stands for background-color and then the color specified. colors included are: <strong>white, black, light, dark, hl</strong> (which means highlight, sets the background to a light yellow), the colors are as described by their name.</p>
<p><strong>black, white, red, xdard, dark, light, xlight</strong> = Sets the color css attribute of elements (including overriding the anchor tag color if applied to an anchor) to the appropriate color.</p>
<h4>Display and Position</h4>
<p> </p>
<p><strong>hide</strong> = sets the display property of the element to none</p>
<p><strong>block</strong> = sets the display property of the element to block</p>
<p><strong>inline</strong> = sets the display property of the element to inline</p>
<p><strong>inlineb </strong>= sets the display property of the element to inline-block</p>
<p><strong>prel</strong> = sets the position to relative</p>
<p><strong>pabs</strong> = sets the position to absolute</p>
<p><strong>pfixed </strong>= sets the position to fixed</p>
<p><strong>pstatic </strong>= sets the position to static</p>
<h4>Text alignment</h4>
<p> </p>
<p><strong>tr </strong>= text-align: right</p>
<p><strong>tl</strong> = text-align: left</p>
<p><strong>tc </strong>= text-align: center</p>
<p><strong>tj </strong>= text-align: justify</p>
<p><strong>tvt</strong> = vertical-align: top</p>
<p><strong>tvc</strong> = vertical-align: middle</p>
<p><strong>tvb</strong> = vertical-align: bottom</p>
<h4>Grid</h4>
<p> </p>
<p>The grid is loosely based on the 960 fluid grid. It basically implements a 16 column grid that uses percentages. I use percentages because it is particularly useful to include in other containers that might not be necessarily the whole page. For instance you can apply the grid to just a div element within your page, and it will divide that element into 16 equal columns using percentages. Particularly useful when using the the system for styling a module.</p>
<p>Best to way to show it is to show you some code:</p>
<div id="codeSnippetWrapper" style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:97.5%;">
<div id="codeSnippet" style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;"><span id="lnum1" style="color:#606060;">   1:</span> <span style="color:#006080;">&lt;</span>!--You apply the grid to an element by adding the g16 class to it--<span style="color:#006080;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span id="lnum2" style="color:#606060;">   2:</span> <span style="color:#006080;">&lt;</span><span style="color:#0000ff;">div</span> class="g16"<span style="color:#006080;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;"><span id="lnum3" style="color:#606060;">   3:</span>     <span style="color:#006080;">&lt;</span><span style="color:#0000ff;">div</span> class="gc5 firstc"<span style="color:#006080;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span id="lnum4" style="color:#606060;">   4:</span>         This takes 5 of the sixteen columns and marks it as the first column with the firstc class,</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;"><span id="lnum5" style="color:#606060;">   5:</span>         the firstc class kills the <span style="color:#0000ff;">left</span> gutter space for this column</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span id="lnum6" style="color:#606060;">   6:</span>     <span style="color:#006080;">&lt;</span>/<span style="color:#0000ff;">div</span><span style="color:#006080;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;"><span id="lnum7" style="color:#606060;">   7:</span>     <span style="color:#006080;">&lt;</span><span style="color:#0000ff;">div</span> class="gc3"<span style="color:#006080;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span id="lnum8" style="color:#606060;">   8:</span>         Yet another column taking another 3/16 of the space</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;"><span id="lnum9" style="color:#606060;">   9:</span>     <span style="color:#006080;">&lt;</span>/<span style="color:#0000ff;">div</span><span style="color:#006080;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span id="lnum10" style="color:#606060;">  10:</span>     <span style="color:#006080;">&lt;</span><span style="color:#0000ff;">div</span> class="gc8 lastc"<span style="color:#006080;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;"><span id="lnum11" style="color:#606060;">  11:</span>         Another column taking the ramining 8/16 space in the grid.</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span id="lnum12" style="color:#606060;">  12:</span>         lastc class marks the column as the last in the grid and kills the <span style="color:#0000ff;">right</span> gutter</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;"><span id="lnum13" style="color:#606060;">  13:</span>     <span style="color:#006080;">&lt;</span>/<span style="color:#0000ff;">div</span><span style="color:#006080;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span id="lnum14" style="color:#606060;">  14:</span> </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;"><span id="lnum15" style="color:#606060;">  15:</span> </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span id="lnum16" style="color:#606060;">  16:</span>     <span style="color:#006080;">&lt;</span>!-- This clears the previous columns, but you only have to</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;"><span id="lnum17" style="color:#606060;">  17:</span>          use when the next column is not a full column --<span style="color:#006080;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span id="lnum18" style="color:#606060;">  18:</span>     <span style="color:#006080;">&lt;</span><span style="color:#0000ff;">div</span> class="<span style="color:#0000ff;">clear</span>"<span style="color:#006080;">&gt;</span><span style="color:#006080;">&lt;</span>/<span style="color:#0000ff;">div</span><span style="color:#006080;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;"><span id="lnum19" style="color:#606060;">  19:</span> </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span id="lnum20" style="color:#606060;">  20:</span>     <span style="color:#006080;">&lt;</span><span style="color:#0000ff;">div</span> class="gc16"<span style="color:#006080;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;"><span id="lnum21" style="color:#606060;">  21:</span>         A full column does not have to be cleared or marked with the lastc and firstc classes</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span id="lnum22" style="color:#606060;">  22:</span>     <span style="color:#006080;">&lt;</span>/<span style="color:#0000ff;">div</span><span style="color:#006080;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;"><span id="lnum23" style="color:#606060;">  23:</span> </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span id="lnum24" style="color:#606060;">  24:</span> <span style="color:#006080;">&lt;</span>/<span style="color:#0000ff;">div</span><span style="color:#006080;">&gt;</span></pre>
<p><!--CRLF--></p>
</div>
</div>
<p>The grid is pretty simple really, just a way to evenly divide any container element into 16 equal columns.</p>
<h4>Miscellaneous Classes</h4>
<p> </p>
<p><strong>pointer </strong>= sets the cursor to be the pointer when the mouse is over this element</p>
<p><strong>cnomal </strong>= sets the mouse cursor to the normal sate</p>
<p><strong>b </strong>= set the font-weight to bold</p>
<p><strong>fieldlabel </strong>= sets an element ot display lock and ad bottom padding of 3 pixels this is used on &lt;label&gt; elements that pertain to input controls</p>
<p><strong>nowrap </strong>=adds text-whitespace: nowrap</p>
<p><strong>strike </strong>= adds text-decoration: line-through</p>
<p><strong>cmd </strong>= used on anchor tag to make them small red and bold as it it were a command rather than just a simple link. { font-size: 10px; font-weight:bold; color:red; }</p>
<p><strong>hlist </strong>= makes an unordered list’s &lt;ul&gt; elements display inline and horizotally, useful when creating menu and other horizontal use of &lt;ul&gt;</p>
<p><strong>tablemin </strong>= turns a properly formatted table (one that uses the &lt;thead&gt; &lt;th&gt; and &lt;tbody&gt; elements) into an instance nicely displayed one by adding formatting to it in a very simplistic style</p>
<p><strong>error </strong>= When applied to an element it turns it’s color red, and sets the font and font size to display as an error. Useful in applications when you want to visibly adorn an invalid input.</p>
<h2>What about partial page styling (CMS mode)</h2>
<p>I also created an alternative CSS stylesheet, <strong>BigfootWeb_Module.css,</strong> which would be referenced instead of <strong>BigfootWeb.css. </strong>It contains all of the same classes and styles, except they are only applied to the element in your page named <strong>bfbox</strong>.</p>
<p>Also by default the browser reset is not applied unless you specifically also add the <strong>reset</strong> class to the bfbox element. That’s it, very simply really. A quick example:</p>
<div id="codeSnippetWrapper" style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:97.5%;">
<div id="codeSnippet" style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;"><span id="lnum1" style="color:#606060;">   1:</span> <span style="color:#006080;">&lt;</span><span style="color:#0000ff;">div</span><span style="color:#006080;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span id="lnum2" style="color:#606060;">   2:</span>     This some other page <span style="color:#0000ff;">content</span>, not affected by bigfootCSS.</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;"><span id="lnum3" style="color:#606060;">   3:</span>     bigfootCSS rules do not apply here.</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span id="lnum4" style="color:#606060;">   4:</span> <span style="color:#006080;">&lt;</span>/<span style="color:#0000ff;">div</span><span style="color:#006080;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;"><span id="lnum5" style="color:#606060;">   5:</span> </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span id="lnum6" style="color:#606060;">   6:</span> <span style="color:#006080;">&lt;</span><span style="color:#0000ff;">div</span> id="bfbox" class="reset"<span style="color:#006080;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;"><span id="lnum7" style="color:#606060;">   7:</span>     All elements inside this box are now under the bigfootCSS reset, and baseline</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span id="lnum8" style="color:#606060;">   8:</span>     as well as all css classes and rules would apply to all children of this element</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;"><span id="lnum9" style="color:#606060;">   9:</span> <span style="color:#006080;">&lt;</span>/<span style="color:#0000ff;">div</span><span style="color:#006080;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span id="lnum10" style="color:#606060;">  10:</span> </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;"><span id="lnum11" style="color:#606060;">  11:</span> <span style="color:#006080;">&lt;</span><span style="color:#0000ff;">div</span><span style="color:#006080;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;"><span id="lnum12" style="color:#606060;">  12:</span>     Back to the page, again not affected by bigfootCSS.</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;"><span id="lnum13" style="color:#606060;">  13:</span> <span style="color:#006080;">&lt;</span>/<span style="color:#0000ff;">div</span><span style="color:#006080;">&gt;</span></pre>
<p><!--CRLF--></p>
</div>
</div>
<p> </p>
<p>Please not that if you don’t want the browser reset portion to apply to your <strong>bfbox</strong> container, simply don’t apply the <strong>reset</strong> class. This will allow you to inherit all the CSS rules from your skin / page while still being able to take advantage of most of the classes in the framework.</p>
<h2>Putting it all together</h2>
<p>You can now put these classes together to create a very fast and clean layout for your page without having to create custom CSS rules for everything.</p>
<p>For a more complete example please visit <a href="http://cdn.mitmar.com/bigfootcss/Main.html">http://cdn.mitmar.com/bigfootcss/Main.html</a></p>
<p>Cheers!</p>
<p>Mitch</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mitchlabrador1.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mitchlabrador1.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mitchlabrador1.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mitchlabrador1.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mitchlabrador1.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mitchlabrador1.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mitchlabrador1.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mitchlabrador1.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mitchlabrador1.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mitchlabrador1.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mitchlabrador1.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mitchlabrador1.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mitchlabrador1.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mitchlabrador1.wordpress.com/67/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mitchlabrador.com&#038;blog=8149074&#038;post=67&#038;subd=mitchlabrador1&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mitchlabrador.com/2010/08/25/bigfootcss-my-css-bag-of-tricks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cb2641556206d241be4a511c963d7c4a?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">mitchlabrador</media:title>
		</media:content>

		<media:content url="http://mitchlabrador1.files.wordpress.com/2010/08/bigfootcss_logo_whitebg1.png" medium="image">
			<media:title type="html">BigfootCSS_Logo_whitebg</media:title>
		</media:content>
	</item>
		<item>
		<title>HtmlDirect: A new DotNetNuke module to include html files directly in your page</title>
		<link>http://mitchlabrador.com/2010/08/19/htmldirect-a-new-dotnetnuke-module-to-include-html-files-directly-in-your-page/</link>
		<comments>http://mitchlabrador.com/2010/08/19/htmldirect-a-new-dotnetnuke-module-to-include-html-files-directly-in-your-page/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 21:14:38 +0000</pubDate>
		<dc:creator>Mitch Labrador</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">https://mitchlabrador1.wordpress.com/2010/08/19/htmldirect-a-new-dotnetnuke-module-to-include-html-files-directly-in-your-page/</guid>
		<description><![CDATA[When creating DotNetNuke sites, I find myself editing my html in the text editor of my&#160; choice, saving the file to make the changing easier in the future, and then copying and pasting the html code into the html module in source view. I don’t use the Wysiwyg editor at all quite frankly it gets [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mitchlabrador.com&#038;blog=8149074&#038;post=65&#038;subd=mitchlabrador1&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tbody>
<tr>
<td valign="top">When creating DotNetNuke sites, I find myself editing my html in the text editor of my&#160; choice, saving the file to make the changing easier in the future, and then copying and pasting the html code into the html module in source view. I don’t use the Wysiwyg editor at all quite frankly it gets in my way most of the time. This is particularly true when editing a full highly stylized page. To solve this problem, I’ve decided to create a new module named HtmlDirect. It will be created using the <a href="http://bigfoot.bigfootdnn.com">BigfootDNN</a> project and it will be open source:</td>
<td valign="top">&#160;<a href="http://mitchlabrador1.files.wordpress.com/2010/08/htmleditor_crossed.jpg"><img style="display:inline;border-width:0;" title="HtmlEditor_Crossed" border="0" alt="HtmlEditor_Crossed" src="http://mitchlabrador1.files.wordpress.com/2010/08/htmleditor_crossed_thumb.jpg?w=244&h=176" width="244" height="176" /></a></td>
</tr>
</tbody>
</table>
<p>&#160;</p>
<p><strong>This is workflow I want to use when editing these static html content to be included in my portal:</strong></p>
<p>1. Open my favorite html editor</p>
<p>2. Create a new html file and write some cool / mean / clean html code</p>
<p>3. Reference some special css and js files if I want to</p>
<p>4. Upload it to my site</p>
<p>5. Add the html direct module, point it to the file and that’s it.</p>
<p>Editing is now simply opening the html file, editing it and republishing it. Rinse and repeat.</p>
<p><strong>You are probably wondering why not just create a simple html / or asp.net website?</strong></p>
<p>The answer is that I want to take advantage of many of the DotNetNuke modules out there, but I still want to edit my static content pages easily and without the delay of having to open up the page, login, open the page, select edit on the html module, pasting the html code, and hit save.</p>
<p><strong>Convention over configuration</strong></p>
<p>I don’t want to have any options on the module other than the relative location to the file without having to specify the extension so for home/content.html i just want to refer to it as home/content in my module. Convention to follow: </p>
<p>1. Every portal root folder will have a folder in it called ~/Portals/[PortalId]/HtmlDirectFiles. </p>
<p>2. HtmlDirectFiles Structure:</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; HtmlDirectFiles    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8211; images     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8211; css     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8211; js     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8211; file.html | foldername/file.html</p>
<p>3. Files must be named with the extension <strong>.html</strong></p>
<p>4. Html file will reference images, css, and js files relative to its location. When you upload your html file, also upload your images, css, and any js files to corresponding folder under HtmlDirectFiles folder. </p>
<p>5. Html file will not include the <strong>html, head, or body</strong> tags</p>
<p>6. DotNetNuke caching rules will be followed</p>
<p>Of course content editors will have to be smart about referencing css and js files taking into account the implications of including the files multiple times on the page, etc. I assume we are all pros here and you know that you are doing and how to avoid this.</p>
<p>That’s it, pretty simple really, but should make my life a lot easier. Stay tuned for a release date.</p>
<p>Cheers!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mitchlabrador1.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mitchlabrador1.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mitchlabrador1.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mitchlabrador1.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mitchlabrador1.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mitchlabrador1.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mitchlabrador1.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mitchlabrador1.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mitchlabrador1.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mitchlabrador1.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mitchlabrador1.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mitchlabrador1.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mitchlabrador1.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mitchlabrador1.wordpress.com/65/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mitchlabrador.com&#038;blog=8149074&#038;post=65&#038;subd=mitchlabrador1&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mitchlabrador.com/2010/08/19/htmldirect-a-new-dotnetnuke-module-to-include-html-files-directly-in-your-page/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cb2641556206d241be4a511c963d7c4a?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">mitchlabrador</media:title>
		</media:content>

		<media:content url="http://mitchlabrador1.files.wordpress.com/2010/08/htmleditor_crossed_thumb.jpg" medium="image">
			<media:title type="html">HtmlEditor_Crossed</media:title>
		</media:content>
	</item>
		<item>
		<title>Learning Ruby through the eyes of a .NET developer &#8211; Part 1</title>
		<link>http://mitchlabrador.com/2010/08/11/learning-ruby-through-the-eyes-of-a-net-developer-part-1/</link>
		<comments>http://mitchlabrador.com/2010/08/11/learning-ruby-through-the-eyes-of-a-net-developer-part-1/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 20:24:31 +0000</pubDate>
		<dc:creator>Mitch Labrador</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">https://mitchlabrador1.wordpress.com/2010/08/11/learning-ruby-through-the-eyes-of-a-net-developer-part-1/</guid>
		<description><![CDATA[I’ve been fascinated with the ruby syntax for quite sometime now, and have been reading Mr. Neighborly&#8217;s Humble Little Ruby Book one of the most entertaining books I’ve found on Ruby. It is not meant to be an in-depth reference, instead it provides a no non-sense approach to learning the Ruby syntax and the Ruby [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mitchlabrador.com&#038;blog=8149074&#038;post=62&#038;subd=mitchlabrador1&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I’ve been fascinated with the ruby syntax for quite sometime now, and have been reading <a href="http://www.humblelittlerubybook.com/book/html/index.html">Mr. Neighborly&#8217;s Humble Little Ruby Book</a> one of the most entertaining books I’ve found on Ruby. It is not meant to be an in-depth reference, instead it provides a no non-sense approach to learning the Ruby syntax and the Ruby way of life interlaced with a lot of humor.</p>
<p>This is part one of the notes I’ve taken as I went through the book. This is something I usually do when learning a new language, and I use it as sort of cheat sheet. </p>
<p><strong>DISCLAIMER: </strong>These are the notes of a .NET Developer learning the Ruby language. These are the concepts as I understand them coming from a .NET background, and may not necessarily be correct.</p>
<p>&#160;</p>
<p><strong>STRINGS:</strong></p>
<p>&#8216;Hello, darling&#8217; &#8211;&gt; single quotes can only contain simple strings (no transformation)</p>
<p>&quot;hello, darling \n \r&quot; &#8211;&gt; double quoted offer more escape sequences</p>
<p>&quot;inches/yard: #{12*3}&quot; &#8211;&gt; inches/yard: 36</p>
<p>&quot;#{&quot;Tora! &quot;*3}&quot;&#160;&#160;&#160;&#160; &#8211;&gt; Tora! Tora! Tora! . You can embed string definitions within other strings </p>
<p>&#160;</p>
<p><strong>NUMBERS:</strong>    <br />-123456789&#160;&#160;&#160;&#160; &#8211;&gt; -123456789 # Fixnum</p>
<p>0d123456789&#160;&#160;&#160;&#160; &#8211;&gt; 1234567890 # Fixnum</p>
<p>1234323424231 &#8211;&gt; 1234323424231&#160;&#160;&#160; # Bignum</p>
<p>0x5C1&#160;&#160;&#160;&#160; &#8211;&gt; 1473&#160;&#160;&#160;&#160; # Hex</p>
<p>01411&#160;&#160;&#160;&#160; &#8211;&gt; 777&#160;&#160;&#160;&#160; # Octal</p>
<p>1_90_33&#160;&#160;&#160;&#160; &#8211;&gt; 19033&#160;&#160;&#160;&#160; # Fixnum </p>
<p>-4.abs&#160;&#160;&#160;&#160; &#8211;&gt; 4 </p>
<p>6.zero?&#160;&#160;&#160;&#160; &#8211;&gt; false </p>
<p>&#160;</p>
<p><strong>COLLECTIONS:</strong>    <br />&#160;&#160;&#160; <strong>RANGE</strong>: Ranges hold a sequential collection of values, such as all numbers between 1 and 9 or the letters from A to Z. A range is created by placing a series of dots between the lower and upper limit     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; 48..81 &#8211;&gt; 48 to 81</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; 48&#8230;81 &#8211;&gt; 48 to 80</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; range === 49 –&gt; true</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; range.include? 49 –&gt; true</p>
<p>&#160;&#160; <strong> ARRAYS:     <br /></strong>&#160;&#160;&#160;&#160;&#160;&#160;&#160; its_so_empty = []</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; oh_so_empty = Array.new</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; hello = ['ni hao', 'bonjour', 'hi', 'howdy']</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; random_types = [13, 'napkin', (1336 + 1).to_s]</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; %W (one two three) &#8211;&gt; [&quot;one&quot;, &quot;two&quot;, &quot;three&quot;]</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; range.to_a &#8211;&gt; Creates an array out of the range</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; my_array &lt;&lt; 20 &#8211;&gt; pushes 20 into the end of the array</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; my_array &lt;&lt; 20 &lt;&lt; 21 &lt;&lt; 22 &#8211;&gt; pushes 20 21 and 22 into the end of the array </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; my_array[0..2] &#8211;&gt; [1, 2, 3]</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; my_array.at(0) –&gt; 1</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; my_array.fetch(999, &quot;Not found!!&quot;) &#8211;&gt; &quot;Not Found!!&quot; . Second parameters returns if element if nil</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; my_array.values_at(0,1,2) &#8211;&gt; [1, 2, 3]</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; my_array.pop &#8211;&gt; removes the last element from the array</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; my_array.shift &#8211;&gt; removes the first element from the array</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; my_array.delete_at(1) &#8211;&gt; deletes item in position 1</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; my_array.delete(1) &#8211;&gt; deletes item with value 1. Returns nil if not found</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; my_array.delete(1) { &quot;Not Found&quot; } &#8211;&gt; deletes item with value 1 and returns &quot;Not found&quot; if the item was not found</p>
<p>&#160;&#160;&#160; <strong>HASH</strong>: Same as a dictionary with any kind of key and value    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; myhash = { &#8216;First&#8217; =&gt; &#8216;This is first&#8217;, &#8216;Second&#8217; =&gt; &#8216;This is second&#8217; }</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; myhash = Hash.new(&quot;not here&quot;) &#8211;&gt; Creates a hash and returns &quot;not here&quot; when a requested key does not exist</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; myhash['new key'] = &quot;this is a new key&quot; &#8211;&gt; adds a new element to the hash</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; myhash.has_key?(&#8216;first&#8217;) &#8211;&gt; determines if the key is found</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; myhash.has_value?(&#8216;value&#8217;) &#8211;&gt; determins if he value is found</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; myhash.empty? &#8211;&gt; true if empty</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; myhash.delete['first'] &#8211;&gt; deletes the item with that name</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; myhash.clear &#8211;&gt; clears the hash</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; myhash.to_a &#8211;&gt; converts to an array of arrays</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; myhash.merge &#8211;&gt; merges with another hash</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; myhash.replace &#8211;&gt; replaces the elements of one hash with another</p>
<p><strong>VARIABLES:     <br /></strong>&#160;&#160;&#160; variable = 7 –&gt; 7</p>
<p>&#160;&#160;&#160; variable = value = 7 –&gt; 7</p>
<p>&#160;&#160;&#160; a, (b, c), d = 10, 11, 12, 13 &#8211;&gt; a == 10, b == 11, c == nil, d == 12</p>
<p>&#160;&#160;&#160; variable += 1 &#8211;&gt; variable = variable + 1</p>
<p>&#160;&#160;&#160; variable -= 1 &#8211;&gt; variable = variable – 1</p>
<p>&#160;</p>
<p><strong>METHODS:     <br /></strong>&#160;&#160;&#160; convention: <strong>methodname?</strong> with question mark at the end is used for querying an attribute i.e. France.has_military_victories? <strong>methodname!</strong> is changing the object that called the method i.e. bob_barker.set_age!(30)</p>
<p>&#160;&#160;&#160; def methodname(param1, param2)   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; #method body    <br />&#160;&#160;&#160; end    <br />&#160;&#160;&#160; def method(a = &quot;this&quot;, b = &quot;is&quot;, c = &quot;fun&quot;)    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; #optional parameters by assigning a default value    <br />&#160;&#160;&#160; end    <br />&#160;&#160;&#160; def method(relation, *names)    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; #*names is a param array    <br />&#160;&#160;&#160; end</p>
<p>&#160;&#160;&#160; return &#8211;&gt; returns a value for the method. If no return element in the method the last value used is returned</p>
<p>&#160;&#160;&#160; return &quot;more&quot;, &quot;than&quot;, &quot;one&quot; &#8211;&gt; returns more than one value</p>
<p>&#160;&#160;&#160; variable1, variable2, variable3 = return &quot;more&quot;, &quot;than&quot;, &quot;one&quot; &#8211;&gt; assigns the return values in order to the variables </p>
<p><strong></strong></p>
<p><strong>BLOCKS:      <br /></strong>&#160;&#160;&#160; *A Block is like a method without a name* = Anonymous function</p>
<p>&#160;&#160;&#160; You can create a block like this:   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; { |Parameter| code&#8230;. } i.e. myarray.each {|element| print &quot;[&quot; + element + &quot;]&#8230;&quot; }    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; do |parameter| code&#8230;. end i.e. myarray.each do |element| print &quot;[&quot; + element + &quot;]&#8230;&quot; end</p>
<p><strong>&#160;&#160;&#160; PROCS:     <br /></strong>&#160;&#160;&#160;&#160;&#160;&#160;&#160; myproc = Porc.new{|animal| puts &quot;Ilove #{animal}!&quot;}    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; myproc.call(&quot;pandas&quot;)</p>
<p><strong>&#160;&#160;&#160; LAMBDAS:     <br /></strong>&#160;&#160;&#160;&#160;&#160;&#160;&#160; myproc = lambda {|x| puts &quot;Argument: #{x}&quot;}    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; myproc.call(&quot;Texas forever!&quot;)</p>
<p><strong>&#160;&#160;&#160; Diferences between Procs and Labdas:     <br /></strong>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8211; Labdas are strict on the number of arguments when calling    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8211; Procs make the method that executes them return immediately. Lambda&#8217;s don&#8217;t yield gives control back to the caller before continuing. Perfect for loops that execute an anonymous function. If in a loop and you call yield inside the loop you can pass the item of the current iteration as an argument to yield, execute the caller code and return after the yield statement inside the loop when the caller is finished executing.</p>
<p>&#160;&#160;&#160; If you prepend a method parameter with <strong>&amp;</strong> it makes that parameter a Proc automatically</p>
<p>&#160;&#160;&#160; Example: </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; def method(&amp;block)   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; block.call    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; yield    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; end</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; method { print &quot;I&#8217;m gettin&#8217; called! &quot; } &#8211;&gt; I&#8217;m gettin&#8217; called! I&#8217;m gettin&#8217; called!</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; By using yield, you allow the calling statment to be executed again after the block.call</p>
<p>&#160;</p>
<p><strong>CLASSES:     <br /></strong>&#160;&#160;&#160; class MyFirstClass &lt; Object    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; #creates a class that&#160; inherits from object. Object inheretance is optional, this happens by default.    <br />&#160;&#160;&#160; end</p>
<p>&#160;&#160;&#160; def initialize (optional parameters)   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; # this is the constructor&#160;&#160;&#160; <br />&#160;&#160;&#160; end</p>
<p>&#160;&#160;&#160; MyFirstClass.new &#8211;&gt; creates the class</p>
<p>&#160;&#160;&#160; MyfirstClass.new(parameters) &#8211;&gt; creates the class with a certain constructor</p>
<p>&#160;&#160;&#160; @variable &#8211;&gt; These are class instance level variables. Private, not visible to the outside   <br />&#160;&#160;&#160; self points to the current instance</p>
<p>&#160;&#160;&#160; Classes are never closed. You can add functionality to the string class for instance by simply adding this.</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; class String   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; def NewMethod&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; #same as extension methods in C#    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; end    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; end </p>
<p>&#160;&#160;&#160; Attributes / Properties:   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; #readonly property is just another method. Remember that the last value in a method is returned.    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; def prop1    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; @prop1    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; end</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; #read/write property   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; def prop1    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; @prop1    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; end</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; def prop1=(value)   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; @prop1=value    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; end</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; #how to write an automatic property. This simply creates the get and set definitions for prop1   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; attr_writer :prop1    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; attr_reader :prop1</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; #you can also do this. And vice versa for attr_reader. </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; attr_writer :prop1</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; def prop1   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; #do some processing before returning    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; newval = @prop1 + 1    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; newval    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; end</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; *attr_writer and attr_reader simply make it easier to defin a collection of automatic properties&#8217; get and set methods</p>
<p>&#160;&#160; <strong> Scope:     <br /></strong>&#160;&#160;&#160;&#160;&#160;&#160;&#160; When you add the protect keyword to the file in a new line, all the methods that come after it are marked protected, visible by self and derived classes only. You can change back to the the default (public) by adding public to a new line in the file. All methods after that will be public. Same with private.</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; class Myclass</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; protected # only self derived classes will have access to methods after this line</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; def protectedmethod1   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; end</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; def protectedmethod2   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; end</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; public # methods after this line are marked pubilc</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; def publicmethod1   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; end</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; def publicmethod2   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; end</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; private #methods after this line can only be accesed by self</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; def privatemethod1   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; end</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; def privatemethod2   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; end</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; end</p>
<p><strong>&#160;&#160;&#160; Constants:     <br /></strong>&#160;&#160;&#160;&#160;&#160;&#160;&#160; Simply add the variable directly underneath the class object.</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; class MyClass   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; CONSTANT_VARIABLE = &quot;test&quot;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; def TestMethod    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; CONSTANT_VARIABLE    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; end    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; end</p>
<p><strong>&#160;&#160;&#160; Class Methods (Static / Shared methods)</strong></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; class MyClass   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; def MyClass.ClassMethod1    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; #this is method is a class wide method. available oustide the isntance class    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; end    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; end</p>
<p><strong>&#160;&#160;&#160; Class Variables (Static / Shared fields)     <br /></strong>&#160;&#160;&#160;&#160;&#160;&#160;&#160; Two @@ before the name make it a class wide field that lives outside of the instance class</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; class MyClass   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; def MyClass.ClassMethod1    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; #this is method is a class wide method. available oustide the isntance class    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; @@classfield1    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; end    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; end</p>
<p><strong>&#160;&#160;&#160; Modules (Kind of like namespace, but better, more like on the fly inheritance / extension methods / partial classes all in one)</strong></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; All you have to do is use <strong>include ModuleName</strong> to bring in the functionality of the module into your new class</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; module Movement&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; def run    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; puts &quot;I&#8217;m running&quot;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; end    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; def walk    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; puts &quot;I&#8217;m walking&quot;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; end    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; def crawl    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; puts &quot;I&#8217;m so slowwww!&quot;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; end&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; end</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; class Man   <br /><strong>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; include Movement     <br /></strong>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; def jump    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; puts &quot;I&#8217;m bipedal and I can jump like a fool!&quot;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; end    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; end</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; class Sloth   <br /><strong>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; include Movement     <br /></strong>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; def flop    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; puts &quot;It&#8217;s all a lie&#8230;all I can do is flop around.&quot;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; end    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; end</p>
<p><strong>&#160;&#160;&#160; Files     <br /></strong>&#160;&#160;&#160;&#160;&#160;&#160;&#160; You can bring in other files by adding using load or require. Diference is that require only loads it once. Load loads regardless if it has already been loaded. Require is more like signaling a reference need in case it has not already been preloaded.</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; load &quot;libraries/myfile.rb&quot;   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; require &quot;/home/myaccount/code/libraries/myotherfile.rb&quot;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mitchlabrador1.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mitchlabrador1.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mitchlabrador1.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mitchlabrador1.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mitchlabrador1.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mitchlabrador1.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mitchlabrador1.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mitchlabrador1.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mitchlabrador1.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mitchlabrador1.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mitchlabrador1.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mitchlabrador1.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mitchlabrador1.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mitchlabrador1.wordpress.com/62/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mitchlabrador.com&#038;blog=8149074&#038;post=62&#038;subd=mitchlabrador1&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mitchlabrador.com/2010/08/11/learning-ruby-through-the-eyes-of-a-net-developer-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cb2641556206d241be4a511c963d7c4a?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">mitchlabrador</media:title>
		</media:content>
	</item>
		<item>
		<title>BigfootMVC: A module development alternative for DotNetNuke &#8211; Part 1: Overview</title>
		<link>http://mitchlabrador.com/2010/07/19/bigfootmvc-a-module-development-alternative-for-dotnetnuke-part-1-overview/</link>
		<comments>http://mitchlabrador.com/2010/07/19/bigfootmvc-a-module-development-alternative-for-dotnetnuke-part-1-overview/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 13:43:42 +0000</pubDate>
		<dc:creator>Mitch Labrador</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">https://mitchlabrador1.wordpress.com/2010/07/19/bigfootmvc-a-module-development-alternative-for-dotnetnuke-part-1-overview/</guid>
		<description><![CDATA[What is BigfootMVC? BigfootMVC is an MVC style development framework developed for DotNetNuke. It’s main goal is to increase your productivity while keeping a high degree of maintainability. This is the first in a series of posts regarding BigfootMVC. In this post I will concentrate in giving you the history as well as the goals [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mitchlabrador.com&#038;blog=8149074&#038;post=58&#038;subd=mitchlabrador1&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>What is BigfootMVC? </strong>BigfootMVC is an MVC style development framework developed for DotNetNuke. It’s main goal is to increase your productivity while keeping a high degree of maintainability.</p>
<p>This is the first in a series of posts regarding BigfootMVC. In this post I will concentrate in giving you the history as well as the goals and reasons behind BigfootMVC. In my later posts, I will focus on the technical details. Starting with how you would actually implement BigfootMVC when developing your module, and ending with a detail look at the architecture of the framework.</p>
<p>Last year I developed a commercial module for DotNetNuke named <a href="http://tribalhut.com" target="_blank">Tribalhut CRM</a>. Although this was my first commercial module for DotNetNuke, I had been developing modules for DNN for a while since version 2x in fact. DotNetNuke IMHO is the best level 2 development platform for .NET. Not just because of its robust architecture, but also the huge amount of modules you can leverage when building your site… but back to the topic at hand, although I had been using the development model prescribed for DNN, it never felt natural to me for many reasons, it felt … clunky … heavy, so I endeavored to create a <strong>better way for me</strong> to build my modules. I had been using ASP.NET MVC since Preview 3 and found it to be just perfect for my development style, so i figured why not build an MVC framework for DNN.</p>
<p>I had four major goals as I headed into the development of this framework:</p>
<p>1. <strong>Everything You Need Nothing You Don’t</strong>. The framework would grow overtime as functionality was needed, <strong>no pie in the sky design.</strong></p>
<p>2. <strong>Improve my productivity</strong>. This was key as I only had a limited amount of time to finish Tribalhut so I needed a framework that made it fast to develop my module.</p>
<p>3. <strong>Develop an end to end experience</strong>. Not just the backend code, but also a strong CSS and Javascript collection to aid in the development experience. This was key for productivity.</p>
<p>4. <strong>Must work with ASP.NET 2.0 and above</strong>. I wanted to support DNN version 4.6.2 and above so this was paramount. Unfortunately no LINQ goodness was available.</p>
<p>I spent 75% of my allotted time for Tribalhut writing the framework … as you can imagine I was starting to really get nervous at that point, but I managed to write the app using only the remaining 25% of the budgeted time. That’s when I knew I was really on to something, so I decided the right thing to do – considering I had been using DotNetNuke for a long time without paying a dime – was to open source my work so that other developers could also benefit from it.</p>
<p>Several months ago I told Will Strohl (<a href="http://twitter.com/willstrohl">twitter@willstrohl</a>), at the time the president of the Orlando DotNetNuke User group, about my framework and my plans to open source it, so naturally he urged me to do so, I had never open sourced any of my code, so I was/am very nervous about the whole experience, so it took a little while for me to warm up to the idea <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  but he finally together with <a href="http://twitter.com/darrellhardy">Darrell Hardy</a> cornered me and got me do a talk on it for our June user group meeting.</p>
<p>Like all developers that look at their code three weeks after writing it, I decided that it needed to be re-factored… cleaned up… and improved. So I ended up re-writing 2/3s of it for my presentation. The group members seemed to really like it which inspired me to really kick it up a notch and make it a first class development alternative for DNN. Previously my framework was a code based dependency, which means that you would drop the code into your project and it would compile within your namespace. It was written in VB as that was the language we had decided to write Tribalhut in.</p>
<p><strong>There were several problems with my approach at this point that needed to be remedied:</strong></p>
<p>1. It was a code based dependency, which means that it only allowed for modules to be developed in the language the framework was written in, as it needed to be dropped-in and compiled with your module.</p>
<p>2. It worked great for advanced module developers, but made it a little harder as a getting started alternative for DNN</p>
<p>3. The codebase was not well documented, worked great for me as I knew how everything worked <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  but not so much for a new user trying to figure it out</p>
<p>4. There were issues with multiple modules co-existing in the same tab. It was best suited for writing modules that owned the whole tab, which was fine for Tribalhut but not so much for general purpose module development.</p>
<p>So after my presentation in June I decided that another re-write was needed &#8211; yes I know, again &#8211; in order to solve these issues before the framework would be ready for alpha release. So that’s what I did.</p>
<p><strong>Step 1: Organize the data provider / model tier</strong></p>
<p>I pulled my previously created data access framework named Bigfoot<strong>SQL</strong> – which I also open sourced as a result of this – into its own library project written in C#. I had two main external dependencies, one was <a href="http://json.codeplex.com">JSON.NET</a>, and the other was <a href="http://tnvalidate.codeplex.com">TNValidate</a>, two open source projects. As these were open source and were also written in C#, i decided to included them in my BigfootSQL library project and namespace them under BigfootSQL in order to eliminate any conflicts with other modules that might be using a different version of JSON.NET out there, there are actually a few. They fit very well together as they both have to do with data persistence and validation, so it felt natural to package them together in the model tier. Another reason to split them into their own project, was that I use the BigfootSQL library in many other .net projects, that are not … dare I say it… DotNetNuke related <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  so I wanted to reuse it.</p>
<p><strong>Step 2: Organize my Html helpers and other web development helpers into their own library</strong></p>
<p>I have a collection of helper functions that I use in all my ASP.NET projects, not just DNN development, that I wanted to reuse, so I create another library project named BigfootWeb. This library would be reusable across all asp.net development, and could also be used by BigfootMVC for DNN.</p>
<p>The BigfootWeb assembly also includes the Html and JavaScript helpers. These helpers I consider to be the number one productivity boost. You will see in my next detailed technical post just how productive these helpers can make you, not just for DotNetNuke development but for any asp.net develop in general.</p>
<p><strong>Step 3: Organize all DotNetNuke specific code into the BigfootDNN library </strong></p>
<p>This is the heart of the BigfootMVC  framework for DNN. It performs all of the route handling and activation, as well as all the mapping and execution of actions. It understands DNN and makes it extremely simple to write modules that have very advanced feature sets.</p>
<p>As I mentioned before, the biggest productivity enhancement, comes from the Html and JavaScript helpers, so I figured why not also make them available to users that want to write DotNetNuke modules using the traditional ASP.NET control model, rather than an MVC model. Furthermore why not have a project that mixes and matches the two as needed. This would provide for a great gradual migration story. So I did that as well.</p>
<p>This is why I named my library BigfootDNN rather than BigfootMVC, that is because you can do any type of DNN development not just MVC following a simple set of patterns in your module. This option gives you access to the huge productivity enhancements that can come from writing a web 2.0 application using the Html and JavaScript helpers.</p>
<p><strong>Step 4: Create a solid Javascript framework</strong></p>
<p>Let me just say this… I don’t love JavaScript, but I can’t seem to get away from it, so might as well make it easy to work with. I use the following plugins to simplify my JavaScript existence: jQuery, jQuery.Form, jQuery.Validate, and REQ.</p>
<p>REQ is the main loader and it handles the proper checking and loading of all javascript dependencies by using the dependency map. It won’t load jQuery if it is already loaded, same for all the other plugins. This ensures that if there are multiple BigfootMVC modules on the page, the references will be loaded only once.</p>
<p>If you are using the MVC model, then you don’t have to do anything, all these dependencies are automatically properly referenced for you. If you are using the classic DNN model then you just need to add this single line to the top of your control.</p>
<p>&lt;%=DnnApp.AddBigfootScriptAndCssDependencies()%&gt;</p>
<p><strong>Step 5: Create a resistant CSS framework</strong></p>
<p>I highlight resistant as this seems to be one of the more frustrating aspects of creating a commercial module since you can’t predict what the skin will look like, or if the skin will work properly. Bottom line is that you need your module to look consistently good even on crappy skins.</p>
<p>The second aspect of being a good DNN module citizen is making sure that your CSS does not bleed out into the skin. This is extremely important as you don’t want your module CSS to screw up anything that gets loaded after your module.</p>
<p>The CSS stylesheet in BigfootMVC has a module level reset, as well as class selectors than when utilized will ensure that these styles take precedence. Styles are module specific which means that it won’t bleed out into other modules in the site.</p>
<p>It includes common alignment, proper floating for IE6+ , common sizing for the basics of  a grid system, the reset is based on Eric Meyer’s reset, proper typing, margin, and font size presets as well as many other all purpose utility classes you can use, like text alignment, etc.</p>
<p><strong>Step 6: Create a project template that makes it dead simple to get started</strong></p>
<p>I’m working on this and should be ready soon.</p>
<p><strong> </strong></p>
<p><strong>Summary</strong></p>
<p>This redesign enables a more reusable codebase that can be used to support not just DNN development but any other type of ASP.NET development. BigfootMVC will make it extremely simple to create new applications by simply referencing three DLLs in your DNN project. I’ll show you how to this in my next blog post.</p>
<p>You can browse the source code here <a href="http://bigfoot.codeplex.com">http://bigfoot.codeplex.com</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mitchlabrador1.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mitchlabrador1.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mitchlabrador1.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mitchlabrador1.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mitchlabrador1.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mitchlabrador1.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mitchlabrador1.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mitchlabrador1.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mitchlabrador1.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mitchlabrador1.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mitchlabrador1.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mitchlabrador1.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mitchlabrador1.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mitchlabrador1.wordpress.com/58/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mitchlabrador.com&#038;blog=8149074&#038;post=58&#038;subd=mitchlabrador1&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mitchlabrador.com/2010/07/19/bigfootmvc-a-module-development-alternative-for-dotnetnuke-part-1-overview/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cb2641556206d241be4a511c963d7c4a?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">mitchlabrador</media:title>
		</media:content>
	</item>
	</channel>
</rss>
