<?xml version="1.0" encoding="utf-16"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Daily Coding</title><link>http://www.dailycoding.com</link><description>Daily Coding</description><copyright>Copyright 2019 dailycoding.com. All rights reserved.</copyright><item><title>Poster swing  – A jQuery plug-in for Poster Style Swing</title><comments>http://www.dailycoding.com/Posts/poster_swing_jquery_plug_in_for_poster_style_swing.aspx#comments</comments><dc:creator>Ramesh Soni</dc:creator><category>Design</category><description>
&lt;script src="http://www.dailycoding.com/Uploads/2014/04/posterSwing/jquery.posterSwing.min.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;script&gt;
    $(function () {
        $("#demo1").click(function () {
            $(this).prev().posterSwing();
        });

        $("#demo2").click(function () {
            $(this).prev().posterSwing({
                angle: 10
            });
        });

        $("#demo3").click(function () {
            $(this).prev().posterSwing({
                duration: 2000
            });
        });

        $("#demo4").click(function () {
            $(this).prev().posterSwing({
                duration: 16000
            });
        });

        $("#demo5").click(function () {
            $(this).prev().posterSwing({
                swingCenter: "50% 50%"
            });
        });

        $("#demo6").click(function () {
            $(this).prev().posterSwing({
                swingCenter: "50% 100%"
            });
        });

        $("#demo7").click(function () {
            $("body").posterSwing({
                duration: 2000,
                angle: 10
            });
        });

        $("#demo8").click(function () {
            $(this).next("pre").posterSwing();
        });

        $("#demo9").click(function () {
            $(this).posterSwing();
        });
    });
&lt;/script&gt;
&lt;style&gt;
    .ps-demo input { padding: 4px 8px; margin: 8px 0; font-size: 16px; }
    .ps-demo .container { overflow: hidden; overflow: visible; clear: both; }
    .ps-demo .demo { margin: 10px 0; float: left; min-width: 250px; clear: both; }
    .ps-demo .demo &gt; p { margin: 0; font-size: 16px; font-weight: bold; }
    .ps-demo .demo &gt; div {width: 250px; height: 300px; background-color: red; margin: 10px 0; border-radius: 8px; background-image: url('http://www.dailycoding.com/Uploads/2014/04/posterSwing/bg.jpg'); background-position: center center;}
&lt;/style&gt;

&lt;p&gt;
    &lt;table&gt;&lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;
        &lt;div class="downloadSource"&gt;&lt;a href="http://www.dailycoding.com/Uploads/2014/04/posterSwing/demo.html"&gt;View Demo&lt;/a&gt;&lt;/div&gt;
      &lt;/td&gt;

      &lt;td&gt;
        &lt;div class="downloadSource"&gt;&lt;a href="http://www.dailycoding.com/Uploads/2014/04/posterSwing/posterSwing.zip"&gt;Download Source Files&lt;/a&gt;&lt;/div&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;

    &lt;p&gt;
        Poster swing plugin can be used for adding poster swing effect on html elements. 
    The plugin uses rotation transform for adding the swing effect. See 
    &lt;a href="http://caniuse.com/#feat=transforms2d" rel="nofollow"&gt;http://caniuse.com/#feat=transforms2d&lt;/a&gt;
        to check which browser will support this.
    &lt;/p&gt;

    &lt;h3&gt;Usage&lt;/h3&gt;
    &lt;p&gt;
        You must include &lt;code&gt;jQuery.js&lt;/code&gt; and &lt;code&gt;jquery.posterSwing.js&lt;/code&gt; (or 
    &lt;code&gt;jquery.posterSwing.min.js&lt;/code&gt;) in you web page in order to use this plugin.
    &lt;/p&gt;
    &lt;pre&gt;&amp;lt;script src="jquery.min.js" type="text/javascript"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script src="jquery.posterSwing.min.js" type="text/javascript"&amp;gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;


    &lt;p&gt;For adding poster swing effect to any html element, use following with jQuery selector -&lt;/p&gt;

    &lt;pre&gt;$(function () {            
    $("#myDiv").posterSwing([options]);
});&lt;/pre&gt;

    &lt;p&gt;
        Currently following options are available -
        &lt;ul&gt;
             &lt;li&gt;&lt;code&gt;duration&lt;/code&gt; : &lt;em&gt;(default value 4000)&lt;/em&gt;
                 &lt;br /&gt;total duration (in milliseconds) for which the animation will run.
                 &lt;br /&gt;&amp;nbsp;
             &lt;/li&gt;
             &lt;li&gt;&lt;code&gt;angle&lt;/code&gt; : &lt;em&gt;(default value 30)&lt;/em&gt;
                 &lt;br /&gt;max angle to which the swing will be done.
                 &lt;br /&gt;&amp;nbsp;
             &lt;/li&gt;
             &lt;li&gt;&lt;code&gt;swingCenter&lt;/code&gt; : &lt;em&gt;(default value top center = 50% 5%)&lt;/em&gt;
                 &lt;br /&gt;x, y value of the center around which swing will be done - can be in px or %.&lt;/li&gt;
        &lt;/ul&gt;
    &lt;/p&gt;
    
    &lt;!--more--&gt;
    
    &lt;h3&gt;Demo&lt;/h3&gt;
    &lt;div class="ps-demo"&gt;
        &lt;div class="container"&gt;
    &lt;div class="demo"&gt;
        &lt;p&gt;Default&lt;/p&gt;
        &lt;div&gt;&amp;nbsp;&lt;/div&gt;
        &lt;input id="demo1" type="button" value="Demo" /&gt;
        &lt;pre&gt;$(element).posterSwing();&lt;/pre&gt;
    &lt;/div&gt;
    &lt;div class="demo"&gt;
        &lt;p&gt;Small angle&lt;/p&gt;
        &lt;div&gt;&amp;nbsp;&lt;/div&gt;
        &lt;input id="demo2" type="button" value="Demo" /&gt;
        &lt;pre&gt;$(element).posterSwing({
    angle: 10
});&lt;/pre&gt;
    &lt;/div&gt;
    &lt;div class="demo"&gt;
        &lt;p&gt;Fast&lt;/p&gt;
        &lt;div&gt;&amp;nbsp;&lt;/div&gt;
        &lt;input id="demo3" type="button" value="Demo" /&gt;
        &lt;pre&gt;$(element).posterSwing({
    duration: 2000,
    angle: 10
});&lt;/pre&gt;
    &lt;/div&gt;

    &lt;div class="demo"&gt;
        &lt;p&gt;Slow&lt;/p&gt;
        &lt;div&gt;&amp;nbsp;&lt;/div&gt;
        &lt;input id="demo4" type="button" value="Demo" /&gt;
        &lt;pre&gt;$(element).posterSwing({
    duration: 16000
});&lt;/pre&gt;
    &lt;/div&gt;
    &lt;div class="demo"&gt;
        &lt;p&gt;Custom swing center - 1&lt;/p&gt;
        &lt;div&gt;&amp;nbsp;&lt;/div&gt;
        &lt;input id="demo5" type="button" value="Demo" /&gt;
        &lt;pre&gt;$(element).posterSwing({
    swingCenter: "50% 50%"
});&lt;/pre&gt;
    &lt;/div&gt;
    &lt;div class="demo"&gt;
        &lt;p&gt;Custom swing center - 2&lt;/p&gt;
        &lt;div&gt;&amp;nbsp;&lt;/div&gt;
        &lt;input id="demo6" type="button" value="Demo" /&gt;
        &lt;pre&gt;$(element).posterSwing({
    swingCenter: "50% 100%"
});&lt;/pre&gt;
    &lt;/div&gt;

    &lt;div class="demo"&gt;
        &lt;p&gt;Whole body&lt;/p&gt;
        &lt;input id="demo7" type="button" value="Demo" /&gt;
        &lt;pre&gt;$("body").posterSwing({
    duration: 2000,
    angle: 10
});&lt;/pre&gt;
    &lt;/div&gt;
    &lt;div class="demo"&gt;
        &lt;p&gt;Source code&lt;/p&gt;
        &lt;input id="demo8" type="button" value="Demo" /&gt;
        &lt;pre&gt;/*
  this code will be 
  poster swing
*/
$(this).next("pre")
  .posterSwing();&lt;/pre&gt;
    &lt;/div&gt;
     &lt;div class="demo"&gt;
        &lt;p&gt;Button&lt;/p&gt;
        &lt;input id="demo9" type="button" value="Demo" /&gt;
        &lt;pre&gt;$(this).posterSwing();&lt;/pre&gt;
    &lt;/div&gt;
&lt;/div&gt;
    &lt;/div&gt;
    &lt;p&gt;
        &lt;hr /&gt;
	Image courtesy &lt;a href="http://www.smashingmagazine.com/"&gt;http://www.smashingmagazine.com/&lt;/a&gt;
    &lt;/p&gt;
    &lt;p&gt;
        You can view full usage and demonstration on the demo page - http://demo.com
    &lt;/p&gt;

    &lt;table&gt;&lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;
        &lt;div class="downloadSource"&gt;&lt;a href="http://www.dailycoding.com/Uploads/2014/04/posterSwing/demo.html"&gt;View Demo&lt;/a&gt;&lt;/div&gt;
      &lt;/td&gt;

      &lt;td&gt;
        &lt;div class="downloadSource"&gt;&lt;a href="http://www.dailycoding.com/Uploads/2014/04/posterSwing/posterSwing.zip"&gt;Download Source Files&lt;/a&gt;&lt;/div&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;&lt;/p&gt;
</description><link>http://www.dailycoding.com/Posts/poster_swing_jquery_plug_in_for_poster_style_swing.aspx</link><pubDate>Tue, 15 Apr 2014 00:00</pubDate></item><item><title>EasyTimer - JavaScript style setTimeout and setInterval in C#</title><comments>http://www.dailycoding.com/Posts/easytimer__javascript_style_settimeout_and_setinterval_in_c.aspx#comments</comments><dc:creator>Ramesh Soni</dc:creator><category>General</category><description>&lt;div class="downloadSource"&gt;&lt;a href="http://www.dailycoding.com/Uploads/2012/10/EasyTimer.zip"&gt;Download Source Files&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;I found JavaScript setTimeout and setInterval functions quite handy for timer like functionality and some time wish I could use that in C# too. In an &lt;a href="http://www.dailycoding.com/Posts/object_oriented_programming_with_javascript__timer_class.aspx"&gt;earlier post&lt;/a&gt; I create a C# like timer functionality in JavaScript. Now, I want to do opposite i.e. implement JavaScript setTimeout and setInterval like functionality in C#.&lt;/p&gt;

&lt;p&gt;This is can be done very easily using Lamda expressions and Timer. Look at the below utility class -&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System;
&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Collections.Generic;
&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Linq;
&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Text;

&lt;span class="kwrd"&gt;namespace&lt;/span&gt; DailyCoding.EasyTimer
{
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; EasyTimer
    {
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; IDisposable SetInterval(Action method, &lt;span class="kwrd"&gt;int&lt;/span&gt; delayInMilliseconds)
        {
            System.Timers.Timer timer = &lt;span class="kwrd"&gt;new&lt;/span&gt; System.Timers.Timer(delayInMilliseconds);
            timer.Elapsed += (source, e) =&amp;gt;
            {
                method();
            };

            timer.Enabled = &lt;span class="kwrd"&gt;true&lt;/span&gt;;
            timer.Start();

            &lt;span class="rem"&gt;// Returns a stop handle which can be used for stopping&lt;/span&gt;
            &lt;span class="rem"&gt;// the timer, if required&lt;/span&gt;
            &lt;span class="kwrd"&gt;return&lt;/span&gt; timer &lt;span class="kwrd"&gt;as&lt;/span&gt; IDisposable;
        }

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; IDisposable SetTimeout(Action method, &lt;span class="kwrd"&gt;int&lt;/span&gt; delayInMilliseconds)
        {
            System.Timers.Timer timer = &lt;span class="kwrd"&gt;new&lt;/span&gt; System.Timers.Timer(delayInMilliseconds);
            timer.Elapsed += (source, e) =&amp;gt;
            {
                method();
            };

            timer.AutoReset = &lt;span class="kwrd"&gt;false&lt;/span&gt;;
            timer.Enabled = &lt;span class="kwrd"&gt;true&lt;/span&gt;;
            timer.Start();

            &lt;span class="rem"&gt;// Returns a stop handle which can be used for stopping&lt;/span&gt;
            &lt;span class="rem"&gt;// the timer, if required&lt;/span&gt;
            &lt;span class="kwrd"&gt;return&lt;/span&gt; timer &lt;span class="kwrd"&gt;as&lt;/span&gt; IDisposable;
        }
    }
}&lt;/pre&gt;
&lt;!--more--&gt;
&lt;p&gt;To use setTimeout this you can simply do -&lt;/p&gt;

&lt;pre class="csharpcode"&gt;EasyTimer.SetTimeout(() =&amp;gt;
{
    &lt;span class="rem"&gt;// --- You code here ---&lt;/span&gt;
    &lt;span class="rem"&gt;// This piece of code will once after 1000 ms delay&lt;/span&gt;

}, 1000);&lt;/pre&gt;

&lt;p&gt;The code will run after 1000 ms delay similarly like JavaScript setTimeout. The function also returns a handle. If you want clearTimeout like functionality, then the simply dispose off the handle. 
  &lt;br /&gt;&lt;/p&gt;

&lt;pre class="csharpcode"&gt;var stopHandle = EasyTimer.SetTimeout(() =&amp;gt;
{
    &lt;span class="rem"&gt;// --- You code here ---&lt;/span&gt;
    &lt;span class="rem"&gt;// This piece of code will once after 1000 ms&lt;/span&gt;

}, 1000);

&lt;span class="rem"&gt;// In case you want to clear the timeout&lt;/span&gt;
stopHandle.Dispose();&lt;/pre&gt;

&lt;p&gt;Similarly you can use setInterval as -&lt;/p&gt;

&lt;pre class="csharpcode"&gt;EasyTimer.SetInterval(() =&amp;gt;
{
    &lt;span class="rem"&gt;// --- You code here ---&lt;/span&gt;
    &lt;span class="rem"&gt;// This piece of code will run after every 1000 ms&lt;/span&gt;

}, 1000);&lt;/pre&gt;

&lt;p&gt;and SetInterval also returns a stop handle which you can use for clearInterval like functionality. Just dispose off the handle -&lt;/p&gt;

&lt;pre class="csharpcode"&gt;var stopHandle = EasyTimer.SetInterval(() =&amp;gt;
    {
        &lt;span class="rem"&gt;// --- You code here ---&lt;/span&gt;
        &lt;span class="rem"&gt;// This piece of code will run after every 1000 ms&lt;/span&gt;
        &lt;span class="rem"&gt;// To stop the timer, just dispose off the stop handle&lt;/span&gt;

    }, 1000);

&lt;span class="rem"&gt;// In case you want to clear the interval&lt;/span&gt;
stopHandle.Dispose();&lt;/pre&gt;
&lt;div class="downloadSource"&gt;&lt;a href="http://www.dailycoding.com/Uploads/2012/10/EasyTimer.zip"&gt;Download Source Files&lt;/a&gt;&lt;/div&gt;</description><link>http://www.dailycoding.com/Posts/easytimer__javascript_style_settimeout_and_setinterval_in_c.aspx</link><pubDate>Wed, 03 Oct 2012 05:00</pubDate></item><item><title>ImageLens – A jQuery plug-in for Lens Effect Image Zooming</title><comments>http://www.dailycoding.com/Posts/imagelens__a_jquery_plugin_for_lens_effect_image_zooming.aspx#comments</comments><dc:creator>Ramesh Soni</dc:creator><category>Design</category><description>&lt;script src="http://www.dailycoding.com/Uploads/2011/03/imageLens/jquery.imageLens.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;script type="text/javascript" language="javascript"&gt;
	$(function () {
		$("#img_01").imageLens();
		$("#img_02").imageLens({ lensSize: 200 });
		$("#img_03").imageLens({ imageSrc: "http://www.dailycoding.com/Uploads/2011/03/imageLens/sample01.jpg" });
		$("#img_04").imageLens({ borderSize: 8, borderColor: "#06f" });
	});	
&lt;/script&gt;

&lt;table&gt;&lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;
        &lt;div class="downloadSource"&gt;&lt;a href="http://www.dailycoding.com/Uploads/2011/03/imageLens/demo.html"&gt;View Demo&lt;/a&gt;&lt;/div&gt;
      &lt;/td&gt;

      &lt;td&gt;
        &lt;div class="downloadSource"&gt;&lt;a href="http://www.dailycoding.com/Uploads/2011/03/imageLens.zip"&gt;Download Source Files&lt;/a&gt;&lt;/div&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;I was searching a good jQuery plug-in for image zooming but couldn't find any which was matching my criteria. I need the lens effect while zooming images and it should work without much plumbing. So, I decided to create one and now sharing this with everyone.&lt;/p&gt;

&lt;h3&gt;What I need to use this?&lt;/h3&gt;

&lt;ol&gt;
  &lt;li&gt;jQuery &lt;/li&gt;

  &lt;li&gt;ImageLens plug-in – jquery.imagelens.js &lt;/li&gt;

  &lt;li&gt;An image &lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;How to use this?&lt;/h3&gt;

&lt;p&gt;Include jQuery and jquery.imageLens.js in you web page -&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;script&lt;/span&gt; &lt;span class="attr"&gt;src&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;jquery.js&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;script&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&amp;lt;script src=&lt;span class="str"&gt;&amp;quot;jquery.imageLens.js&amp;quot;&lt;/span&gt; type=&lt;span class="str"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&amp;gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;script&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;For default image lens just use imageLens as below. Note that it will automatically calculate actual size of image and start showing zooming -&lt;/p&gt;
&lt;!--more--&gt;
&lt;pre class="csharpcode"&gt;$(&lt;span class="str"&gt;&amp;quot;#img_01&amp;quot;&lt;/span&gt;).imageLens();&lt;/pre&gt;
&lt;p&gt;
    &lt;h4 style="color: red;"&gt;Note - If you are using IE 8 or lower than you will see a square lens&lt;/h4&gt;
    &lt;i&gt;(hover on image to see the lens effect)&lt;/i&gt;&lt;br /&gt;
    &lt;img id="img_01" src="http://www.dailycoding.com/Uploads/2011/03/imageLens/sample01.jpg" width="384" height="240" /&gt;
&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you thumbnail&amp;#160; image is different from zoomed image then you can specify custom image source -&lt;/p&gt;

&lt;pre class="csharpcode"&gt;$(&lt;span class="str"&gt;&amp;quot;#img_03&amp;quot;&lt;/span&gt;).imageLens({ imageSrc: &lt;span class="str"&gt;&amp;quot;sample01.jpg&amp;quot;&lt;/span&gt; });&lt;/pre&gt;
&lt;p&gt;
    &lt;i&gt;(hover on image to see the lens effect)&lt;/i&gt;&lt;br /&gt;
    &lt;img id="img_03" src="http://www.dailycoding.com/Uploads/2011/03/imageLens/sample01_s.jpg" width="384" height="240" /&gt;
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can also change lens size -&lt;/p&gt;

&lt;pre class="csharpcode"&gt;$(&lt;span class="str"&gt;&amp;quot;#img_02&amp;quot;&lt;/span&gt;).imageLens({ lensSize: 200 });&lt;/pre&gt;
&lt;p&gt;
    &lt;i&gt;(hover on image to see the lens effect)&lt;/i&gt;&lt;br /&gt;
    &lt;img id="img_02" src="http://www.dailycoding.com/Uploads/2011/03/imageLens/sample01.jpg" width="384" height="240" /&gt;
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There are some more attributes you can adjust in the lens like border color and border size -&lt;/p&gt;

&lt;pre class="csharpcode"&gt;$(&lt;span class="str"&gt;&amp;quot;#img_04&amp;quot;&lt;/span&gt;).imageLens({ borderSize: 8, borderColor: &lt;span class="str"&gt;&amp;quot;#06f&amp;quot;&lt;/span&gt; });&lt;/pre&gt;
&lt;p&gt;
    &lt;i&gt;(hover on image to see the lens effect)&lt;/i&gt;&lt;br /&gt;
    &lt;img id="img_04" src="http://www.dailycoding.com/Uploads/2011/03/imageLens/sample01.jpg" width="384" height="240" /&gt;
&lt;/p&gt;

&lt;p&gt;Image courtesy &lt;a href="http://www.smashingmagazine.com/"&gt;http://www.smashingmagazine.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;
  &lt;div style="background-color: LightYellow; padding: 8px; border: dashed 1px #a1a1a1;"&gt;
    &lt;h3&gt;Updates&lt;/h3&gt;
    &lt;p&gt;1. &lt;a href="http://voigt.se/sandbox/imageLens/demo3.html"&gt;Optimized plug-in code for size and performance&lt;/a&gt; -
    By Andreas
    &lt;br /&gt;
    2. &lt;a href="http://blog.bobslaede.dk/2011/04/jquery-imagelens-plugin.html"&gt;Round lens support in IE8 or below&lt;/a&gt; -
    By Jeppe
    &lt;/p&gt;
  &lt;/div&gt;
&lt;/p&gt;

&lt;table&gt;&lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;
        &lt;div class="downloadSource"&gt;&lt;a href="http://www.dailycoding.com/Uploads/2011/03/imageLens/demo.html"&gt;View Demo&lt;/a&gt;&lt;/div&gt;
      &lt;/td&gt;

      &lt;td&gt;
        &lt;div class="downloadSource"&gt;&lt;a href="http://www.dailycoding.com/Uploads/2011/03/imageLens.zip"&gt;Download Source Files&lt;/a&gt;&lt;/div&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;</description><link>http://www.dailycoding.com/Posts/imagelens__a_jquery_plugin_for_lens_effect_image_zooming.aspx</link><pubDate>Mon, 28 Mar 2011 01:19</pubDate></item><item><title>jQuery Plug-in for Showing Message Box in Topbar</title><comments>http://www.dailycoding.com/Posts/jquery_plugin_for_showing_message_box_in_topbar.aspx#comments</comments><dc:creator>Ramesh Soni</dc:creator><category>Design</category><description>&lt;table&gt;&lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;
        &lt;div class="downloadSource"&gt;&lt;a href="http://www.dailycoding.com/Uploads/2011/03/topbar_message/demo.html"&gt;View Demo&lt;/a&gt;&lt;/div&gt;
      &lt;/td&gt;

      &lt;td&gt;
        &lt;div class="downloadSource"&gt;&lt;a href="http://www.dailycoding.com/Uploads/2011/03/topbar_message.zip"&gt;Download Source Files&lt;/a&gt;&lt;/div&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;Topbar message box plug-in can be used to showing message box or notifications on a web page. This is very simple to use and easy to configure. Of course you need jQuery to use this.&lt;/p&gt;

&lt;h3&gt;Usage&lt;/h3&gt;

&lt;p&gt;To use this plug-in include jQuery and juery.topbar.js in you web page -&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&amp;lt;script src=&lt;span class="str"&gt;&amp;quot;jquery.js&amp;quot;&lt;/span&gt; type=&lt;span class="str"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script src=&lt;span class="str"&gt;&amp;quot;juery.topbar.js&amp;quot;&lt;/span&gt; type=&lt;span class="str"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;

&lt;p&gt;Now create a html element which you want to show in topbar as messagebox -&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;a&lt;/span&gt; &lt;span class="attr"&gt;href&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;javascript:void(0)&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;demo01&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Demo 1 - Simple&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;a&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;demo01-body&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;display:none;&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    This is a simple demo
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;span&lt;/span&gt; &lt;span class="attr"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;font-size: small&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;(click to close)&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;span&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--more--&gt;
&lt;p&gt;Now use showTopbarMessage to show the notification on topbar -&lt;/p&gt;

&lt;pre class="csharpcode"&gt;$(&lt;span class="kwrd"&gt;function&lt;/span&gt; () {

    $(&lt;span class="str"&gt;&amp;quot;#demo01&amp;quot;&lt;/span&gt;).click(&lt;span class="kwrd"&gt;function&lt;/span&gt; () {
        $(&lt;span class="str"&gt;'#demo01-body'&lt;/span&gt;).showTopbarMessage();
    });

});&lt;/pre&gt;

&lt;p&gt;Currently you can configure following attributes -&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;background: Hex code of color for bar background. Default value is - &amp;quot;#888&amp;quot;. &lt;/li&gt;

  &lt;li&gt;borderColor: Hex code of color for bar border color. Default value is - &amp;quot;#000&amp;quot;. &lt;/li&gt;

  &lt;li&gt;foreColor: Hex code of color for bar fore color. Default value is - &amp;quot;#000&amp;quot;. &lt;/li&gt;

  &lt;li&gt;height: Height of the bar. Default value is &amp;quot;50px&amp;quot;. &lt;/li&gt;

  &lt;li&gt;fontSize: Size of the text displayed in the top bar. Default value is - &amp;quot;20px&amp;quot; &lt;/li&gt;

  &lt;li&gt;close: Specify how the notifications will be closed. &amp;quot;click&amp;quot; – means it will be closed on click, else specify number of milliseconds after which bar will be closed automatically. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can view full usage and demonstration on the &lt;a href="http://www.dailycoding.com/Uploads/2011/03/topbar_message/demo.html"&gt;demo page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;table&gt;&lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;
        &lt;div class="downloadSource"&gt;&lt;a href="http://www.dailycoding.com/Uploads/2011/03/topbar_message/demo.html"&gt;View Demo&lt;/a&gt;&lt;/div&gt;
      &lt;/td&gt;

      &lt;td&gt;
        &lt;div class="downloadSource"&gt;&lt;a href="http://www.dailycoding.com/Uploads/2011/03/topbar_message.zip"&gt;Download Source Files&lt;/a&gt;&lt;/div&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;</description><link>http://www.dailycoding.com/Posts/jquery_plugin_for_showing_message_box_in_topbar.aspx</link><pubDate>Tue, 22 Mar 2011 22:46</pubDate></item><item><title>Create Printer Friendly Web Page Using Media Attribute</title><comments>http://www.dailycoding.com/Posts/create_printer_friendly_web_page_using_media_attribute.aspx#comments</comments><dc:creator>Ramesh Soni</dc:creator><category>Design</category><description>&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;div class="downloadSource"&gt;&lt;a href="http://www.dailycoding.com/Uploads/2010/08/PrinterFriendlyPage.htm"&gt;View Demo&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td&gt;
&lt;div class="downloadSource"&gt;&lt;a href="http://www.dailycoding.com/Uploads/2010/08/Printer_Friendly_Page_CSS.zip"&gt;Download Source Files&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;When you create a web page you usually keep in mind how it will rendered on the browser and its usability. Sometime, depending upon the content, you also know that your page might be printed by end user. But you don’t want that the printer version of your page to be same as the screen version. Most of the time you might create a separate printable version of the page. User will click specially open the printable version and take its print or sometime he will directly print your webpage.&lt;/p&gt;

&lt;p&gt;Now what are the issues here -&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;The web page is not printer friendly therefore the content might get distorted while printing it into a A4 size paper. &lt;/li&gt;

  &lt;li&gt;The print will contain unnecessary links and images while have no use in printable version. &lt;/li&gt;

  &lt;li&gt;The webpage might have dark background which will lead to wastage of print ink. &lt;/li&gt;

  &lt;li&gt;Some text might have light colors which may not be visible clear on a black &amp;amp; white printout. &lt;/li&gt;

  &lt;li&gt;If you create separate printable view then it will involve another user action which sometimes user don’t do. &lt;/li&gt;
&lt;/ol&gt;
&lt;!--more--&gt;
&lt;p&gt;There is a clean solution to this problem using the media attribute in the link tag. By using you can specify on which media a particular style sheet will be applicable. Therefore you can have different style sheet for printer and browser screen and user don’t have to worry about this.&lt;/p&gt;

&lt;p&gt;Lets take an example to understand this. Look at the screen below (or &lt;a href="http://www.dailycoding.com/Uploads/2010/08//PrinterFriendlyPage.htm"&gt;click here&lt;/a&gt; to view html page)&lt;/p&gt;
&lt;img src="http://www.dailycoding.com/Uploads/2010/08/page_screen.jpg" /&gt; 

&lt;p&gt;Now lets start making it printer friendly. First of all create three different style sheets. One for screen, one for print and one which will contain common classes. Include this css in page and add desired media value i.e. for printer add media = print and for screen css add media = screen. Don’t specify the media for the common css.&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;link&lt;/span&gt; &lt;span class="attr"&gt;href&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;style-common.css&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;rel&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;stylesheet&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;text/css&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;link&lt;/span&gt; &lt;span class="attr"&gt;href&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;style-screen.css&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;media&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;screen&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;rel&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;stylesheet&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;text/css&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;link&lt;/span&gt; &lt;span class="attr"&gt;href&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;style-print.css&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;media&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;print&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;rel&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;stylesheet&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;text/css&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;I assume we already have all css except the printer friendly css. Now lets start creating the printer. First of all change the body color. Since default color of white so we moved the body background color css to the screen css -&lt;/p&gt;

&lt;pre class="csharpcode"&gt;/*style-screen.css*/
body
{
    background-color: #666666;
    color: #CCCCCC;
    border-bottom: 2px solid #CCCCCC;
}&lt;/pre&gt;

&lt;p&gt;Now change the header background color -&lt;/p&gt;

&lt;pre class="csharpcode"&gt;#header
{
    background-color: #FFFFFF;
    color: #000000;
    border-bottom: 2px solid #000000;
}&lt;/pre&gt;

&lt;p&gt;We don’t need the left menu in the printer view so lets remove it -&lt;/p&gt;

&lt;pre class="csharpcode"&gt;#leftMenu
{
    display: none;
}&lt;/pre&gt;

&lt;p&gt;Also hide any other smaller thing like Back to dailycoding, print button etc.&lt;/p&gt;

&lt;pre class="csharpcode"&gt;.dontprint
{
    display: none;
}&lt;/pre&gt;

&lt;p&gt;Now when you see this page in browser the view will remain same, but when you print this page it will look like below -&lt;/p&gt;
&lt;img src="http://www.dailycoding.com/Uploads/2010/08/page_print.jpg" /&gt;
&lt;p&gt;You can see that we haven't created any new page here and above page much better printer friendly than original page. This all was done just using css.&lt;/p&gt;
&lt;br /&gt;
&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;div class="downloadSource"&gt;&lt;a href="http://www.dailycoding.com/Uploads/2010/08/PrinterFriendlyPage.htm"&gt;View Demo&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td&gt;
&lt;div class="downloadSource"&gt;&lt;a href="http://www.dailycoding.com/Uploads/2010/08/Printer_Friendly_Page_CSS.zip"&gt;Download Source Files&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</description><link>http://www.dailycoding.com/Posts/create_printer_friendly_web_page_using_media_attribute.aspx</link><pubDate>Wed, 04 Aug 2010 23:53</pubDate></item><item><title>Top 5 new features of Visual Studio 2010 and .NET 4</title><comments>http://www.dailycoding.com/Posts/top_5_new_features_of_visual_studio_2010_and_net_4.aspx#comments</comments><dc:creator>Ramesh Soni</dc:creator><category>General</category><description>&lt;p&gt;Visual Studio 2010 has finally released and is available for download. You can download various version from below location -&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Visual Studio 2010 – 90 days free trial
    &lt;br /&gt;&lt;a href="http://www.microsoft.com/visualstudio/en-us/download"&gt;http://www.microsoft.com/visualstudio/en-us/download&lt;/a&gt; &lt;/li&gt;

  &lt;li&gt;Visual Studio 2010 – Express Editions
    &lt;br /&gt;&lt;a title="http://www.microsoft.com/express/Downloads/#Visual_Studio_2010_Express_Downloads" href="http://www.microsoft.com/express/Downloads/#Visual_Studio_2010_Express_Downloads"&gt;http://www.microsoft.com/express/Downloads/#Visual_Studio_2010_Express_Downloads&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There lots of improvement in Visual Studio 2010 over past version. Below are some new great features of Visual Studio 2010 -&lt;/p&gt;

&lt;h3&gt;Better code intellisense&lt;/h3&gt;

&lt;p&gt;Visual Studio 2010 has better code intellisense support which make it easier for look for methods and functions. You can now easily search for inline keyword, or even use abbreviation to search for properties or methods.&lt;/p&gt;
&lt;!--more--&gt;
&lt;p&gt;&lt;img src="http://www.dailycoding.com/Uploads/2010/04/intellisense_1.jpg" border="0" /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src="http://www.dailycoding.com/Uploads/2010/04/intellisense_2.jpg" border="0" /&gt;&lt;/p&gt;

&lt;p&gt;See - &lt;a href="http://weblogs.asp.net/scottgu/archive/2009/10/22/vs-2010-code-intellisense-improvements-vs-2010-and-net-4-0-series.aspx"&gt;VS 2010 Code Intellisense Improvements&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Improved multi-targeting support&lt;/h3&gt;

&lt;p&gt;Though multi-targeting was there in Visual Studio 2008, but the Visual Studio 2010 has got better support for it. With its new “reference assemblies”, it provides 100% accurate intellisense.&lt;/p&gt;

&lt;p&gt;&lt;img src="http://www.dailycoding.com/Uploads/2010/04/multi-targeting_1.jpg" border="0" /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src="http://www.dailycoding.com/Uploads/2010/04/multi-targeting_2.jpg" border="0" /&gt;&lt;/p&gt;

&lt;p&gt;See - &lt;a href="http://weblogs.asp.net/scottgu/archive/2009/08/27/multi-targeting-support-vs-2010-and-net-4-series.aspx"&gt;Multi-Targeting Support&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Multi-monitor support&lt;/h3&gt;

&lt;p&gt;Earlier, all editor and child windows are hosted inside a single parent windows, but with the new IDE you can host every single child windows as separate windows outside of the main windows. You can move these to other monitors which makes it to support multiple monitors.&lt;/p&gt;

&lt;p&gt;&lt;img src="http://www.dailycoding.com/Uploads/2010/04/multi-monitor.jpg" border="0" /&gt;&lt;/p&gt;

&lt;p&gt;See &lt;a href="http://weblogs.asp.net/scottgu/archive/2009/08/31/multi-monitor-support-vs-2010-and-net-4-series.aspx"&gt;Multi-Monitor Support&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Enhanced code navigations&lt;/h3&gt;

&lt;p&gt;Visual Studio 2010 has introduces a number of new features to improve the searching and navigational capabilities. The new “Navigate to” features provides you a fast and incremental search of functions, classes, properties etc.&lt;/p&gt;

&lt;p&gt;&lt;img src="http://www.dailycoding.com/Uploads/2010/04/navigation_1.jpg" border="0" /&gt;&lt;/p&gt;

&lt;p&gt;With its “View call Hierarchy” features can can discover from where a particular method or property is called which helps you to refactor and make you code even better.&lt;/p&gt;

&lt;p&gt;&lt;img src="http://www.dailycoding.com/Uploads/2010/04/navigation_2.jpg" border="0" /&gt;&lt;/p&gt;

&lt;p&gt;Another features “Highlight Reference” helps of to discover what part of code is using a particular variable.&lt;/p&gt;

&lt;p&gt;&lt;img src="http://www.dailycoding.com/Uploads/2010/04/navigation_3.jpg" border="0" /&gt;&lt;/p&gt;

&lt;p&gt;See &lt;a href="http://weblogs.asp.net/scottgu/archive/2009/10/21/searching-and-navigating-code-in-vs-2010-vs-2010-and-net-4-0-series.aspx"&gt;Searching and Navigating Code in VS 2010&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Parallel computing&lt;/h3&gt;

&lt;p&gt;With Visual Studio 2010, now you can take advantage of multi-core processor by using parallel computing feature. This help you to write code which can execute even faster. Visual Studio also supports parallel debugging for the parallel programming.&lt;/p&gt;

&lt;p&gt;See &lt;a href="http://channel9.msdn.com/posts/DanielMoth/VS2010-Parallel-Computing-Features-Tour/"&gt;VS2010 Parallel Computing Features Tour&lt;/a&gt;, &lt;a href="http://www.danielmoth.com/Blog/parallel-debugging.aspx"&gt;Parallel Debugging&lt;/a&gt;&lt;/p&gt;</description><link>http://www.dailycoding.com/Posts/top_5_new_features_of_visual_studio_2010_and_net_4.aspx</link><pubDate>Wed, 14 Apr 2010 00:08</pubDate></item><item><title>Using DebuggerBrowsable Attribute for a better view in debugger window</title><comments>http://www.dailycoding.com/Posts/using_debuggerbrowsable_attribute_for_a_better_view_in_debugger_window.aspx#comments</comments><dc:creator>Ramesh Soni</dc:creator><category>General</category><description>&lt;p&gt;There are lots of small tricks in .net which can be very useful if used wisely. In this post I want to discuss the use of DebuggerBrowsableAttribute. Using this attribute you can control how a member of class will be displayed in debugger windows during debugging. Before that consider small example:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; &lt;span class="cls"&gt;Organization&lt;/span&gt;
{
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="cls"&gt;List&lt;/span&gt;&amp;lt;&lt;span class="cls"&gt;Employee&lt;/span&gt;&amp;gt; Employees
    {
        get;
        set;
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; Organization()
    {
        &lt;span class="kwrd"&gt;this&lt;/span&gt;.Employees = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span class="cls"&gt;List&lt;/span&gt;&amp;lt;&lt;span class="cls"&gt;Employee&lt;/span&gt;&amp;gt;();
    }
}&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;!--more--&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; &lt;span class="cls"&gt;Employee&lt;/span&gt;
{
    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="cls"&gt;Guid&lt;/span&gt; UniqueGuid
    {
        get;
        set;
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Code
    {
        get;
        set;
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Name
    {
        get;
        set;
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; Employee()
    {
        UniqueGuid = &lt;span class="cls"&gt;Guid&lt;/span&gt;.NewGuid();
    }
}&lt;/pre&gt;

&lt;p&gt;Lets create a instance of Organization and add some sample data:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="cls"&gt;Organization&lt;/span&gt; org = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span class="cls"&gt;Organization&lt;/span&gt;();
org.Employees.Add(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span class="cls"&gt;Employee&lt;/span&gt;() { Code = &lt;span class="str"&gt;&amp;quot;E01&amp;quot;&lt;/span&gt;, Name = &lt;span class="str"&gt;&amp;quot;Matt&amp;quot;&lt;/span&gt; });
org.Employees.Add(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span class="cls"&gt;Employee&lt;/span&gt;() { Code = &lt;span class="str"&gt;&amp;quot;E02&amp;quot;&lt;/span&gt;, Name = &lt;span class="str"&gt;&amp;quot;Tim&amp;quot;&lt;/span&gt; });
org.Employees.Add(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span class="cls"&gt;Employee&lt;/span&gt;() { Code = &lt;span class="str"&gt;&amp;quot;E03&amp;quot;&lt;/span&gt;, Name = &lt;span class="str"&gt;&amp;quot;David&amp;quot;&lt;/span&gt; });
org.Employees.Add(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span class="cls"&gt;Employee&lt;/span&gt;() { Code = &lt;span class="str"&gt;&amp;quot;E04&amp;quot;&lt;/span&gt;, Name = &lt;span class="str"&gt;&amp;quot;Tom&amp;quot;&lt;/span&gt; });&lt;/pre&gt;

&lt;p&gt;Now when you run this program in debug mode and try to view the org in debugger window it will look like this:&lt;/p&gt;

&lt;p&gt;&lt;img src="http://www.dailycoding.com/Uploads/2010/01/without_dba.jpg" /&gt;&lt;/p&gt;

&lt;p&gt;Lets try to change it using DebuggerBrowsableAttribute. Make following changes by adding DebuggerBrowsableAttribute:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;    [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="cls"&gt;List&lt;/span&gt;&amp;lt;&lt;span class="cls"&gt;Employee&lt;/span&gt;&amp;gt; Employees
    {
        get;
        set;
    }


    [&lt;span class="cls"&gt;DebuggerBrowsable&lt;/span&gt;(&lt;span class="cls"&gt;DebuggerBrowsableState&lt;/span&gt;.Never)]
    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="cls"&gt;Guid&lt;/span&gt; UniqueGuid
    {
        get;
        set;
    }&lt;/pre&gt;

&lt;p&gt;Again run this program in debug mode and try to view the org in debugger window. Now it will look like this&lt;/p&gt;

&lt;p&gt;&lt;img src="http://www.dailycoding.com/Uploads/2010/01/with_dba.jpg" /&gt;&lt;/p&gt;

&lt;p&gt;You can see how this small but useful attribue can change the look of the debugger window.&lt;/p&gt;</description><link>http://www.dailycoding.com/Posts/using_debuggerbrowsable_attribute_for_a_better_view_in_debugger_window.aspx</link><pubDate>Sat, 23 Jan 2010 01:02</pubDate></item><item><title>JavaScript Exception Handling Techniques</title><comments>http://www.dailycoding.com/Posts/javascript_exception_handling_techniques.aspx#comments</comments><dc:creator>Ramesh Soni</dc:creator><category>Scripting</category><description>&lt;p&gt;&lt;p&gt;Like the &lt;a href="http://www.dailycoding.com/Posts/object_oriented_programming_with_javascript__timer_class.aspx"&gt;Object oriented programming&lt;/a&gt; the exception handling is also not used while coding in JavaScript. That why in most of cases if there is any  problem in one part in a page then surprisingly other part also stops working. In this post we will be discussing the various techniques to handle exceptions in JavaScript.&lt;/p&gt;

&lt;h3&gt;Using try..catch block&lt;/h3&gt;

&lt;p&gt;try..catch block in JavaScript is very much similar to the regular C# try..catch block. The suspected code will be put in try block and all exceptions which will occur in the try block will be caught in catch block.&lt;/p&gt;

&lt;pre class="csharpcode"&gt;window.onload = &lt;span ="kwrd"&gt;function&lt;/span&gt;()
{
    &lt;span class="kwrd"&gt;try&lt;/span&gt;
    {
        &lt;span class="kwrd"&gt;var&lt;/span&gt; x = 90;
        &lt;span class="kwrd"&gt;var&lt;/span&gt; value = x / y;
    }
    &lt;span class="kwrd"&gt;catch&lt;/span&gt;(err)
    {
        document.write(err.name + &lt;span class="str"&gt;&amp;quot;: &amp;quot;&lt;/span&gt; + err.message + &lt;span class="str"&gt;&amp;quot;&amp;lt;br/&amp;gt;&amp;quot;&lt;/span&gt;);
    }
}
Output:
TypeError: 'y' is undefined&lt;/pre&gt;
&lt;!--more--&gt;
&lt;p&gt;In catch you will get the  object containing type and description of the exception. More over you can also use finally block in the same way as you use in C#.&lt;/p&gt;

&lt;pre class="csharpcode"&gt;window.onload = &lt;span class="kwrd"&gt;function&lt;/span&gt;()
{
    &lt;span class="kwrd"&gt;try&lt;/span&gt;
    {
        &lt;span class="kwrd"&gt;var&lt;/span&gt; x = 90;
        &lt;span class="kwrd"&gt;var&lt;/span&gt; value = x / y;
    }
    &lt;span class="kwrd"&gt;catch&lt;/span&gt;(err)
    {
        document.write(err.name + &lt;span class="str"&gt;&amp;quot;: &amp;quot;&lt;/span&gt; + err.message + &lt;span class="str"&gt;&amp;quot;&amp;lt;br/&amp;gt;&amp;quot;&lt;/span&gt;);
    }
    &lt;span class="kwrd"&gt;finally&lt;/span&gt;
    {
        alert(&lt;span class="str"&gt;'This is finally block'&lt;/span&gt;);
    }
}&lt;/pre&gt;

&lt;h3&gt;Using onerror event&lt;/h3&gt;

&lt;p&gt;onerror event will be raised each time there is any error while performing a action in the document. This like on place exception handling similar to Application_Error in ASP.NET. Here is sample code which demonstrate this:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;window.onload = &lt;span class="kwrd"&gt;function&lt;/span&gt;()
{
    &lt;span class="kwrd"&gt;var&lt;/span&gt; x = 90;
    &lt;span class="kwrd"&gt;var&lt;/span&gt; value = x / y;
}

window.onerror = &lt;span class="kwrd"&gt;function&lt;/span&gt;(errorMeaage, fileName, lineNumber)
{
    document.write(&lt;span class="str"&gt;'Error: '&lt;/span&gt; + errorMeaage);
}&lt;/pre&gt;

&lt;h3&gt;Using jQuery Solution&lt;/h3&gt;

&lt;p&gt;It is similar to using onerror but with jQuery syntax. The syntax is:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;$(window).error(
    &lt;span class="kwrd"&gt;function&lt;/span&gt;(errorMeaage, fileName, lineNumber)
    {
        &lt;span class="rem"&gt;// handle error here&lt;/span&gt;
    }
);&lt;/pre&gt;</description><link>http://www.dailycoding.com/Posts/javascript_exception_handling_techniques.aspx</link><pubDate>Tue, 04 Aug 2009 03:49</pubDate></item><item><title>Top 5 Small but Must have Extension Methods</title><comments>http://www.dailycoding.com/Posts/top_5_small_but_must_have_extension_methods.aspx#comments</comments><dc:creator>Ramesh Soni</dc:creator><category>General</category><description>&lt;p&gt;In this post I want to cover some very basic and small extension methods which are very useful for any developer. All below mentioned extension method are not doing any complex operation. Rather they are just performing very simple task which you generally encounter a lots of times in your day today coding.&lt;/p&gt;

&lt;div class="downloadSource"&gt;&lt;a href="http://www.dailycoding.com/Uploads/2009/05/DailyCodingExtensions.zip"&gt;Download Source Files&lt;/a&gt;&lt;/div&gt;

&lt;h3&gt;1. IsNull&lt;/h3&gt;

&lt;p&gt;This is probably most commonly used expression. A lots of places in out code we check to null references. We usually add the obj == null or obj != null check to do this. Here is the IsNull extension method&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; IsNull(&lt;span class="kwrd"&gt;this&lt;/span&gt; &lt;span class="kwrd"&gt;object&lt;/span&gt; source)
{
    &lt;span class="kwrd"&gt;return&lt;/span&gt; source == &lt;span class="kwrd"&gt;null&lt;/span&gt;;
}&lt;/pre&gt;

&lt;p&gt;Using the you can avoid the lazy null check. Example:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; ProcessData(DataSet input)
{
    &lt;span class="kwrd"&gt;if&lt;/span&gt; (!input.IsNull())
    {
        &lt;span class="rem"&gt;// business logic here&lt;/span&gt;
    }
}&lt;/pre&gt;
&lt;!--more--&gt;
&lt;h3&gt;2. FormatString&lt;/h3&gt;

&lt;p&gt;We often use string.Format to format the string like&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;string&lt;/span&gt; message = &lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(&lt;span class="str"&gt;&amp;quot;Welcome {0} (Last login: {1})&amp;quot;&lt;/span&gt;, 
    userName, lastLogin);&lt;/pre&gt;

&lt;p&gt;The alternative way to do this is using below extension method&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; FormatString(&lt;span class="kwrd"&gt;this&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; format, &lt;span class="kwrd"&gt;params&lt;/span&gt; &lt;span class="kwrd"&gt;object&lt;/span&gt;[] args)
{
    &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(format, args);
}&lt;/pre&gt;

&lt;p&gt;Now the above example can be re-written as&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;string&lt;/span&gt; message = &lt;span class="str"&gt;&amp;quot;Welcome {0} (Last login: {1})&amp;quot;&lt;/span&gt;.FormatString(userName, lastLogin);&lt;/pre&gt;

&lt;h3&gt;3. RaiseEvent&lt;/h3&gt;

&lt;p&gt;How you generally raise you events? I guess something like below&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; OnMyEvent(EventArgs e)
{
    &lt;span class="kwrd"&gt;if&lt;/span&gt; (MyEvent != &lt;span class="kwrd"&gt;null&lt;/span&gt;)
    {
        MyEvent(&lt;span class="kwrd"&gt;this&lt;/span&gt;, e);
    }
}&lt;/pre&gt;

&lt;p&gt;Here for each event you need to check the null reference before you raise it and also you create a new method so that you don’t have to add this check each place from where you are raising the event even if there is no special logic in the function. Here it the set of extension method to raise the events that matches the signature of EventHandler or EventHalder&amp;lt;TEventArgs&amp;gt;:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Raise(&lt;span class="kwrd"&gt;this&lt;/span&gt; EventHandler eventHandler, 
    &lt;span class="kwrd"&gt;object&lt;/span&gt; sender, EventArgs e)
{
    &lt;span class="kwrd"&gt;if&lt;/span&gt; (eventHandler != &lt;span class="kwrd"&gt;null&lt;/span&gt;)
    {
        eventHandler(sender, e);
    }
}

&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Raise&amp;lt;T&amp;gt;(&lt;span class="kwrd"&gt;this&lt;/span&gt; EventHandler&amp;lt;T&amp;gt; eventHandler,
    &lt;span class="kwrd"&gt;object&lt;/span&gt; sender, T e) &lt;span class="kwrd"&gt;where&lt;/span&gt; T : EventArgs
{
    &lt;span class="kwrd"&gt;if&lt;/span&gt; (eventHandler != &lt;span class="kwrd"&gt;null&lt;/span&gt;)
    {
        eventHandler(sender, e);
    }
}&lt;/pre&gt;

&lt;p&gt;Now this is how to raise the above event&lt;/p&gt;

&lt;pre class="csharpcode"&gt;MyEvent.Raise(&lt;span class="kwrd"&gt;this&lt;/span&gt;, e);&lt;/pre&gt;

&lt;h3&gt;4. Match&lt;/h3&gt;

&lt;p&gt;This extension method is for pattern matching in any string using Regex. This is how you generally use it&lt;/p&gt;

&lt;pre class="csharpcode"&gt;Regex regex = &lt;span class="kwrd"&gt;new&lt;/span&gt; Regex(&lt;span class="str"&gt;&amp;quot;[0-9]&amp;quot;&lt;/span&gt;);
&lt;span class="kwrd"&gt;if&lt;/span&gt; (regex.IsMatch(myData))
{
    &lt;span class="rem"&gt;// do someting&lt;/span&gt;
}&lt;/pre&gt;

&lt;p&gt;And here is the extension method to do this simply&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; Match(&lt;span class="kwrd"&gt;this&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; &lt;span class="kwrd"&gt;value&lt;/span&gt;, &lt;span class="kwrd"&gt;string&lt;/span&gt; pattern)
{
    Regex regex = &lt;span class="kwrd"&gt;new&lt;/span&gt; Regex(pattern);
    &lt;span class="kwrd"&gt;return&lt;/span&gt; regex.IsMatch(&lt;span class="kwrd"&gt;value&lt;/span&gt;);
}&lt;/pre&gt;

&lt;p&gt;After this look at the code below. It became much simpler than the traditional approach:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt; (myData.Match(&lt;span class="str"&gt;&amp;quot;[0-9]&amp;quot;&lt;/span&gt;))
{
    &lt;span class="rem"&gt;// do someting&lt;/span&gt;
}&lt;/pre&gt;

&lt;p&gt;5. ToInt&lt;/p&gt;

&lt;p&gt;This method has three flavors, for Int16, Int32 and Int64. This can be easily used while doing string to int conversion. Here are the methods:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;long&lt;/span&gt; ToInt16(&lt;span class="kwrd"&gt;this&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; &lt;span class="kwrd"&gt;value&lt;/span&gt;)
{
    Int16 result = 0;

    &lt;span class="kwrd"&gt;if&lt;/span&gt; (!&lt;span class="kwrd"&gt;string&lt;/span&gt;.IsNullOrEmpty(&lt;span class="kwrd"&gt;value&lt;/span&gt;))
        Int16.TryParse(&lt;span class="kwrd"&gt;value&lt;/span&gt;, &lt;span class="kwrd"&gt;out&lt;/span&gt; result);

    &lt;span class="kwrd"&gt;return&lt;/span&gt; result;
}

&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;long&lt;/span&gt; ToInt32(&lt;span class="kwrd"&gt;this&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; &lt;span class="kwrd"&gt;value&lt;/span&gt;)
{
    Int32 result = 0;

    &lt;span class="kwrd"&gt;if&lt;/span&gt; (!&lt;span class="kwrd"&gt;string&lt;/span&gt;.IsNullOrEmpty(&lt;span class="kwrd"&gt;value&lt;/span&gt;))
        Int32.TryParse(&lt;span class="kwrd"&gt;value&lt;/span&gt;, &lt;span class="kwrd"&gt;out&lt;/span&gt; result);

    &lt;span class="kwrd"&gt;return&lt;/span&gt; result;
}

&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;long&lt;/span&gt; ToInt64(&lt;span class="kwrd"&gt;this&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; &lt;span class="kwrd"&gt;value&lt;/span&gt;)
{
    Int64 result = 0;

    &lt;span class="kwrd"&gt;if&lt;/span&gt; (!&lt;span class="kwrd"&gt;string&lt;/span&gt;.IsNullOrEmpty(&lt;span class="kwrd"&gt;value&lt;/span&gt;))
        Int64.TryParse(&lt;span class="kwrd"&gt;value&lt;/span&gt;, &lt;span class="kwrd"&gt;out&lt;/span&gt; result);

    &lt;span class="kwrd"&gt;return&lt;/span&gt; result;
}&lt;/pre&gt;

&lt;p&gt;I hope you enjoyed reading this article. You can download the source file from here also&lt;/p&gt;

&lt;p&gt;&lt;a class="downloadSource" href="http://www.dailycoding.com/Uploads/2009/05/DailyCodingExtensions.zip"&gt;Download Source Files&lt;/a&gt;&lt;/p&gt;</description><link>http://www.dailycoding.com/Posts/top_5_small_but_must_have_extension_methods.aspx</link><pubDate>Thu, 28 May 2009 00:00</pubDate></item><item><title>Business Cards and Postcards Giveaway : Comment and Win</title><comments>http://www.dailycoding.com/Posts/business_cards_and_postcards_giveaway__comment_and_win.aspx#comments</comments><dc:creator>Ramesh Soni</dc:creator><category>Others</category><description>&lt;div style="margin: 8px; background-color: LightYellow; padding: 8px; border: solid 1px #a1a1a1;"&gt;
        &lt;p&gt;
            &lt;strong&gt;&lt;span&gt;
            This contest is closed now. There were very few comments; so it was not difficult
            to choose the winners. Here are the winners 
            &lt;/span&gt;&lt;/strong&gt;
        &lt;/p&gt;
        &lt;p style="padding-left: 10px;"&gt;
            &lt;strong&gt;&lt;span&gt;
            1st Prize - 1000 Standard Size Business Cards - Alex Lyman
            &lt;br /&gt;
            2nd Prize - 500 4x6" Postcards - Alin-T &lt;/span&gt;&lt;/strong&gt;
        &lt;/p&gt;
        &lt;p&gt;
            &lt;strong&gt;&lt;span&gt;
            Congrats winner. You will be soon contacted by UPrinting for the preferences. &lt;/span&gt;
            &lt;/strong&gt;
        &lt;/p&gt;
    &lt;/div&gt;
&lt;p&gt;Here is business card giveaway for the readers of DailyCoding. The prizes are sponsored by the &lt;a href="http://www.uprinting.com/"&gt;UPrinting&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;1st Prize - 1000 Standard Size Business Cards&lt;/p&gt;

&lt;p&gt;2nd Prize - 500 4x6&amp;quot; Postcards&lt;/p&gt;

&lt;p&gt;You can choose from any of their stocks for these items. The rules are very simple:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Leave a comment (along with your email address) at the end of this post, describing what you would use the free business cards and/or postcards for. &lt;/li&gt;

  &lt;li&gt;Two winners will be chosen based on most interesting comments.&lt;/li&gt;

  &lt;li&gt;There is no fix end date of this contest.&lt;/li&gt;

  &lt;li&gt;Winners in the United States and Canada qualify for free shipping. Shipping fees will apply to winners outside these areas.
    &lt;br /&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;!--more--&gt;
&lt;p&gt;&lt;img src="http://www.dailycoding.com/Uploads/2009/03/UPrinting.com.jpg" border="0" /&gt;&lt;/p&gt;
&lt;p&gt;Those who don’t know about the UPrinting; It is a leading online printing &lt;a href="http://www.uprinting.com/Business-Cards.html"&gt;business card printing&lt;/a&gt; company that provides high quality printing of business cards¸&lt;a href="http://www.uprinting.com/Postcards.html"&gt;postcards&lt;/a&gt;, brochures, catalogues, posters, flyers&amp;#160; at the most affordable prices.&lt;/p&gt;</description><link>http://www.dailycoding.com/Posts/business_cards_and_postcards_giveaway__comment_and_win.aspx</link><pubDate>Thu, 26 Mar 2009 00:46</pubDate></item><item><title>Add Vista Look to your WPF Control on Windows XP</title><comments>http://www.dailycoding.com/Posts/add_vista_look_to_your_wpf_control_on_windows_xp.aspx#comments</comments><dc:creator>Ramesh Soni</dc:creator><category>Design</category><description>&lt;p&gt;Vista had come with new and cool look &amp;amp; feel. If you want to add the Vista Aero style theme to you WPF application running on Window XP then it is very easy trick. You don’t need any third party library or tool to achieve this.&lt;/p&gt;

&lt;p&gt;To do this all you need to do is to add following lines of xaml code into the designer of your window right after window tag:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ResourceDictionary&lt;/span&gt; &lt;span class="attr"&gt;Source&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;/PresentationFramework.Aero, 
   Version=3.0.0.0, Culture=neutral, 
   PublicKeyToken=31bf3856ad364e35, 
   ProcessorArchitecture=MSIL;component/themes/aero.normalcolor.xaml&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;If you want to apply this look through out the application then add this to app.xaml under &amp;lt;Application.Resources&amp;gt; section.&lt;/p&gt;
&lt;!--more--&gt;
&lt;h3&gt;Before Aero Theme&lt;/h3&gt;

&lt;p&gt;&lt;img title="xp_default_theme" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="381" alt="xp_default_theme" src="http://www.dailycoding.com/Uploads/2009/01/xp_default_theme.png" width="426" border="0" /&gt; &lt;/p&gt;

&lt;h3&gt;After Aero Theme&lt;/h3&gt;

&lt;p&gt;&lt;img title="vista_aero_theme" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="381" alt="vista_aero_theme" src="http://www.dailycoding.com/Uploads/2009/01/vista_aero_theme.png" width="426" border="0" /&gt;&lt;/p&gt;
&lt;p&gt;The limitation of this technique is that it don't change the look of container form. You can see it still looks like a normal XP form.&lt;/p&gt;</description><link>http://www.dailycoding.com/Posts/add_vista_look_to_your_wpf_control_on_windows_xp.aspx</link><pubDate>Tue, 27 Jan 2009 06:22</pubDate></item><item><title>Customized Html Controls: Creating Custom Checkbox</title><comments>http://www.dailycoding.com/Posts/customized_html_controls_creating_custom_checkbox.aspx#comments</comments><dc:creator>Ramesh Soni</dc:creator><category>Design</category><description>&lt;p&gt;Under “Customized Html Controls” section I will discuss about how to create and customized standard html controls. This is first article in this category. This will discuss about how we can create a custom checkbox using CSS and jQuery.&lt;/p&gt;

&lt;h3&gt;Checkbox Image&lt;/h3&gt;

&lt;p&gt;For this you need two images, one for checked state of checkbox and another for unchecked state of the checkbox. However, you can also use a single image containing both checked and unchecked state and use CSS trick like I use. 
&lt;!--more--&gt;
  &lt;br /&gt;&lt;img src="http://www.dailycoding.com/Uploads/2008/12/CheckBox.png" /&gt; &lt;/p&gt;

&lt;h3&gt;Checkbox CSS&lt;/h3&gt;

&lt;p&gt;Here is the CSS classes we will be going to use for the checkbox&lt;/p&gt;

&lt;pre class="csharpcode"&gt;.checkBox
{
    background-position: 0px 0px;
}

.checkBoxClear
{
    background-position: -21px 0px;
}

.checkBox, .checkBoxClear
{
    background-image: url('CheckBox.png');
    background-repeat: no-repeat;
    display: inline-block;
    float: left;
    width: 21px;
    height: 21px;
    padding: 0px;
    margin: 0px;
    cursor: hand;
}&lt;/pre&gt;
&lt;!--ads--&gt;
&lt;h3&gt;Checkbox JavaScript&lt;/h3&gt;

&lt;p&gt;Finally below is the JavaScript code using jQuery which will control the checking and un-checking of our checkbox using click event. It will basically toggle the CSS which will change the state. 
  &lt;br /&gt;&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;script&lt;/span&gt; &lt;span class="attr"&gt;language&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;javascript&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&amp;lt;!--
$(document).ready(&lt;span class="kwrd"&gt;function&lt;/span&gt;()
{
    $(&lt;span class="str"&gt;&amp;quot;.checkBox,.checkBoxClear&amp;quot;&lt;/span&gt;).click(&lt;span class="kwrd"&gt;function&lt;/span&gt;(srcc)
    {
        &lt;span class="kwrd"&gt;if&lt;/span&gt; ($(&lt;span class="kwrd"&gt;this&lt;/span&gt;).hasClass(&lt;span class="str"&gt;&amp;quot;checkBox&amp;quot;&lt;/span&gt;))
        {
            $(&lt;span class="kwrd"&gt;this&lt;/span&gt;).removeClass(&lt;span class="str"&gt;&amp;quot;checkBox&amp;quot;&lt;/span&gt;);
            $(&lt;span class="kwrd"&gt;this&lt;/span&gt;).addClass(&lt;span class="str"&gt;&amp;quot;checkBoxClear&amp;quot;&lt;/span&gt;);
        }
        &lt;span class="kwrd"&gt;else&lt;/span&gt;
        {
            $(&lt;span class="kwrd"&gt;this&lt;/span&gt;).removeClass(&lt;span class="str"&gt;&amp;quot;checkBoxClear&amp;quot;&lt;/span&gt;);
            $(&lt;span class="kwrd"&gt;this&lt;/span&gt;).addClass(&lt;span class="str"&gt;&amp;quot;checkBox&amp;quot;&lt;/span&gt;);
        }
    });        
});
&lt;span class="rem"&gt;//--&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;script&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;h3&gt;Html Code&lt;/h3&gt;

&lt;p&gt;Here is a sample Custom Checkbox with the html code. 
  &lt;br /&gt; 
&lt;script language="javascript" type="text/javascript"&gt;
	&lt;!--
	$(document).ready(function()
	{
		$(".checkBox,.checkBoxClear").click(function(srcc)
		{
		    if ($(this).hasClass("checkBox"))
		    {
			    $(this).removeClass("checkBox");
			    $(this).addClass("checkBoxClear");
			}
			else
			{
			    $(this).removeClass("checkBoxClear");
			    $(this).addClass("checkBox");
			}
		});		
	});
	//--&gt;
	&lt;/script&gt;

&lt;style type="text/css"&gt;
.checkBox
{
	background-position: 0px 0px;
        clear: left;
}

.checkBoxClear
{
	background-position: -21px 0px;
}

.checkBox, .checkBoxClear
{
	background-image: url('http://www.dailycoding.com/Uploads/2008/12/CheckBox.png');
	background-repeat: no-repeat;
	display: inline-block;
	float: left;
	width: 21px;
	height: 21px;
	padding: 0px;
	margin: 0px;
	cursor: hand;
}
&lt;/style&gt;

    &lt;h3&gt;Select options&lt;/h3&gt;
    &lt;div id="Div1" class="checkBox"&gt;&amp;nbsp;&lt;/div&gt;
	&lt;label for="Div1" style="float:left;"&gt;
        Lorem ipsum dolor sit amet&lt;/label&gt;&lt;br /&gt;
    &lt;div id="Div2" class="checkBox"&gt;
        &amp;nbsp;&lt;/div&gt;
    &lt;label for="Div2" style="float:left;"&gt;
        Aenean vitae elit quis erat interdum tempus&lt;/label&gt;
    &lt;div id="Div3" class="checkBox"&gt;
        &amp;nbsp;&lt;/div&gt;
    &lt;label for="Div3" style="float:left;"&gt;
        Duis laoreet viverra quam&lt;/label&gt;
    &lt;div id="Div4" class="checkBox"&gt;
        &amp;nbsp;&lt;/div&gt;
    &lt;label for="Div4" style="float:left;"&gt;
        Mauris pellentesque tristique erat&lt;/label&gt;
  &lt;br /&gt;&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;h3&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Select options&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;h3&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Div1&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;checkBox&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;span class="attr"&gt;&amp;amp;nbsp;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;label&lt;/span&gt; &lt;span class="attr"&gt;for&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Div1&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    Lorem ipsum dolor sit amet&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;label&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;br&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Div2&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;checkBox&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="attr"&gt;&amp;amp;nbsp;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;label&lt;/span&gt; &lt;span class="attr"&gt;for&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Div2&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    Aenean vitae elit quis erat interdum tempus&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;label&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Div3&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;checkBox&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="attr"&gt;&amp;amp;nbsp;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;label&lt;/span&gt; &lt;span class="attr"&gt;for&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Div3&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    Duis laoreet viverra quam&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;label&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Div4&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;checkBox&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="attr"&gt;&amp;amp;nbsp;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;label&lt;/span&gt; &lt;span class="attr"&gt;for&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Div4&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    Mauris pellentesque tristique erat&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;label&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;</description><link>http://www.dailycoding.com/Posts/customized_html_controls_creating_custom_checkbox.aspx</link><pubDate>Wed, 17 Dec 2008 02:21</pubDate></item><item><title>Random Sort a List Using LINQ</title><comments>http://www.dailycoding.com/Posts/random_sort_a_list_using_linq.aspx#comments</comments><dc:creator>Ramesh Soni</dc:creator><category>General</category><description>&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb397897.aspx"&gt;LINQ (Language Integrated Query)&lt;/a&gt; is a one of very useful feature of .net 3.5 framework. This allows you to query objects and perform complex operations simply and efficiently. There are lots of trick which can be used with the help of LINQ. In this article I am explaining how can we random sort a List using LINQ&lt;/p&gt;

&lt;h3&gt;Random Sort&lt;/h3&gt;

&lt;!--more--&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Consider the below Employee class:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Employee
{
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; Id
    {
        get;
        set;
    }
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Name
    {
        get;
        set;
    }
}&lt;/pre&gt;

&lt;p&gt;This is how you can randomly sort the List&amp;lt;Employee&amp;gt; object:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;List&amp;lt;Employee&amp;gt; list = &lt;span class="kwrd"&gt;new&lt;/span&gt; List&amp;lt;Employee&amp;gt;();

list.Add(&lt;span class="kwrd"&gt;new&lt;/span&gt; Employee { Id = 1, Name = &lt;span class="str"&gt;&amp;quot;Davolio Nancy&amp;quot;&lt;/span&gt; });
list.Add(&lt;span class="kwrd"&gt;new&lt;/span&gt; Employee { Id = 2, Name = &lt;span class="str"&gt;&amp;quot;Fuller Andrew&amp;quot;&lt;/span&gt; });
list.Add(&lt;span class="kwrd"&gt;new&lt;/span&gt; Employee { Id = 3, Name = &lt;span class="str"&gt;&amp;quot;Leverling Janet&amp;quot;&lt;/span&gt; });
list.Add(&lt;span class="kwrd"&gt;new&lt;/span&gt; Employee { Id = 4, Name = &lt;span class="str"&gt;&amp;quot;Peacock Margaret&amp;quot;&lt;/span&gt; });
list.Add(&lt;span class="kwrd"&gt;new&lt;/span&gt; Employee { Id = 5, Name = &lt;span class="str"&gt;&amp;quot;Buchanan Steven&amp;quot;&lt;/span&gt; });
list.Add(&lt;span class="kwrd"&gt;new&lt;/span&gt; Employee { Id = 6, Name = &lt;span class="str"&gt;&amp;quot;Suyama Michael&amp;quot;&lt;/span&gt; });
list.Add(&lt;span class="kwrd"&gt;new&lt;/span&gt; Employee { Id = 7, Name = &lt;span class="str"&gt;&amp;quot;King Robert&amp;quot;&lt;/span&gt; });
list.Add(&lt;span class="kwrd"&gt;new&lt;/span&gt; Employee { Id = 8, Name = &lt;span class="str"&gt;&amp;quot;Callahan Laura&amp;quot;&lt;/span&gt; });
list.Add(&lt;span class="kwrd"&gt;new&lt;/span&gt; Employee { Id = 9, Name = &lt;span class="str"&gt;&amp;quot;Dodsworth Anne&amp;quot;&lt;/span&gt; });

list = list.OrderBy(emp =&amp;gt; Guid.NewGuid()).ToList();&lt;/pre&gt;</description><link>http://www.dailycoding.com/Posts/random_sort_a_list_using_linq.aspx</link><pubDate>Fri, 21 Nov 2008 02:16</pubDate></item><item><title>Purely CSS Callouts</title><comments>http://www.dailycoding.com/Posts/purely_css_callouts.aspx#comments</comments><dc:creator>Ramesh Soni</dc:creator><category>Design</category><description>&lt;p&gt;This article explains how you can create callouts using CSS and without using a single image. This will use the CSS thick border technique for creating slant area. Look at the callouts below:&lt;/p&gt;
&lt;style type="text/css"&gt;
	.calloutUp
	{
		height: 0;
		width: 0;
		border-bottom: 12px solid #ffffff;
		border-left: 12px dotted transparent;
		border-right: 12px dotted transparent;
		left: 0px;
		top: 0px;
		margin-left: 20px;
		z-index: 10;
	}
	.calloutUp2
	{
		position: relative;
		left: -10px;
		top: 2px;
		height: 0;
		width: 0;
		border-bottom: 10px solid #9999ff;
		border-left: 10px dotted transparent;
		border-right: 10px dotted transparent;
		z-index: 11;
	}
	.calloutDown
	{
		height: 0;
		width: 0;
		border-top: 12px solid #ffffff;
		border-left: 12px dotted transparent;
		border-right: 12px dotted transparent;
		left: 0px;
		top: 0px;
		margin-left: 20px;
		z-index: 11;
	}
	.calloutDown2
	{
		position: relative;
		left: -10px;
		top: -12px;
		height: 0;
		width: 0;
		border-top: 10px solid #9999ff;
		border-left: 10px dotted transparent;
		border-right: 10px dotted transparent;
		z-index: 10;
	}
	.divContainerUp
	{
		background-color: #9999ff;
		border: solid 1px #ffffff;
		position: relative;
		top: -1px;
		z-index: 9;
		width: 500px;
		padding: 4px;
	}
	.divContainerDown
	{
		background-color: #9999ff;
		border: solid 1px #ffffff;
		position: relative;
		top: 1px;
		z-index: 3;
		width: 500px;
		padding: 4px;
	}
	.divContainerMain
	{
		background-color: #ccccff;
		padding: 16px;
	}
&lt;/style&gt;
&lt;p&gt;
&lt;div class="divContainerMain"&gt;
&lt;div class="divContainerDown"&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam dignissim tincidunt turpis. Mauris pede. Vestibulum gravida magna id nibh. In nec urna. Sed ut purus. Duis sit amet lacus ornare massa mattis consequat. Donec nec tellus. Nam quis nulla viverra diam faucibus dictum. Nulla facilisi. Donec sit amet dolor at sapien accumsan consectetuer. &lt;/div&gt;
&lt;div class="calloutDown"&gt;
&lt;div class="calloutDown2"&gt;&lt;/div&gt;&lt;/div&gt;
&lt;div&gt;&lt;a href="#"&gt;Ramesh Soni&lt;/a&gt; Said&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This callout is created only using CSS. The arrow shown in the callout is basically a DIV with thick up border and transparent left and right border. 
&lt;!--more--&gt;
And its height and width are 0. You only see the border or the DIV which will create the arrow like effect. 
&lt;p&gt;Here is the complete CSS and html code of this: 
&lt;p&gt;
&lt;h3&gt;CSS Code&lt;/h3&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;style&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;="text/css"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;    
    .calloutUp
    {
        height: 0;
        width: 0;
        border-bottom: 12px solid #ffffff;
        border-left: 12px dotted transparent;
        border-right: 12px dotted transparent;
        left: 0px;
        top: 0px;
        margin-left: 20px;
        z-index: 10;
    }
    .calloutUp2
    {
        position: relative;
        left: -10px;
        top: 2px;
        height: 0;
        width: 0;
        border-bottom: 10px solid #9999ff;
        border-left: 10px dotted transparent;
        border-right: 10px dotted transparent;
        z-index: 11;
    }
    .calloutDown
    {
        height: 0;
        width: 0;
        border-top: 12px solid #ffffff;
        border-left: 12px dotted transparent;
        border-right: 12px dotted transparent;
        left: 0px;
        top: 0px;
        margin-left: 20px;
        z-index: 11;
    }
    .calloutDown2
    {
        position: relative;
        left: -10px;
        top: -12px;
        height: 0;
        width: 0;
        border-top: 10px solid #9999ff;
        border-left: 10px dotted transparent;
        border-right: 10px dotted transparent;
        z-index: 10;
    }
    .divContainerUp
    {
        background-color: #9999ff;
        border: solid 1px #ffffff;
        position: relative;
        top: -1px;
        z-index: 9;
        width: 500px;
        padding: 4px;
    }
    .divContainerDown
    {
        background-color: #9999ff;
        border: solid 1px #ffffff;
        position: relative;
        top: 1px;
        z-index: 3;
        width: 500px;
        padding: 4px;
    }
    .divContainerMain
    {
        background-color: #ccccff;
        padding: 8px;
    }
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--ads--&gt;
&lt;p&gt;
&lt;h3&gt;Html Code&lt;/h3&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="divContainerMain"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;h3&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        Up Side Callout&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;h3&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;a&lt;/span&gt; &lt;span class="attr"&gt;href&lt;/span&gt;&lt;span class="kwrd"&gt;="#"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Ramesh Soni&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;a&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; Said&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="calloutUp"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="calloutUp2"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="divContainerUp"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam dignissim tincidunt
        turpis. Mauris pede. Vestibulum gravida magna id nibh. In nec urna. Sed ut purus.
        Duis sit amet lacus ornare massa mattis consequat. Donec nec tellus. Nam quis nulla
        viverra diam faucibus dictum. Nulla facilisi. Donec sit amet dolor at sapien accumsan
        consectetuer.
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;br&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;br&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;h3&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        Down Side Callout&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;h3&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="divContainerDown"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam dignissim tincidunt
        turpis. Mauris pede. Vestibulum gravida magna id nibh. In nec urna. Sed ut purus.
        Duis sit amet lacus ornare massa mattis consequat. Donec nec tellus. Nam quis nulla
        viverra diam faucibus dictum. Nulla facilisi. Donec sit amet dolor at sapien accumsan
        consectetuer.
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="calloutDown"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="calloutDown2"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;a&lt;/span&gt; &lt;span class="attr"&gt;href&lt;/span&gt;&lt;span class="kwrd"&gt;="#"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Ramesh Soni&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;a&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; Said&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;Here is a full example and up side and down side callouts.
&lt;div class="divContainerMain"&gt;
	&lt;h3&gt;
		Up Side Callout&lt;/h3&gt;
	&lt;div&gt;
		&lt;a href="#"&gt;Ramesh Soni&lt;/a&gt; Said&lt;/div&gt;
	&lt;div class="calloutUp"&gt;
		&lt;div class="calloutUp2"&gt;
		&lt;/div&gt;
	&lt;/div&gt;
	&lt;div class="divContainerUp"&gt;
		Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam dignissim tincidunt
		turpis. Mauris pede. Vestibulum gravida magna id nibh. In nec urna. Sed ut purus.
		Duis sit amet lacus ornare massa mattis consequat. Donec nec tellus. Nam quis nulla
		viverra diam faucibus dictum. Nulla facilisi. Donec sit amet dolor at sapien accumsan
		consectetuer.
	&lt;/div&gt;
	&lt;br /&gt;
	&lt;h3&gt;
		Down Side Callout&lt;/h3&gt;
	&lt;div class="divContainerDown"&gt;
		Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam dignissim tincidunt
		turpis. Mauris pede. Vestibulum gravida magna id nibh. In nec urna. Sed ut purus.
		Duis sit amet lacus ornare massa mattis consequat. Donec nec tellus. Nam quis nulla
		viverra diam faucibus dictum. Nulla facilisi. Donec sit amet dolor at sapien accumsan
		consectetuer.
	&lt;/div&gt;
	&lt;div class="calloutDown"&gt;
		&lt;div class="calloutDown2"&gt;
		&lt;/div&gt;
	&lt;/div&gt;
	&lt;div&gt;
		&lt;a href="#"&gt;Ramesh Soni&lt;/a&gt; Said&lt;/div&gt;
&lt;/div&gt;&lt;/p&gt;</description><link>http://www.dailycoding.com/Posts/purely_css_callouts.aspx</link><pubDate>Thu, 16 Oct 2008 02:16</pubDate></item><item><title>Top 7 Tip for Optimizing CSS</title><comments>http://www.dailycoding.com/Posts/top_7_tip_for_optimizing_css.aspx#comments</comments><dc:creator>Ramesh Soni</dc:creator><category>Design</category><description>&lt;p&gt;CSS is very important component for design and layout of web pages. These includes all the syles like colors, size, position, backgrounds, fonts etc. to enrich the look and feel of you pages, but it is very easy for CSS to grow to a huge size if you are not following proper guidelines to optimize this. By doing so you are not only making you css cleaner but also decreasing the response size of file. Here are some tip for optimizing the CSS:&lt;/p&gt;
&lt;!--more--&gt;
&lt;img src="http://www.dailycoding.com/Uploads/2008/10/css_logo_medium.png" width="100" height="100" /&gt;
&lt;h3&gt;1. Aggregate Multiple Properties&lt;/h3&gt;

&lt;p&gt;Combine multiple properties. For example&lt;/p&gt;

&lt;p&gt;for margin, instead of&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="op"&gt;margin-top: 8px;
margin-right: 4px;
margin-bottom: 8px;
margin-left: 4px;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;you can use&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="op"&gt;margin: 8px 4px 8px 4px;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;for font instead of&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="op"&gt;font-family: Tahoma;
font-weight: bold;
font-style: italic;
font-size: 12px;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;you can use&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="op"&gt;font: italic bold 12px Tahoma;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;for background instead of&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="op"&gt;background-image: url(bk_main.jpg);
background-repeat: repeat-x;
background-color: #ccccff;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;you can use&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="op"&gt;background: #ccccff url(bk_main.jpg) repeat-x;&lt;/span&gt;&lt;/pre&gt;

&lt;h3&gt;2. Group Common Styles&lt;/h3&gt;

&lt;p&gt;If you are having something like below where two element share some common properties&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="op"&gt;H2
{
    font-size: 16pt;
    color: #4169e1;
    font-family: 'Trebuchet MS' , Arial;
    margin: 4px 0px 2px;
    padding-left: 10px;
    text-decoration: underline;
}

H3
{
    font-size: 14pt;
    color: #4169e1;
    font-family: 'Trebuchet MS' , Arial;
    margin: 4px 0px 2px;
    padding-left: 10px;
    text-decoration: underline;
}&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;Then you can share their common properties like below&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="op"&gt;H2, H3
{
    color: #4169e1;
    font-family: 'Trebuchet MS' , Arial;
    margin: 4px 0px 2px;
    padding-left: 10px;
    text-decoration: underline;
}

H2
{
    font-size: 16pt;
}

H3
{
    font-size: 14pt;
}&lt;/span&gt;&lt;/pre&gt;

&lt;h3&gt;3. Use Shorthand Hexadecimal for Simple Colors&lt;/h3&gt;

&lt;p&gt;You can also specify simple colors using shorthand color names. For example&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="op"&gt;#99ff33 can be replace with #9f3
#ff0000 can be replace with #f00
#000000 can be replace with #000&lt;/span&gt;&lt;/pre&gt;

&lt;h3&gt;4. Use Classes in Parent Elements&lt;/h3&gt;

&lt;p&gt;You may specify element style in the parent control. Instead of using&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;myClass&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Home&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;myClass&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;About&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;myClass&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Contact&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;myClass&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Sitemap&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;you may also do this&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;myClass&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Home&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;About&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Contact&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Sitemap&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;h3&gt;5. Don't Use Giddy Comments&lt;/h3&gt;

&lt;p&gt;The below comment&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;/*****************************/&lt;/span&gt;
&lt;span class="rem"&gt;/**********Header CSS*********/&lt;/span&gt;
&lt;span class="rem"&gt;/*****************************/&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;can also simply written as&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;/*Header CSS*/&lt;/span&gt;&lt;/pre&gt;

&lt;h3&gt;6. Never Attach Style to Elements&lt;/h3&gt;

&lt;p&gt;Always specify styles in CSS. Don't add styles directly to elements. Instead of &lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt; &lt;span class="attr"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;font-size: 14pt ;font-family: Arial; text-decoration: underline;&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Home&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt; &lt;span class="attr"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;font-size: 14pt ;font-family: Arial; text-decoration: underline;&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;About&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt; &lt;span class="attr"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;font-size: 14pt ;font-family: Arial; text-decoration: underline;&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Contact&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt; &lt;span class="attr"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;font-size: 14pt ;font-family: Arial; text-decoration: underline;&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Sitemap&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;use&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;myClass&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Home&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;myClass&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;About&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;myClass&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Contact&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;myClass&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Sitemap&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;h3&gt;7. Remove Extra White Spaces and Line breaks&lt;/h3&gt;

&lt;p&gt;For decreasing the file size you can remove the extra white spaces and lines breaks between styles.&lt;/p&gt;</description><link>http://www.dailycoding.com/Posts/top_7_tip_for_optimizing_css.aspx</link><pubDate>Mon, 06 Oct 2008 02:13</pubDate></item><item><title>Animated Progress Bar without Images</title><comments>http://www.dailycoding.com/Posts/animated_progress_bar_without_images.aspx#comments</comments><dc:creator>Ramesh Soni</dc:creator><category>Scripting</category><description>&lt;p&gt;Look at below progress bars&lt;/p&gt;

&lt;p&gt;&lt;style type="text/css" media="screen"&gt;



		.progressTable
		{
			border: solid 1px #e1e1e1;
		}
		
		.size, .cell1, .cell2, .cell3
		{
			width: 15px;
			height: 15px;	
		}
		.cell1
		{		
			background-color: #22dd22;
			display: none;
		}
		.cell2
		{		
			background-color: #dd2222;
			display: none;
		}
		.cell3
		{		
			background-color: #2222dd;
			display: none;
		}
	&lt;/style&gt;&lt;script language="javascript"&gt;



	&lt;!--
	$(document).ready(function()
	{
		var bar1 = new ProgressBar("progressContainer1", 10, "progressTable", "cell1", "size");
		bar1.Start();
		
		var bar2 = new ProgressBar("progressContainer2", 10, "progressTable", "cell2", "size");
		bar2.Start();
		
		var bar3 = new ProgressBar("progressContainer3", 10, "progressTable", "cell3", "size");
		bar3.Start();
	});
		
	var ProgressBar = function(divId, cellCount, tableCss, cellCss, sizeCss)
	{
		var index = -1;
		var timerObj = new Timer();
		
		this.Init = function()
		{
			var str = "&lt;table class='" + tableCss + "' cellpadding='0' cellspacing='1'&gt;&lt;tr&gt;";
			for(var cnt=0; cnt&lt;cellCount; cnt++)
			{
				str += "&lt;td class='" + sizeCss + "'&gt;&lt;div class='" + cellCss + " " + cellCss + cnt + "'&gt;&lt;/div&gt;&lt;/td&gt;";
			}
			str += "&lt;/tr&gt;&lt;/table&gt;";
			$("#" + divId).append(str);
			
			timerObj.Interval = 100;
			timerObj.Tick = timer_tick;
		}
		
		this.Start = function()
		{
			this.Init();
			timerObj.Start();
		}
		
		function timer_tick()
		{
			//debugger;
			index = index + 1;
			index = index % cellCount;
			
			$("#" + divId + " ." + cellCss + index).fadeIn(10);
			$("#" + divId + " ." + cellCss + index).fadeOut(500);
		}
	}
	
	// Declaring class "Timer"
	var Timer = function()
	{		
		// Property: Frequency of elapse event of the timer in millisecond
		this.Interval = 1000;
		
		// Property: Whether the timer is enable or not
		this.Enable = new Boolean(false);
		
		// Event: Timer tick
		this.Tick;
		
		// Member variable: Hold interval id of the timer
		var timerId = 0;
		
		// Member variable: Hold instance of this class
		var thisObject;
		
		// Function: Start the timer
		this.Start = function()
		{
			this.Enable = new Boolean(true);
	
			thisObject = this;
			if (thisObject.Enable)
			{
				thisObject.timerId = setInterval(
				function()
				{
					thisObject.Tick(); 
				}, thisObject.Interval);
			}
		};
		
		// Function: Stops the timer
		this.Stop = function()
		{			
			thisObject.Enable = new Boolean(false);
			clearInterval(thisObject.timerId);
		};
	
	};
	
	//--&gt;
	&lt;/script&gt;&lt;/p&gt;

&lt;div id="progressContainer1"&gt;&lt;/div&gt;

&lt;br /&gt;

&lt;div id="progressContainer2"&gt;&lt;/div&gt;

&lt;br /&gt;

&lt;div id="progressContainer3"&gt;&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;These don't contain any images. They all are pure JavaScript based progress bars. They uses the &lt;a href="http://www.dailycoding.com/Posts/object_oriented_programming_with_javascript__timer_class.aspx"&gt;JavaScript Timer Class&lt;/a&gt; for the delay and jQuery fading function transparency for animated effect.&lt;!--more--&gt; To add a progress bar to the page is very easy, just add include the ProgressBar class and add following code:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; bar1 = &lt;span class="kwrd"&gt;new&lt;/span&gt; ProgressBar(&lt;span class="str"&gt;&amp;quot;progressContainer1&amp;quot;&lt;/span&gt;, 10, 
  &lt;span class="str"&gt;&amp;quot;progressTable&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;cell1&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;size&amp;quot;&lt;/span&gt;);
bar1.Start();&lt;/pre&gt;

&lt;p&gt;First parameter is the ID of the div which will contain the progress bar. Second parameter is number of cells you want to have in progress bar. Third is the css class for outer table of the progress bar. Fourth is the the css class for each celll and fifth the the css class for the size of each cell.&lt;/p&gt;

&lt;p&gt;Here is the code for the whole example and &lt;a href="http://www.dailycoding.com/Uploads/2008/09/Progress.htm"&gt;this&lt;/a&gt; is the link to the live demo.&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;html&lt;/span&gt; &lt;span class="attr"&gt;xmlns&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;head&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Animated Progress Bar without images&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;

    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;script&lt;/span&gt; &lt;span class="attr"&gt;src&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;jquery.js&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;script&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;

    &amp;lt;style media=&lt;span class="str"&gt;&amp;quot;screen&amp;quot;&lt;/span&gt; type=&lt;span class="str"&gt;&amp;quot;text/css&amp;quot;&lt;/span&gt;&amp;gt;
        .progressTable
        {
            border: solid 1px #e1e1e1;
        }
        
        .size, .cell1, .cell2, .cell3
        {
            width: 15px;
            height: 15px;    
        }
        .cell1
        {        
            background-color: #22dd22;
            display: none;
        }
        .cell2
        {        
            background-color: #dd2222;
            display: none;
        }
        .cell3
        {        
            background-color: #2222dd;
            display: none;
        }
    &amp;lt;/style&amp;gt;
    &amp;lt;script language=&lt;span class="str"&gt;&amp;quot;javascript&amp;quot;&lt;/span&gt;&amp;gt;
    &amp;lt;!--
    $(document).ready(&lt;span class="kwrd"&gt;function&lt;/span&gt;()
    {
        &lt;span class="kwrd"&gt;var&lt;/span&gt; bar1 = &lt;span class="kwrd"&gt;new&lt;/span&gt; ProgressBar(&lt;span class="str"&gt;&amp;quot;progressContainer1&amp;quot;&lt;/span&gt;, 10, 
          &lt;span class="str"&gt;&amp;quot;progressTable&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;cell1&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;size&amp;quot;&lt;/span&gt;);
        bar1.Start();
        
        &lt;span class="kwrd"&gt;var&lt;/span&gt; bar2 = &lt;span class="kwrd"&gt;new&lt;/span&gt; ProgressBar(&lt;span class="str"&gt;&amp;quot;progressContainer2&amp;quot;&lt;/span&gt;, 10, 
          &lt;span class="str"&gt;&amp;quot;progressTable&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;cell2&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;size&amp;quot;&lt;/span&gt;);
        bar2.Start();
        
        &lt;span class="kwrd"&gt;var&lt;/span&gt; bar3 = &lt;span class="kwrd"&gt;new&lt;/span&gt; ProgressBar(&lt;span class="str"&gt;&amp;quot;progressContainer3&amp;quot;&lt;/span&gt;, 10, 
          &lt;span class="str"&gt;&amp;quot;progressTable&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;cell3&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;size&amp;quot;&lt;/span&gt;);
        bar3.Start();
    });
        
    &lt;span class="kwrd"&gt;var&lt;/span&gt; ProgressBar = &lt;span class="kwrd"&gt;function&lt;/span&gt;(divId, cellCount, tableCss, cellCss, sizeCss)
    {
        &lt;span class="kwrd"&gt;var&lt;/span&gt; index = -1;
        &lt;span class="kwrd"&gt;var&lt;/span&gt; timerObj = &lt;span class="kwrd"&gt;new&lt;/span&gt; Timer();
        
        &lt;span class="kwrd"&gt;this&lt;/span&gt;.Init = &lt;span class="kwrd"&gt;function&lt;/span&gt;()
        {
            &lt;span class="kwrd"&gt;var&lt;/span&gt; str = &lt;span class="str"&gt;&amp;quot;&amp;lt;table class='&amp;quot;&lt;/span&gt; + tableCss + &lt;span class="str"&gt;&amp;quot;' cellpadding='0' cellspacing='1'&amp;gt;&amp;lt;tr&amp;gt;&amp;quot;&lt;/span&gt;;
            &lt;span class="kwrd"&gt;for&lt;/span&gt;(&lt;span class="kwrd"&gt;var&lt;/span&gt; cnt=0; cnt&amp;lt;cellCount; cnt++)
            {
                str += &lt;span class="str"&gt;&amp;quot;&amp;lt;td class='&amp;quot;&lt;/span&gt; + sizeCss + &lt;span class="str"&gt;&amp;quot;'&amp;gt;&amp;lt;div class='&amp;quot;&lt;/span&gt; 
                  + cellCss + &lt;span class="str"&gt;&amp;quot; &amp;quot;&lt;/span&gt; + cellCss + cnt + &lt;span class="str"&gt;&amp;quot;'&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/td&amp;gt;&amp;quot;&lt;/span&gt;;
            }
            str += &lt;span class="str"&gt;&amp;quot;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&amp;quot;&lt;/span&gt;;
            $(&lt;span class="str"&gt;&amp;quot;#&amp;quot;&lt;/span&gt; + divId).append(str);
            
            timerObj.Interval = 100;
            timerObj.Tick = timer_tick;
        }
        
        &lt;span class="kwrd"&gt;this&lt;/span&gt;.Start = &lt;span class="kwrd"&gt;function&lt;/span&gt;()
        {
            &lt;span class="kwrd"&gt;this&lt;/span&gt;.Init();
            timerObj.Start();
        }
        
        &lt;span class="kwrd"&gt;function&lt;/span&gt; timer_tick()
        {
            &lt;span class="rem"&gt;//debugger;&lt;/span&gt;
            index = index + 1;
            index = index % cellCount;
            
            $(&lt;span class="str"&gt;&amp;quot;#&amp;quot;&lt;/span&gt; + divId + &lt;span class="str"&gt;&amp;quot; .&amp;quot;&lt;/span&gt; + cellCss + index).fadeIn(10);
            $(&lt;span class="str"&gt;&amp;quot;#&amp;quot;&lt;/span&gt; + divId + &lt;span class="str"&gt;&amp;quot; .&amp;quot;&lt;/span&gt; + cellCss + index).fadeOut(500);
        }
    }
    
    &lt;span class="rem"&gt;// Declaring class &amp;quot;Timer&amp;quot;&lt;/span&gt;
    &lt;span class="kwrd"&gt;var&lt;/span&gt; Timer = &lt;span class="kwrd"&gt;function&lt;/span&gt;()
    {        
        &lt;span class="rem"&gt;// Property: Frequency of elapse event of the timer in millisecond&lt;/span&gt;
        &lt;span class="kwrd"&gt;this&lt;/span&gt;.Interval = 1000;
        
        &lt;span class="rem"&gt;// Property: Whether the timer is enable or not&lt;/span&gt;
        &lt;span class="kwrd"&gt;this&lt;/span&gt;.Enable = &lt;span class="kwrd"&gt;new&lt;/span&gt; Boolean(&lt;span class="kwrd"&gt;false&lt;/span&gt;);
        
        &lt;span class="rem"&gt;// Event: Timer tick&lt;/span&gt;
        &lt;span class="kwrd"&gt;this&lt;/span&gt;.Tick;
        
        &lt;span class="rem"&gt;// Member variable: Hold interval id of the timer&lt;/span&gt;
        &lt;span class="kwrd"&gt;var&lt;/span&gt; timerId = 0;
        
        &lt;span class="rem"&gt;// Member variable: Hold instance of this class&lt;/span&gt;
        &lt;span class="kwrd"&gt;var&lt;/span&gt; thisObject;
        
        &lt;span class="rem"&gt;// Function: Start the timer&lt;/span&gt;
        &lt;span class="kwrd"&gt;this&lt;/span&gt;.Start = &lt;span class="kwrd"&gt;function&lt;/span&gt;()
        {
            &lt;span class="kwrd"&gt;this&lt;/span&gt;.Enable = &lt;span class="kwrd"&gt;new&lt;/span&gt; Boolean(&lt;span class="kwrd"&gt;true&lt;/span&gt;);
    
            thisObject = &lt;span class="kwrd"&gt;this&lt;/span&gt;;
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (thisObject.Enable)
            {
                thisObject.timerId = setInterval(
                &lt;span class="kwrd"&gt;function&lt;/span&gt;()
                {
                    thisObject.Tick(); 
                }, thisObject.Interval);
            }
        };
        
        &lt;span class="rem"&gt;// Function: Stops the timer&lt;/span&gt;
        &lt;span class="kwrd"&gt;this&lt;/span&gt;.Stop = &lt;span class="kwrd"&gt;function&lt;/span&gt;()
        {            
            thisObject.Enable = &lt;span class="kwrd"&gt;new&lt;/span&gt; Boolean(&lt;span class="kwrd"&gt;false&lt;/span&gt;);
            clearInterval(thisObject.timerId);
        };
    
    };
    
    &lt;span class="rem"&gt;//--&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;script&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;head&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;body&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;progressContainer1&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;br&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;progressContainer2&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;br&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;progressContainer3&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;body&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;html&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;</description><link>http://www.dailycoding.com/Posts/animated_progress_bar_without_images.aspx</link><pubDate>Wed, 03 Sep 2008 02:13</pubDate></item><item><title>Maintaining Dirty and New state of objects</title><comments>http://www.dailycoding.com/Posts/maintaining_dirty_and_new_state_of_objects.aspx#comments</comments><dc:creator>Ramesh Soni</dc:creator><category>General</category><description>&lt;p&gt;I have worked on &lt;a href="http://www.lhotka.net/cslanet/"&gt;CSLA&lt;/a&gt; on few projects and I am very much impressed from all of its features. However not every application wants to use CSLA but may be some features out of it. This post is about adding IsDirty and IsNew capabilities to our object. I used CSLA as reference for create these classes.&lt;/p&gt;

&lt;!--more--&gt;
&lt;h3&gt;Base Classes Definitions&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;ObjectBase&lt;/strong&gt;&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; ObjectBase
{
    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; _isDirty;
    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; _isNew = &lt;span class="kwrd"&gt;true&lt;/span&gt;;

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; IsDirty
    {
        get { &lt;span class="kwrd"&gt;return&lt;/span&gt; _isDirty; }
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; IsNew
    {
        get { &lt;span class="kwrd"&gt;return&lt;/span&gt; _isNew; }
    }

    &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; MarkDirty()
    {
        _isDirty = &lt;span class="kwrd"&gt;true&lt;/span&gt;;
    }

    &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; MarkClean()
    {
        _isDirty = &lt;span class="kwrd"&gt;false&lt;/span&gt;;
    }

    &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; MarkAsNew()
    {
        _isNew = &lt;span class="kwrd"&gt;true&lt;/span&gt;;
    }

    &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; MarkAsOld()
    {
        _isNew = &lt;span class="kwrd"&gt;false&lt;/span&gt;;
        _isDirty = &lt;span class="kwrd"&gt;false&lt;/span&gt;;
    }
}&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;ObjectListBase&lt;/strong&gt;&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; ObjectListBase&amp;lt;T&amp;gt; : List&amp;lt;T&amp;gt; &lt;span class="kwrd"&gt;where&lt;/span&gt; T : ObjectBase
{
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; IsDirty
    {
        get
        {
            &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (T item &lt;span class="kwrd"&gt;in&lt;/span&gt; &lt;span class="kwrd"&gt;this&lt;/span&gt;)
            {
                &lt;span class="kwrd"&gt;if&lt;/span&gt; (item.IsDirty)
                    &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;true&lt;/span&gt;;
            }
            &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;false&lt;/span&gt;;
        }
    }
}&lt;/pre&gt;

&lt;h3&gt;Using Base Classes&lt;/h3&gt;
&lt;p&gt;To use these base classes, simply inherit your business object from ObjectBase and collection objects from ObjectListBase. Let take example:&lt;/p&gt;

&lt;p&gt;Suppose a class Employee represents an employee entity and its collection class EmployeeList.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Employee&lt;/strong&gt;&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Employee : ObjectBase
{
    &lt;span class="rem"&gt;// Member Variables&lt;/span&gt;
    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; _employeeCode;
    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; _employeeName;
    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;decimal&lt;/span&gt; _salary;

    &lt;span class="rem"&gt;// Public properties&lt;/span&gt;
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; EmployeeCode
    {
        get { &lt;span class="kwrd"&gt;return&lt;/span&gt; _employeeCode; }
        set
        {
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (_employeeCode != &lt;span class="kwrd"&gt;value&lt;/span&gt;)
            {
                _employeeCode = &lt;span class="kwrd"&gt;value&lt;/span&gt;;
                &lt;span class="kwrd"&gt;base&lt;/span&gt;.MarkDirty();
            }
        }
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; EmployeeName
    {
        get { &lt;span class="kwrd"&gt;return&lt;/span&gt; _employeeName; }
        set
        {
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (_employeeName != &lt;span class="kwrd"&gt;value&lt;/span&gt;)
            {
                _employeeName = &lt;span class="kwrd"&gt;value&lt;/span&gt;;
                &lt;span class="kwrd"&gt;base&lt;/span&gt;.MarkDirty();
            }
        }
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;decimal&lt;/span&gt; Salary
    {
        get { &lt;span class="kwrd"&gt;return&lt;/span&gt; _salary; }
        set
        {
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (_salary != &lt;span class="kwrd"&gt;value&lt;/span&gt;)
            {
                _salary = &lt;span class="kwrd"&gt;value&lt;/span&gt;;
                &lt;span class="kwrd"&gt;base&lt;/span&gt;.MarkDirty();
            }
        }
    }

    &lt;span class="rem"&gt;// Constructor&lt;/span&gt;
    &lt;span class="kwrd"&gt;public&lt;/span&gt; Employee()
    {
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Fetch(&lt;span class="kwrd"&gt;int&lt;/span&gt; employeeCode)
    {
        &lt;span class="rem"&gt;// Code to fetch employee&lt;/span&gt;
        &lt;span class="kwrd"&gt;base&lt;/span&gt;.MarkAsOld();
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Save()
    {
        &lt;span class="rem"&gt;// Code to save employee&lt;/span&gt;
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (&lt;span class="kwrd"&gt;base&lt;/span&gt;.IsNew)
        {
            &lt;span class="rem"&gt;// Code Insert into database&lt;/span&gt;
        }
        &lt;span class="kwrd"&gt;else&lt;/span&gt;
        {
            &lt;span class="rem"&gt;// Code to Update into databse&lt;/span&gt;
        }

        &lt;span class="kwrd"&gt;base&lt;/span&gt;.MarkClean();
        &lt;span class="kwrd"&gt;base&lt;/span&gt;.MarkAsOld();
    }
}&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;EmployeeList&lt;/strong&gt;&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; EmployeeList : ObjectListBase&amp;lt;Employee&amp;gt;
{
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; EmployeeList GetAllEmployees()
    {
        EmployeeList employes = &lt;span class="kwrd"&gt;new&lt;/span&gt; EmployeeList();
        employes.FetchAll();
    }

    &lt;span class="kwrd"&gt;protected&lt;/span&gt; EmployeeList()
    {
    }

    &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; FetchAll()
    {
        &lt;span class="rem"&gt;// Code to fetch employee list and &lt;/span&gt;
        &lt;span class="rem"&gt;// add to this list&lt;/span&gt;
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Save()
    {
        &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (Employee employee &lt;span class="kwrd"&gt;in&lt;/span&gt; &lt;span class="kwrd"&gt;this&lt;/span&gt;)
        {
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (employee.IsDirty)
            {
                employee.Save();
            }
        }
    }
}&lt;/pre&gt;

&lt;h3&gt;Using Objects&lt;/h3&gt;

&lt;p&gt;See the code below:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;EmployeeList employess = EmployeeList.GetAllEmployees();

&lt;span class="rem"&gt;// ..
// do operation of list
// ..&lt;/span&gt;

&lt;span class="rem"&gt;// Saves the list&lt;/span&gt;
&lt;span class="kwrd"&gt;if&lt;/span&gt; (employess.IsDirty)
{
    employess.Save();
}&lt;/pre&gt;

&lt;p&gt;Above code fetch list employee from database. You may perform add/edit operations on this. The class will manage the dirty and new state of object itself and Saves only those object in which changes are done. In this way we can save unnecessary trips to database.&lt;/p&gt;</description><link>http://www.dailycoding.com/Posts/maintaining_dirty_and_new_state_of_objects.aspx</link><pubDate>Tue, 26 Aug 2008 02:10</pubDate></item><item><title>Object Oriented Programming with JavaScript : Timer Class</title><comments>http://www.dailycoding.com/Posts/object_oriented_programming_with_javascript__timer_class.aspx#comments</comments><dc:creator>Ramesh Soni</dc:creator><category>Scripting</category><description>&lt;p&gt;JavaScript with Oops is not much used by developers while creating application however we can make our life easy if we use JavaScript with Oops.&lt;/p&gt;
&lt;p&gt;Let's started object oriented programming in JavaScript by taking example of a Timer class, similar to the Timer control in windows application.&lt;/p&gt;

&lt;h3&gt;Create Class&lt;/h3&gt;

&lt;p&gt;Create the class Timer. Below code shows how to declare the class&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;// Declaring class &amp;quot;Timer&amp;quot;&lt;/span&gt;
&lt;span class="kwrd"&gt;var&lt;/span&gt; Timer = &lt;span class="kwrd"&gt;function&lt;/span&gt;()
{
    &lt;span class="rem"&gt;// ....        &lt;/span&gt;
    &lt;span class="rem"&gt;// Class body&lt;/span&gt;
    &lt;span class="rem"&gt;// ....&lt;/span&gt;
}&lt;/pre&gt;
&lt;!--more--&gt;
&lt;h3&gt;Add Public Properties&lt;/h3&gt;

&lt;p&gt;To add public properties to the class we use this keyword as shown below&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;// Declaring class &amp;quot;Timer&amp;quot;&lt;/span&gt;
&lt;span class="kwrd"&gt;var&lt;/span&gt; Timer = &lt;span class="kwrd"&gt;function&lt;/span&gt;()
{        
    &lt;span class="rem"&gt;// Property: Frequency of elapse event of the timer in millisecond&lt;/span&gt;
    &lt;span class="kwrd"&gt;this&lt;/span&gt;.Interval = 1000;
    
    &lt;span class="rem"&gt;// Property: Whether the timer is enable or not&lt;/span&gt;
    &lt;span class="kwrd"&gt;this&lt;/span&gt;.Enable = &lt;span class="kwrd"&gt;new&lt;/span&gt; Boolean(&lt;span class="kwrd"&gt;false&lt;/span&gt;);
}&lt;/pre&gt;

&lt;p&gt;You can see that we have created 2 properties (Interval and Enable) of Timer class and assigned default values to them.&lt;/p&gt;

&lt;h3&gt;Add Events (If any)&lt;/h3&gt;

&lt;p&gt;Now we might want to add events to the class in case we need. For Timer class we need &amp;quot;Tick&amp;quot; event which will be fired every after &amp;quot;Interval&amp;quot;. Event are added the same way as the public properties.&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;// Declaring class &amp;quot;Timer&amp;quot;&lt;/span&gt;
&lt;span class="kwrd"&gt;var&lt;/span&gt; Timer = &lt;span class="kwrd"&gt;function&lt;/span&gt;()
{        
    &lt;span class="rem"&gt;// Property: Frequency of elapse event of the timer in millisecond&lt;/span&gt;
    &lt;span class="kwrd"&gt;this&lt;/span&gt;.Interval = 1000;
    
    &lt;span class="rem"&gt;// Property: Whether the timer is enable or not&lt;/span&gt;
    &lt;span class="kwrd"&gt;this&lt;/span&gt;.Enable = &lt;span class="kwrd"&gt;new&lt;/span&gt; Boolean(&lt;span class="kwrd"&gt;false&lt;/span&gt;);
    
    &lt;span class="rem"&gt;// Event: Timer tick&lt;/span&gt;
    &lt;span class="kwrd"&gt;this&lt;/span&gt;.Tick;
}&lt;/pre&gt;

&lt;h3&gt;Add Private Member Variables&lt;/h3&gt;

&lt;p&gt;We need 2 private variable in the class to hold the timer Id and the class instance. The private variable are added using 'var' keyword.&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;// Declaring class &amp;quot;Timer&amp;quot;&lt;/span&gt;
&lt;span class="kwrd"&gt;var&lt;/span&gt; Timer = &lt;span class="kwrd"&gt;function&lt;/span&gt;()
{        
    &lt;span class="rem"&gt;// Property: Frequency of elapse event of the timer in millisecond&lt;/span&gt;
    &lt;span class="kwrd"&gt;this&lt;/span&gt;.Interval = 1000;
    
    &lt;span class="rem"&gt;// Property: Whether the timer is enable or not&lt;/span&gt;
    &lt;span class="kwrd"&gt;this&lt;/span&gt;.Enable = &lt;span class="kwrd"&gt;new&lt;/span&gt; Boolean(&lt;span class="kwrd"&gt;false&lt;/span&gt;);
    
    &lt;span class="rem"&gt;// Event: Timer tick&lt;/span&gt;
    &lt;span class="kwrd"&gt;this&lt;/span&gt;.Tick;
    
    &lt;span class="rem"&gt;// Member variable: Hold interval id of the timer&lt;/span&gt;
    &lt;span class="kwrd"&gt;var&lt;/span&gt; timerId = 0;
    
    &lt;span class="rem"&gt;// Member variable: Hold instance of this class&lt;/span&gt;
    &lt;span class="kwrd"&gt;var&lt;/span&gt; thisObject;
}&lt;/pre&gt;

&lt;h3&gt;Add Functions&lt;/h3&gt;

&lt;p&gt;Public functions are also added the same way as public properties using this keyword. We need 2 function in the timer, first &amp;quot;Start&amp;quot; to start the timer and second &amp;quot;Stop&amp;quot; to stop the timer.&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;// Declaring class &amp;quot;Timer&amp;quot;&lt;/span&gt;
&lt;span class="kwrd"&gt;var&lt;/span&gt; Timer = &lt;span class="kwrd"&gt;function&lt;/span&gt;()
{        
    &lt;span class="rem"&gt;// Property: Frequency of elapse event of the timer in millisecond&lt;/span&gt;
    &lt;span class="kwrd"&gt;this&lt;/span&gt;.Interval = 1000;
    
    &lt;span class="rem"&gt;// Property: Whether the timer is enable or not&lt;/span&gt;
    &lt;span class="kwrd"&gt;this&lt;/span&gt;.Enable = &lt;span class="kwrd"&gt;new&lt;/span&gt; Boolean(&lt;span class="kwrd"&gt;false&lt;/span&gt;);
    
    &lt;span class="rem"&gt;// Event: Timer tick&lt;/span&gt;
    &lt;span class="kwrd"&gt;this&lt;/span&gt;.Tick;
    
    &lt;span class="rem"&gt;// Member variable: Hold interval id of the timer&lt;/span&gt;
    &lt;span class="kwrd"&gt;var&lt;/span&gt; timerId = 0;
    
    &lt;span class="rem"&gt;// Member variable: Hold instance of this class&lt;/span&gt;
    &lt;span class="kwrd"&gt;var&lt;/span&gt; thisObject;
    
    &lt;span class="rem"&gt;// Function: Start the timer&lt;/span&gt;
    &lt;span class="kwrd"&gt;this&lt;/span&gt;.Start = &lt;span class="kwrd"&gt;function&lt;/span&gt;()
    {
        &lt;span class="kwrd"&gt;this&lt;/span&gt;.Enable = &lt;span class="kwrd"&gt;new&lt;/span&gt; Boolean(&lt;span class="kwrd"&gt;true&lt;/span&gt;);

        thisObject = &lt;span class="kwrd"&gt;this&lt;/span&gt;;
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (thisObject.Enable)
        {
            thisObject.timerId = setInterval(
            &lt;span class="kwrd"&gt;function&lt;/span&gt;()
            {
                thisObject.Tick(); 
            }, thisObject.Interval);
        }
    };
    
    &lt;span class="rem"&gt;// Function: Stops the timer&lt;/span&gt;
    &lt;span class="kwrd"&gt;this&lt;/span&gt;.Stop = &lt;span class="kwrd"&gt;function&lt;/span&gt;()
    {            
        thisObject.Enable = &lt;span class="kwrd"&gt;new&lt;/span&gt; Boolean(&lt;span class="kwrd"&gt;false&lt;/span&gt;);
        clearInterval(thisObject.timerId);
    };

};&lt;/pre&gt;

&lt;p&gt;You can see I have incorporated the timer functionality using the setInterval function of the JavaScript. Our class is ready for use now.&lt;/p&gt;

&lt;h3&gt;Using the Class&lt;/h3&gt;

&lt;p&gt;To use the class first create the instance of Timer.&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; obj = &lt;span class="kwrd"&gt;new&lt;/span&gt; Timer();&lt;/pre&gt;

&lt;p&gt;Now assign the value to its properties as needed.&lt;/p&gt;

&lt;pre class="csharpcode"&gt;obj.Interval = 300;&lt;/pre&gt;

&lt;p&gt;Attach handler to the events&lt;/p&gt;

&lt;pre class="csharpcode"&gt;obj.Tick = timer_tick;

&lt;span class="kwrd"&gt;function&lt;/span&gt; timer_tick()
{
    &lt;span class="rem"&gt;// Do something..&lt;/span&gt;
}&lt;/pre&gt;

&lt;p&gt;Now call the &amp;quot;Start&amp;quot; function to start the timer&lt;/p&gt;

&lt;pre class="csharpcode"&gt;obj.Start();&lt;/pre&gt;

&lt;p&gt;To stop the timer anytime in between just call the &amp;quot;Stop&amp;quot; function.&lt;/p&gt;

&lt;pre class="csharpcode"&gt;obj.Stop();&lt;/pre&gt;

&lt;p&gt;&lt;a href="http://www.dailycoding.com/Uploads/2008/08/TimerClass.htm"&gt;Here&lt;/a&gt; is a working example of this class for you reference.&lt;/p&gt;</description><link>http://www.dailycoding.com/Posts/object_oriented_programming_with_javascript__timer_class.aspx</link><pubDate>Wed, 13 Aug 2008 02:10</pubDate></item><item><title>Avoiding Event != null Check</title><comments>http://www.dailycoding.com/Posts/avoiding_event__null_check.aspx#comments</comments><dc:creator>Ramesh Soni</dc:creator><category>General</category><description>&lt;p&gt;Lets take a simple example of declaring and raising a custom event. Look at the code below:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; EventTestClass
{
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;event&lt;/span&gt; EventHandler NewEvent;

    &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; OnNewEvent()
    {
        NewEvent(&lt;span class="kwrd"&gt;this&lt;/span&gt;, EventArgs.Empty);
        &lt;span class="rem"&gt;// Above code will raise System.NullReferenceException&lt;/span&gt;
        &lt;span class="rem"&gt;// exception if there is no handler registered with it.&lt;/span&gt;
    }
}&lt;/pre&gt;
&lt;!--more--&gt;
&lt;p&gt;As you know if if don't attach any handler to the NewEvent above then the OnNewEvent will throw exception because the NewEvent is null at that time. To get rid of this we generally put a null check on the event as shown below:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; EventTestClass
{
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;event&lt;/span&gt; EventHandler NewEvent;

    &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; OnNewEvent()
    {
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (NewEvent != &lt;span class="kwrd"&gt;null&lt;/span&gt;)
        {
            NewEvent(&lt;span class="kwrd"&gt;this&lt;/span&gt;, EventArgs.Empty);
        }
    }
}&lt;/pre&gt;

&lt;p&gt;There could be better way solving problem look at the solution below:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; EventTestClass
{
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;event&lt;/span&gt; EventHandler NewEvent = &lt;span class="kwrd"&gt;delegate&lt;/span&gt; { };

    &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; OnNewEvent()
    {
        NewEvent(&lt;span class="kwrd"&gt;this&lt;/span&gt;, EventArgs.Empty);
    }
}&lt;/pre&gt;

&lt;p&gt;The above code will work perfectly fine even if you don't attach any handler to the event. This is because the event is not null now as we have already registered on empty handler with it.&lt;/p&gt;</description><link>http://www.dailycoding.com/Posts/avoiding_event__null_check.aspx</link><pubDate>Thu, 07 Aug 2008 02:10</pubDate></item><item><title>Layout Form without Tables with CSS Trick</title><comments>http://www.dailycoding.com/Posts/layout_form_without_tables_with_css_trick.aspx#comments</comments><dc:creator>Ramesh Soni</dc:creator><category>Design</category><description>&lt;p&gt;Creating a form with lots of field could be a tedious task as it involves playing with TR and TD in html table. Along with that it also increases the size and complexity of the html code of out page. e.g. Look at the below form:&lt;/p&gt;

&lt;style type="text/css"&gt;
	.formLayout
	{
		background-color: #f3f3f3;
		border: solid 1px #a1a1a1;
		padding: 10px;
		width: 300px;
	}
	
    .formLayout label, .formLayout input
    {
		display: block;
		width: 120px;
		float: left;
		margin-bottom: 10px;
	}
 
	.formLayout label
	{
		text-align: right;
		padding-right: 20px;
	}
 
	br
	{
		clear: left;
	}
    &lt;/style&gt;

&lt;p&gt;

&lt;div class="formLayout"&gt;&lt;label&gt;Title&lt;/label&gt; &lt;select&gt; &lt;option&gt;Mr.&lt;/option&gt; &lt;option&gt;Dr.&lt;/option&gt; &lt;option&gt;Ms.&lt;/option&gt; &lt;option&gt;Mrs.&lt;/option&gt;&lt;/select&gt;

  &lt;br /&gt;&lt;label&gt;First Name&lt;/label&gt; &lt;input id="name" name="name" /&gt;

  &lt;br /&gt;&lt;label&gt;Last Name&lt;/label&gt; &lt;input id="Text1" name="name" /&gt;

  &lt;br /&gt;&lt;label&gt;Address&lt;/label&gt; &lt;input id="address1" /&gt;

  &lt;br /&gt;&lt;label&gt;&lt;/label&gt;&lt;input id="address2" /&gt;

  &lt;br /&gt;&lt;label&gt;City&lt;/label&gt; &lt;select id="city"&gt; &lt;option&gt;New York&lt;/option&gt; &lt;option&gt;Chicago&lt;/option&gt; &lt;option&gt;etc.&lt;/option&gt;&lt;/select&gt;

  &lt;br /&gt;&lt;label&gt;Zip&lt;/label&gt; &lt;input id="zip" /&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;/p&gt;
&lt;!--more--&gt;
&lt;p&gt;Could you imagine it to create without using table or nested div. Well if no then you can just by using easy CSS trick. here is the whole css + html code for doing this.&lt;/p&gt;
&lt;!--ads--&gt;
&lt;pre class="csharpcode"&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;html&lt;/span&gt; &lt;span class="attr"&gt;xmlns&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;head&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Layout Form without Tables&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;style&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;text/css&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    .formLayout
    {
        background-color: #f3f3f3;
        border: solid 1px #a1a1a1;
        padding: 10px;
        width: 300px;
    }
    
    .formLayout label, .formLayout input
    {
        display: block;
        width: 120px;
        float: left;
        margin-bottom: 10px;
    }
 
    .formLayout label
    {
        text-align: right;
        padding-right: 20px;
    }
 
    br
    {
        clear: left;
    }
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;head&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;body&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;formLayout&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;label&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Title&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;label&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;select&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;option&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Mr.&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;option&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;option&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Dr.&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;option&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;option&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Ms.&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;option&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;option&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Mrs.&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;option&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;select&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;br&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;label&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;First Name&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;label&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;input&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;name&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;name&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;br&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;label&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Last Name&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;label&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;input&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Text1&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;name&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;br&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;label&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Address&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;label&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;input&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;address1&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;br&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;label&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;label&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;input&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;address2&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;br&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;label&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;City&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;label&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;select&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;city&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;option&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;New York&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;option&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;option&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Chicago&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;option&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;option&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;etc.&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;option&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;select&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;br&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;label&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Zip&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;label&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;input&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;zip&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;br&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;body&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;html&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;</description><link>http://www.dailycoding.com/Posts/layout_form_without_tables_with_css_trick.aspx</link><pubDate>Mon, 04 Aug 2008 02:08</pubDate></item></channel></rss>