<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://dotnetslackers.com/Community/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>DotNetSlackers Community</title><link>http://dotnetslackers.com/Community/blogs/</link><description /><dc:language>en-US</dc:language><generator>CommunityServer 2007.1 SP1 (Build: 30415.43)</generator><item><title>Head First Design Patterns: Template Method</title><link>http://dotnetslackers.com/Community/blogs/antrad/archive/2008/10/08/head-first-design-patterns-template-method.aspx</link><pubDate>Wed, 08 Oct 2008 15:20:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:29426</guid><dc:creator>antrad</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&amp;nbsp;Template Method...here it is:&lt;/p&gt;
&lt;p&gt;Defines the skeleton of an algorithm, deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorith without changing the algorithm&amp;#39;s structure.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&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.Text;

&lt;span class="kwrd"&gt;namespace&lt;/span&gt; TemplateMethod
{
    &lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
    &lt;span class="rem"&gt;/// Abstract class&lt;/span&gt;
    &lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;abstract&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; CaffeineBeverageWithHook
    {
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; prepareRecipe()
        {
            boilWater();
            braw();
            pourInCup();
            addCondiments();
        }

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;abstract&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; braw();
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;abstract&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; addCondiments();

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; boilWater()
        {
            System.Console.WriteLine(&lt;span class="str"&gt;&amp;quot;Boiling water...&amp;quot;&lt;/span&gt;);
        }

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; pourInCup()
        {
            System.Console.WriteLine(&lt;span class="str"&gt;&amp;quot;Pouring into cup...&amp;quot;&lt;/span&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.Text;

&lt;span class="kwrd"&gt;namespace&lt;/span&gt; TemplateMethod
{
    &lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
    &lt;span class="rem"&gt;/// Concrete class&lt;/span&gt;
    &lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; CoffeeWithHook : CaffeineBeverageWithHook
    {
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; braw()
        {
            System.Console.WriteLine(&lt;span class="str"&gt;&amp;quot;Dripping Coffee through filter...&amp;quot;&lt;/span&gt;);
        }

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; addCondiments()
        {
            System.Console.WriteLine(&lt;span class="str"&gt;&amp;quot;Adding sugar and milk...&amp;quot;&lt;/span&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.Text;
&lt;span class="kwrd"&gt;using&lt;/span&gt; TemplateMethod;

&lt;span class="kwrd"&gt;namespace&lt;/span&gt; test
{
    &lt;span class="kwrd"&gt;class&lt;/span&gt; Program
    {
        &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Main(&lt;span class="kwrd"&gt;string&lt;/span&gt;[] args)
        {
            CaffeineBeverageWithHook obj = &lt;span class="kwrd"&gt;new&lt;/span&gt; CoffeeWithHook();
            obj.prepareRecipe();
            System.Console.ReadLine();
        }
    }
}

Bye
Antonio&lt;/pre&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=29426" width="1" height="1"&gt;</description></item><item><title>jBlogMvc : part 1 Building the Administration Area</title><link>http://dotnetslackers.com/Community/blogs/amrelsehemy/archive/2008/10/06/jblogmvc-part-1-building-the-administration-area.aspx</link><pubDate>Mon, 06 Oct 2008 14:45:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:29381</guid><dc:creator>amrelsehemy</dc:creator><slash:comments>0</slash:comments><description>NOTE: In this series I build a blogengine using ASP.NET MVC and jQuery from scratch in order to learn more about these new technologies. If you haven&amp;#39;t read the first post in this series, I would encourage you do to that first , or check out the jBlogMvc category . You can also always subscribe to the feeds . In this part of the series, I build the administration area of the blog engine I am building using the ASP.NET MVC and jQuery, in this part I will cover more basic features used in any blog...(&lt;a href="http://dotnetslackers.com/Community/blogs/amrelsehemy/archive/2008/10/06/jblogmvc-part-1-building-the-administration-area.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=29381" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/amrelsehemy/archive/tags/jblogmvc/default.aspx">jblogmvc</category><category domain="http://dotnetslackers.com/Community/blogs/amrelsehemy/archive/tags/blogengine/default.aspx">blogengine</category><category domain="http://dotnetslackers.com/Community/blogs/amrelsehemy/archive/tags/jquery/default.aspx">jquery</category><category domain="http://dotnetslackers.com/Community/blogs/amrelsehemy/archive/tags/aspnetmvc/default.aspx">aspnetmvc</category></item><item><title>jBlogMvc : part 2 Editing, Deleting, Paging Posts and Rss feeds</title><link>http://dotnetslackers.com/Community/blogs/amrelsehemy/archive/2008/10/06/jblogmvc-part-2-editing-deleting-paging-posts-and-rss-feeds.aspx</link><pubDate>Mon, 06 Oct 2008 14:39:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:29378</guid><dc:creator>amrelsehemy</dc:creator><slash:comments>0</slash:comments><description>NOTE: In this series I build a blogengine using ASP.NET MVC and jQuery from scratch in order to learn more about these new technologies. If you haven&amp;#39;t read the first post in this series, I would encourage you do to that first , or check out the jBlogMvc category . You can also always subscribe to the feeds . What about new features this part will cover : Configuration is saved in the database. Managing Posts (Editing, Deleting). Posts are now paged. Some jquery magic is used. So, lets have a...(&lt;a href="http://dotnetslackers.com/Community/blogs/amrelsehemy/archive/2008/10/06/jblogmvc-part-2-editing-deleting-paging-posts-and-rss-feeds.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=29378" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/amrelsehemy/archive/tags/jblogmvc/default.aspx">jblogmvc</category><category domain="http://dotnetslackers.com/Community/blogs/amrelsehemy/archive/tags/blogengine/default.aspx">blogengine</category><category domain="http://dotnetslackers.com/Community/blogs/amrelsehemy/archive/tags/jquery/default.aspx">jquery</category><category domain="http://dotnetslackers.com/Community/blogs/amrelsehemy/archive/tags/aspnetmvc/default.aspx">aspnetmvc</category></item><item><title>Eval Statements Don't Access Fields</title><link>http://dotnetslackers.com/Community/blogs/bmains/archive/2008/10/04/eval-statements-don-t-access-fields.aspx</link><pubDate>Sat, 04 Oct 2008 00:49:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:29327</guid><dc:creator>bmains</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&amp;nbsp;I tried to define the following:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Public Class EvaluationCriteria&lt;br /&gt;&amp;nbsp; &amp;nbsp;Public DisplayText As String&lt;br /&gt;&amp;nbsp; &amp;nbsp;Public IsMet As Boolean = False&lt;/p&gt;
&lt;p&gt;Hoping that I could get away with this.&amp;nbsp; Turns out, as these two values are referenced in binding via the Eval() method, these don&amp;#39;t work correctly.&amp;nbsp; So it turns out, fields dont&amp;#39; necessarily work correctly with Eval.&amp;nbsp; Didn&amp;#39;t know that until I was trying to shortcut &lt;img src="http://dotnetslackers.com/Community/emoticons/emotion-2.gif" alt="Big Smile" /&gt;&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=29327" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/bmains/archive/tags/Web/default.aspx">Web</category></item><item><title>Silverlight free controls</title><link>http://dotnetslackers.com/Community/blogs/antrad/archive/2008/10/03/silverlight-free-controls.aspx</link><pubDate>Fri, 03 Oct 2008 10:46:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:29297</guid><dc:creator>antrad</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&amp;nbsp;I am not a fun of client side tecnology but Silverlight is really interesting. &lt;a target="_blank" href="http://www.webresourcesdepot.com/free-silverlight-controls-and-tools-for-brighter-websites/" class="null"&gt;Here&lt;/a&gt; you can find some free controls.&lt;/p&gt;
&lt;p&gt;Bye&lt;/p&gt;
&lt;p&gt;Antonio&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=29297" width="1" height="1"&gt;</description></item><item><title>JQuery, the very very basics - Lesson 4</title><link>http://dotnetslackers.com/Community/blogs/xun/archive/2008/10/02/jquery-the-very-very-basics-lesson-4.aspx</link><pubDate>Thu, 02 Oct 2008 19:22:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:29289</guid><dc:creator>xxxd</dc:creator><slash:comments>4</slash:comments><description>&lt;p&gt;&lt;a href="http://dotnetslackers.com/Community/blogs/xun/easy.jpg"&gt;&lt;img border="0" width="219" src="http://dotnetslackers.com/Community/blogs/xun/easy.jpg" height="298" style="border:1px solid black;float:left;margin:5px;" alt="" /&gt;&lt;/a&gt;On again with the very basics of JQuery. Thanks again for all of the kicks, dzones, stumbled-upons. I am wearing a permanent thank-you&amp;nbsp;smile now. :)&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;a href="http://dotnetslackers.com/Community/blogs/xun/archive/2008/09/26/jquery-the-very-very-basics-lesson-3.aspx"&gt;JQuery, the very very basics - Lesson 3&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;a href="http://dotnetslackers.com/Community/blogs/xun/archive/2008/09/26/jquery-the-very-very-basics-lesson-2.aspx"&gt;JQuery, the very very basics - Lesson 2&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;a href="http://dotnetslackers.com/Community/blogs/xun/archive/2008/09/26/jquery-the-very-very-basics-lesson-1.aspx"&gt;JQuery, the very very basics - Lesson 1&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;Now that we have done with the selection and manipulation of JQuery elements, time for some actions (event handling). Actions, reactions, interactions, through which we learn, connect and play,&amp;nbsp;through which&amp;nbsp;web becomes an inseperable part of our lives. &lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;However, it&amp;nbsp;is daunting to&amp;nbsp;create a sophisticated uniform interaction model on&amp;nbsp;the array of competing&amp;nbsp;browsers. Besides, there are different DOM event models. Admit it, how many times&amp;nbsp;have you had this Yes/No&amp;nbsp;interchange between you and&amp;nbsp;your user?&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;em&gt;Yes, it works&lt;/em&gt;&lt;/div&gt;
&lt;div&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; No, it does not. It does not do anything. &lt;/em&gt;&lt;/div&gt;
&lt;div&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; What browser do you use?&lt;/em&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;Well, JQuery shields us with a unified front for cross-browser event handling model.&amp;nbsp;It also allows&amp;nbsp;an event to be tied with or&amp;nbsp;released from&amp;nbsp;multiple event listeners. For any events (&lt;span style="background-color:#ff9966;"&gt;blur&lt;/span&gt;, &lt;span style="background-color:#ff9966;"&gt;change&lt;/span&gt;, &lt;span style="background-color:#ff9966;"&gt;click&lt;/span&gt;,&amp;nbsp;&lt;span style="background-color:#ff9966;"&gt;focus&lt;/span&gt;, &lt;span style="background-color:#ff9966;"&gt;keydown&lt;/span&gt; ...), we can access their properties such as&amp;nbsp;&lt;span style="background-color:#ff9966;"&gt;keyCode&lt;/span&gt;, &lt;span style="background-color:#ff9966;"&gt;pageX&lt;/span&gt;, &lt;span style="background-color:#ff9966;"&gt;pageY&lt;/span&gt;, &lt;span style="background-color:#ff9966;"&gt;screenX&lt;/span&gt;, &lt;span style="background-color:#ff9966;"&gt;screenY&lt;/span&gt;, &lt;span style="background-color:#ff9966;"&gt;shiftKey&lt;/span&gt;, &lt;span style="background-color:#ff9966;"&gt;target&lt;/span&gt;.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;Event binding and unbinding: &lt;/strong&gt;&lt;span style="background-color:#ff9966;"&gt;bind()&lt;/span&gt; and &lt;span style="background-color:#ff9966;"&gt;unbind()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ff9966;"&gt;bind(eventType, data, listener)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;So instead of attaching a click event to an&amp;nbsp;image as the following:&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ffffff;"&gt;&lt;span style="font-size:x-small;color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-size:x-small;color:#a31515;"&gt;img&lt;/span&gt;&lt;span style="font-size:x-small;"&gt; &lt;/span&gt;&lt;span style="font-size:x-small;color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="font-size:x-small;color:#0000ff;"&gt;=&amp;quot;img1&amp;quot;&lt;/span&gt;&lt;span style="font-size:x-small;"&gt; &lt;/span&gt;&lt;span style="font-size:x-small;color:#ff0000;"&gt;src&lt;/span&gt;&lt;span style="font-size:x-small;color:#0000ff;"&gt;=&amp;quot;arrowup.jpg&amp;quot;&lt;/span&gt;&lt;span style="font-size:x-small;"&gt; &lt;/span&gt;&lt;span style="font-size:x-small;color:#ff0000;"&gt;onclick&lt;/span&gt; &lt;span style="font-size:x-small;color:#0000ff;"&gt;=&amp;quot;showMe()&amp;quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;With JQuery, we&amp;nbsp;bind&amp;nbsp;event handler(s)&amp;nbsp;using&amp;nbsp;the &lt;span style="background-color:#ff9966;"&gt;bind()&lt;/span&gt; command.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;a href="http://dotnetslackers.com/Community/blogs/xun/jquery4_code1.gif"&gt;&lt;img border="0" width="405" src="http://dotnetslackers.com/Community/blogs/xun/jquery4_code1.gif" height="64" style="border:1px solid black;margin-top:5px;margin-bottom:5px;" alt="" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;It is easy&amp;nbsp;to uniformly&amp;nbsp;handle an event&amp;nbsp;of&amp;nbsp;a matched set of elements with JQuery selectors and the &lt;span style="background-color:#ff9966;"&gt;bind()&lt;/span&gt; command.&amp;nbsp;&amp;nbsp;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;For example, modified the above code a little,&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;a href="http://dotnetslackers.com/Community/blogs/xun/jquery4_code2.gif"&gt;&lt;img border="0" width="344" src="http://dotnetslackers.com/Community/blogs/xun/jquery4_code2.gif" height="67" style="border:1px solid black;margin-top:5px;margin-bottom:5px;" alt="" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;Now we have just instructed every image on a page to respond the click event.&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;The &lt;span style="background-color:#ff9966;"&gt;bind()&lt;/span&gt; command can be used&amp;nbsp;to bind indefinite event handlers to&amp;nbsp;one&amp;nbsp;event.&amp;nbsp;Again,&amp;nbsp;consider the above example, change it a bit:&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;a href="http://dotnetslackers.com/Community/blogs/xun/jquery4_code3.gif"&gt;&lt;img border="0" width="567" src="http://dotnetslackers.com/Community/blogs/xun/jquery4_code3.gif" height="187" style="border:1px solid black;margin-top:5px;margin-bottom:5px;" alt="" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Every coin&amp;nbsp;has&amp;nbsp;two sides. We bind then we unbind, in either of the following ways:&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ff9966;"&gt;unbind(eventType, listener)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ff9966;"&gt;unbind(event)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;Directly using event names and triggering event handlers: &lt;span style="background-color:#ff9966;"&gt;eventName()&lt;/span&gt; and &lt;span style="background-color:#ff9966;"&gt;trigger()&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;The most common-place events get first-class, convenience treatment. For these everyday, everywhere events: &lt;span style="background-color:#ff9966;"&gt;click, focus, select, submit, blur&lt;/span&gt;, we can omit the &lt;span style="background-color:#ff9966;"&gt;bind()&lt;/span&gt; command and directly&amp;nbsp;set up&amp;nbsp;handlers&amp;nbsp;for them. &lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;The syntax is: &lt;span style="background-color:#ff9966;"&gt;eventName(listener)&lt;/span&gt;, such as &lt;span style="background-color:#ff9966;"&gt;click ( function () { } )&lt;/span&gt; ;&lt;/div&gt;
&lt;div&gt;or simply &lt;span style="background-color:#ff9966;"&gt;eventName(),&lt;/span&gt;&amp;nbsp;such as &lt;span style="background-color:#ff9966;"&gt;click ()&lt;/span&gt; ;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;For example,&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size:x-small;"&gt;$(&lt;/span&gt;&lt;span style="font-size:x-small;color:#a31515;"&gt;&amp;#39;img&amp;#39;&lt;/span&gt;&lt;span style="font-size:x-small;"&gt;).click(&lt;/span&gt;&lt;span style="font-size:x-small;color:#0000ff;"&gt;function&lt;/span&gt;&lt;span style="font-size:x-small;"&gt;(&lt;/span&gt;&lt;span style="font-size:x-small;color:#0000ff;"&gt;event&lt;/span&gt;&lt;span style="font-size:x-small;"&gt;) { alert(&lt;/span&gt;&lt;span style="font-size:x-small;color:#a31515;"&gt;&amp;#39;My id = &amp;#39;&lt;/span&gt;&lt;span style="font-size:x-small;"&gt; + &lt;/span&gt;&lt;span style="font-size:x-small;color:#0000ff;"&gt;this&lt;/span&gt;&lt;span style="font-size:x-small;"&gt;.id);}); &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size:x-small;color:#a31515;"&gt;&lt;span style="color:#000000;"&gt;$(&lt;/span&gt;&amp;#39;img#clickMe&amp;#39;&lt;/span&gt;&lt;span style="font-size:x-small;"&gt;).click() &lt;/span&gt;&lt;span style="font-size:x-small;color:#008000;"&gt;// this fakes a click action from the image whose id = clickMe &lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;span style="background-color:#ff9966;"&gt;trigger(eventType)&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ffffff;"&gt;Sometimes it is necessary to trigger an action instead of merely responding. For example, sometimes we want programmatically trigger the action of submitting a form. How can we do it? Go trigger.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;//...&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size:x-small;"&gt;trigger(&lt;/span&gt;&lt;span style="font-size:x-small;color:#a31515;"&gt;&amp;#39;submit&amp;#39;&lt;/span&gt;&lt;span style="font-size:x-small;"&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;We can trigger&amp;nbsp;such action through the firing of another event.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;a href="http://dotnetslackers.com/Community/blogs/xun/jquery4_code4.gif"&gt;&lt;img border="0" width="495" src="http://dotnetslackers.com/Community/blogs/xun/jquery4_code4.gif" height="118" style="border:1px solid black;margin-top:5px;margin-bottom:5px;" alt="" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;Toggling event handlers: &lt;span style="background-color:#ff9966;"&gt;toggle(handler1, handler2, handler3, ...)&lt;/span&gt;&amp;nbsp;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;With JQuery, convenience is the key. If there is a behavior that occurs habitually, there is bound to be a command that&amp;nbsp;helps you to do just that. Such is&amp;nbsp;case of toggling.&amp;nbsp;As you can see from the syntax of the &lt;span style="background-color:#ff9966;"&gt;toggle()&lt;/span&gt; command, you can toggle among a good number of handlers. &lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;Toggling is good to adjust styles of a matched set of elements. First time, I turn blue; next time, I go green; then, I change to red ... until I change back to blue. Again. And again.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;a href="http://dotnetslackers.com/Community/blogs/xun/jquery4_code5.gif"&gt;&lt;img border="0" width="431" src="http://dotnetslackers.com/Community/blogs/xun/jquery4_code5.gif" height="169" style="border:1px solid black;margin-top:5px;margin-bottom:5px;" alt="" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;Hovering over: &lt;span style="background-color:#ff9966;"&gt;hover(mouseoverhandler, mouseouthanlder)&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ff9966;"&gt;hover()&lt;/span&gt; is another example of convenience command.&amp;nbsp;We are all delighted to see hyperlinks and images change into and out of different style or images. For that, we all have been busy writing out &lt;span style="background-color:#ff9966;"&gt;mouseover()&lt;/span&gt; and &lt;span style="background-color:#ff9966;"&gt;mouseout()&lt;/span&gt; code. Now, with JQuery, we just call this command: &lt;span style="background-color:#ff9966;"&gt;hover()&lt;/span&gt;.&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;a href="http://dotnetslackers.com/Community/blogs/xun/jquery4_code6.gif"&gt;&lt;img border="0" width="337" src="http://dotnetslackers.com/Community/blogs/xun/jquery4_code6.gif" height="139" style="border:1px solid black;margin-top:5px;margin-bottom:5px;" alt="" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fdotnetslackers.com%2fCommunity%2fblogs%2fxun%2farchive%2f2008%2f10%2f02%2fjquery-the-very-very-basics-lesson-4.aspx"&gt;&lt;img border="0" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fdotnetslackers.com%2fCommunity%2fblogs%2fxun%2farchive%2f2008%2f10%2f02%2fjquery-the-very-very-basics-lesson-4.aspx" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=29289" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/xun/archive/tags/JQuery/default.aspx">JQuery</category></item><item><title>Head First Design Patterns: Command Pattern</title><link>http://dotnetslackers.com/Community/blogs/antrad/archive/2008/10/02/head-first-design-patterns-command-pattern.aspx</link><pubDate>Thu, 02 Oct 2008 12:03:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:29282</guid><dc:creator>antrad</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Again Desgin Patterns...&lt;/p&gt;
&lt;p&gt;Command Pattern:Encapsulate a request as an object, thereby letting you parametrize clients with different requests,queue,or log requests, and support undoable operations.&lt;/p&gt;
&lt;p&gt;Command Pattern in&amp;nbsp;C#:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;//Command interface&lt;/span&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.Text;

&lt;span class="kwrd"&gt;namespace&lt;/span&gt; Command
{
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;interface&lt;/span&gt; ICommand
    {
        &lt;span class="kwrd"&gt;void&lt;/span&gt; Execute();
    }
}

&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.Text;

&lt;span class="kwrd"&gt;namespace&lt;/span&gt; Command
{
    &lt;span class="rem"&gt;//Concrete Command&lt;/span&gt;
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; LightOffCommand : ICommand
    {

        &lt;span class="preproc"&gt;#region&lt;/span&gt; ICommand Members

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Execute()
        {
            &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; Exception(&lt;span class="str"&gt;&amp;quot;The method or operation is not implemented.&amp;quot;&lt;/span&gt;);
        }

        &lt;span class="preproc"&gt;#endregion&lt;/span&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.Text;

&lt;span class="kwrd"&gt;namespace&lt;/span&gt; Command
{
    &lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
    &lt;span class="rem"&gt;/// Concrete Command&lt;/span&gt;
    &lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; LightOnCommand : ICommand
    {
        Light lg;
        &lt;span class="kwrd"&gt;public&lt;/span&gt; LightOnCommand(Light my)
        {
            &lt;span class="kwrd"&gt;this&lt;/span&gt;.lg = my;
        }
        &lt;span class="preproc"&gt;#region&lt;/span&gt; ICommand Members

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Execute()
        {
            &lt;span class="kwrd"&gt;this&lt;/span&gt;.lg.On();
        }

        &lt;span class="preproc"&gt;#endregion&lt;/span&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.Text;

&lt;span class="kwrd"&gt;namespace&lt;/span&gt; Command
{
    &lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
    &lt;span class="rem"&gt;/// Null command, concrete command&lt;/span&gt;
    &lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; NoCommand : ICommand
    {
        &lt;span class="preproc"&gt;#region&lt;/span&gt; ICommand Members

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Execute()
        {
            System.Console.WriteLine(&lt;span class="str"&gt;&amp;quot;No command&amp;quot;&lt;/span&gt;);
        }

        &lt;span class="preproc"&gt;#endregion&lt;/span&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.Text;

&lt;span class="kwrd"&gt;namespace&lt;/span&gt; Command
{
    &lt;span class="rem"&gt;//Receiver&lt;/span&gt;
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Light
    {
        &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; _DescLight=&lt;span class="str"&gt;&amp;quot;Light&amp;quot;&lt;/span&gt;;

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; DescLight
        {
            get { &lt;span class="kwrd"&gt;return&lt;/span&gt; _DescLight; }
            set { _DescLight = &lt;span class="kwrd"&gt;value&lt;/span&gt;; }
        }

        &lt;span class="kwrd"&gt;public&lt;/span&gt; Light(&lt;span class="kwrd"&gt;string&lt;/span&gt; place)
        {
            &lt;span class="kwrd"&gt;this&lt;/span&gt;._DescLight = place;
        }
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; On()
        {
            System.Console.WriteLine(&lt;span class="kwrd"&gt;this&lt;/span&gt;.DescLight + &lt;span class="str"&gt;&amp;quot; is ON.&amp;quot;&lt;/span&gt;);
        }
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Off()
        {
            System.Console.WriteLine(&lt;span class="kwrd"&gt;this&lt;/span&gt;.DescLight + &lt;span class="str"&gt;&amp;quot; is OFF.&amp;quot;&lt;/span&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.Text;

&lt;span class="kwrd"&gt;namespace&lt;/span&gt; Command
{
    &lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
    &lt;span class="rem"&gt;/// Invoker&lt;/span&gt;
    &lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; RemoteControl
    {
        ICommand[] onCommands;
        ICommand[] offCommands;

        &lt;span class="kwrd"&gt;public&lt;/span&gt; RemoteControl()
        {
            &lt;span class="kwrd"&gt;this&lt;/span&gt;.onCommands = &lt;span class="kwrd"&gt;new&lt;/span&gt; ICommand[7];
            &lt;span class="kwrd"&gt;this&lt;/span&gt;.offCommands = &lt;span class="kwrd"&gt;new&lt;/span&gt; ICommand[7];
            &lt;span class="kwrd"&gt;for&lt;/span&gt;(&lt;span class="kwrd"&gt;int&lt;/span&gt; i=0;i&amp;lt;7;i++){
                &lt;span class="kwrd"&gt;this&lt;/span&gt;.offCommands&lt;img src="http://dotnetslackers.com/Community/emoticons/emotion-55.gif" alt="Idea" /&gt; = &lt;span class="kwrd"&gt;new&lt;/span&gt; NoCommand();
                &lt;span class="kwrd"&gt;this&lt;/span&gt;.offCommands&lt;img src="http://dotnetslackers.com/Community/emoticons/emotion-55.gif" alt="Idea" /&gt; = &lt;span class="kwrd"&gt;new&lt;/span&gt; NoCommand();
            }
        }

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; stCommand(&lt;span class="kwrd"&gt;int&lt;/span&gt; slot, ICommand on,ICommand off)
        {
            &lt;span class="kwrd"&gt;this&lt;/span&gt;.onCommands[slot]=on;
            &lt;span class="kwrd"&gt;this&lt;/span&gt;.offCommands[slot]=off;
        }

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; onButtonPushed(&lt;span class="kwrd"&gt;int&lt;/span&gt; slot)
        {
            &lt;span class="kwrd"&gt;this&lt;/span&gt;.onCommands[slot].Execute();
        }

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; offButtonPushed(&lt;span class="kwrd"&gt;int&lt;/span&gt; slot)
        {
            &lt;span class="kwrd"&gt;this&lt;/span&gt;.offCommands[slot].Execute();
        }
    }
}

Bye 
Antonio&lt;/pre&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=29282" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/antrad/archive/tags/Design+Patterns/default.aspx">Design Patterns</category></item><item><title>MVP award for 2009</title><link>http://dotnetslackers.com/Community/blogs/sonukapoor/archive/2008/10/01/mvp-award-for-2009.aspx</link><pubDate>Wed, 01 Oct 2008 14:25:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:29268</guid><dc:creator>sonu</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;I just received the notification from Microsoft that I have been re-awarded for the MVP 2009. Its a great feeling to get awarded from Microsoft. I truely appreciate that. &lt;/p&gt;
&lt;p&gt;Thanks MS.&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=29268" width="1" height="1"&gt;</description></item><item><title>Callback Method Errors from AJAX Web Services</title><link>http://dotnetslackers.com/Community/blogs/bmains/archive/2008/10/01/callback-method-errors-from-ajax-web-services.aspx</link><pubDate>Tue, 30 Sep 2008 20:38:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:29264</guid><dc:creator>bmains</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&amp;nbsp;As I mentioned before, AJAX supports calling web services from the client using an XmlHttpRequest object.&amp;nbsp; But sometimes, things don&amp;#39;t go as expected.&amp;nbsp; If you make the call, an error may occur in the web service, which you&amp;#39;d get an error prompt.&amp;nbsp; However, there&amp;#39;s one other aspect to this.&lt;/p&gt;
&lt;p&gt;Sometimes the web service works fine, but you get an error with the breakpoint in the executor of the web service (ASP.NET AJAX code).&amp;nbsp; There isn&amp;#39;t a callstack, which is really hard to debug.&amp;nbsp; What I&amp;#39;ve been finding out is that an error in the success or failed callbacks (which every web service supports a success or failed callback method that returns the results) will also act as if the executor failed, but that isn&amp;#39;t the case.&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=29264" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/bmains/archive/tags/AJAX/default.aspx">AJAX</category></item><item><title>Head First Design Pattern :Decorator</title><link>http://dotnetslackers.com/Community/blogs/antrad/archive/2008/09/29/head-first-desgin-pattern-decorator.aspx</link><pubDate>Mon, 29 Sep 2008 10:14:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:29213</guid><dc:creator>antrad</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&amp;nbsp;This is C# code for Decorator. For more info see into book...&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;//Base abstract class&lt;/span&gt;
&lt;span class="kwrd"&gt;using&lt;/span&gt; System;
&lt;span class="kwrd"&gt;namespace&lt;/span&gt; Decorator
{
    &lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
    &lt;span class="rem"&gt;/// Base class for Beverage. It represents the Component&lt;/span&gt;
    &lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;abstract&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Beverage
    {
        &lt;span class="kwrd"&gt;string&lt;/span&gt; _Description;

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Description
        {
            get { &lt;span class="kwrd"&gt;return&lt;/span&gt; _Description; }
            set { _Description = &lt;span class="kwrd"&gt;value&lt;/span&gt;; }
        }

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;abstract&lt;/span&gt; &lt;span class="kwrd"&gt;double&lt;/span&gt; CalculateCost();
    }
}

&lt;span class="rem"&gt;//Concrete class&lt;/span&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.Text;

&lt;span class="kwrd"&gt;namespace&lt;/span&gt; Decorator
{
    &lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
    &lt;span class="rem"&gt;/// Concrete class for Component&lt;/span&gt;
    &lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Coffee : Decorator.Beverage
    {
        
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;double&lt;/span&gt;  CalculateCost()
        {
            &lt;span class="kwrd"&gt;return&lt;/span&gt; 1;
        }
    }
}

&lt;span class="rem"&gt;//Base abstract class for decorator&lt;/span&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.Text;

&lt;span class="kwrd"&gt;namespace&lt;/span&gt; Decorator
{
    &lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
    &lt;span class="rem"&gt;/// Class for Decorator&lt;/span&gt;
    &lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;abstract&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; CondimentDecorator : Decorator.Beverage
    {
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;abstract&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Description
        {
            get;
            set;
        }
    }
}

&lt;span class="rem"&gt;//Decorator concrete class&lt;/span&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.Text;

&lt;span class="kwrd"&gt;namespace&lt;/span&gt; Decorator
{
    &lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
    &lt;span class="rem"&gt;/// Concrete decorator&lt;/span&gt;
    &lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Mocha : Decorator.CondimentDecorator
    {
        Beverage bev;

        &lt;span class="kwrd"&gt;public&lt;/span&gt; Mocha(Beverage b)
        {
            &lt;span class="kwrd"&gt;this&lt;/span&gt;.bev = b;
        }

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;double&lt;/span&gt; CalculateCost()
        {
            &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;this&lt;/span&gt;.bev.CalculateCost() +0.20;
        }

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Description
        {
            get
            {
                &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="str"&gt;&amp;quot;Mocha&amp;quot;&lt;/span&gt;;
            }
            set
            {
                &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; Exception(&lt;span class="str"&gt;&amp;quot;The method or operation is not implemented.&amp;quot;&lt;/span&gt;);
            }
        }
    }
}

Bye
Antonio&lt;/pre&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=29213" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/antrad/archive/tags/Design+Patterns/default.aspx">Design Patterns</category></item><item><title>Head First Design Patterns: Observer Pattern</title><link>http://dotnetslackers.com/Community/blogs/antrad/archive/2008/09/29/head-first-design-patterns-observer-and-decorator-pattern.aspx</link><pubDate>Mon, 29 Sep 2008 09:52:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:29212</guid><dc:creator>antrad</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I am reading&amp;nbsp;this &lt;a target="_blank" href="http://www.amazon.com/Head-First-Design-Patterns/dp/0596007124/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1222682037&amp;amp;sr=8-1" class="null"&gt;book&lt;/a&gt; and it is very useful for repeat GOF Design&amp;nbsp;Patterns.&amp;nbsp;But I found that source code is Java. But we prefer C# :P...&lt;/p&gt;
&lt;p&gt;So I will implement all main patterns in C#...&lt;/p&gt;
&lt;p&gt;I post here code about Observer:&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font size="2" color="#0000ff"&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;//Subject&lt;/span&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.Text;

&lt;span class="kwrd"&gt;namespace&lt;/span&gt; Observer
{
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;interface&lt;/span&gt; ISubject
    {
        &lt;span class="kwrd"&gt;void&lt;/span&gt; RegisterObserver(IObserver o);
        &lt;span class="kwrd"&gt;void&lt;/span&gt; RemoveObserver(IObserver o);
        &lt;span class="kwrd"&gt;void&lt;/span&gt; NotifyObservers();
    }
}

&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.Text;

&lt;span class="kwrd"&gt;namespace&lt;/span&gt; Observer
{
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;interface&lt;/span&gt; IObserver
    {
        &lt;span class="kwrd"&gt;void&lt;/span&gt; Update(&lt;span class="kwrd"&gt;double&lt;/span&gt; temp, &lt;span class="kwrd"&gt;double&lt;/span&gt; humidity, &lt;span class="kwrd"&gt;double&lt;/span&gt; preasure);
    }
}

&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.Text;

&lt;span class="kwrd"&gt;namespace&lt;/span&gt; Observer
{
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;interface&lt;/span&gt; IDisplay
    {
        &lt;span class="kwrd"&gt;void&lt;/span&gt; Dispay();
    }
}

&lt;span class="rem"&gt;//Subject Code&lt;/span&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.Text;

&lt;span class="kwrd"&gt;namespace&lt;/span&gt; Observer
{
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; WeatherData : ISubject
    {
        &lt;span class="kwrd"&gt;double&lt;/span&gt; _humidity;

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;double&lt;/span&gt; Humidity
        {
            get { &lt;span class="kwrd"&gt;return&lt;/span&gt; _humidity; }
            set { _humidity = &lt;span class="kwrd"&gt;value&lt;/span&gt;; }
        }
        &lt;span class="kwrd"&gt;double&lt;/span&gt; _preassure;

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;double&lt;/span&gt; Preassure
        {
            get { &lt;span class="kwrd"&gt;return&lt;/span&gt; _preassure; }
            set { _preassure = &lt;span class="kwrd"&gt;value&lt;/span&gt;; }
        }
        &lt;span class="kwrd"&gt;double&lt;/span&gt; _temperature;

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;double&lt;/span&gt; Temperature
        {
            get { &lt;span class="kwrd"&gt;return&lt;/span&gt; _temperature; }
            set { _temperature = &lt;span class="kwrd"&gt;value&lt;/span&gt;; }
        }

        &lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
        &lt;span class="rem"&gt;/// Observers&lt;/span&gt;
        &lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
        System.Collections.Generic.IList&amp;lt;IObserver&amp;gt; objs = &lt;span class="kwrd"&gt;new&lt;/span&gt; System.Collections.Generic.List&amp;lt;IObserver&amp;gt;();
        &lt;span class="preproc"&gt;#region&lt;/span&gt; ISubject Members

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; RegisterObserver(IObserver o)
        {
            objs.Add(o);
        }

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; RemoveObserver(IObserver o)
        {
            objs.Remove(o);
        }

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; NotifyObservers()
        {
            &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (IObserver obj &lt;span class="kwrd"&gt;in&lt;/span&gt; objs)
                obj.Update(&lt;span class="kwrd"&gt;this&lt;/span&gt;._temperature, &lt;span class="kwrd"&gt;this&lt;/span&gt;._humidity, &lt;span class="kwrd"&gt;this&lt;/span&gt;._preassure);
        }

        &lt;span class="preproc"&gt;#endregion&lt;/span&gt;
    }
}

&lt;span class="rem"&gt;//Observer code&lt;/span&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.Text;

&lt;span class="kwrd"&gt;namespace&lt;/span&gt; Observer
{
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; CurrentDispaly : IObserver,IDisplay
    {
        &lt;span class="kwrd"&gt;double&lt;/span&gt; _humidity;
        &lt;span class="kwrd"&gt;double&lt;/span&gt; _preassure;
        &lt;span class="kwrd"&gt;double&lt;/span&gt; _temperature;
        ISubject subject;

        &lt;span class="kwrd"&gt;public&lt;/span&gt; CurrentDispaly(ISubject sub)
        {
            &lt;span class="rem"&gt;//Istanzia l&amp;#39;oggetto e lo aggiunge come Observer&lt;/span&gt;
            subject = sub;
            subject.RegisterObserver(&lt;span class="kwrd"&gt;this&lt;/span&gt;);
        }
        &lt;span class="preproc"&gt;#region&lt;/span&gt; IObserver Members

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Update(&lt;span class="kwrd"&gt;double&lt;/span&gt; temp, &lt;span class="kwrd"&gt;double&lt;/span&gt; humidity, &lt;span class="kwrd"&gt;double&lt;/span&gt; preasure)
        {
            &lt;span class="kwrd"&gt;this&lt;/span&gt;._temperature = temp;
            &lt;span class="kwrd"&gt;this&lt;/span&gt;._preassure = preasure;
            &lt;span class="kwrd"&gt;this&lt;/span&gt;._humidity = humidity;
            &lt;span class="kwrd"&gt;this&lt;/span&gt;.Dispay();
        }

        &lt;span class="preproc"&gt;#endregion&lt;/span&gt;

        &lt;span class="preproc"&gt;#region&lt;/span&gt; IDisplay Members

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Dispay()
        {
            System.Console.WriteLine(&lt;span class="kwrd"&gt;this&lt;/span&gt;._humidity + &lt;span class="str"&gt;&amp;quot; &amp;quot;&lt;/span&gt; + &lt;span class="kwrd"&gt;this&lt;/span&gt;._preassure + &lt;span class="str"&gt;&amp;quot; &amp;quot;&lt;/span&gt; + &lt;span class="kwrd"&gt;this&lt;/span&gt;._temperature);
        }

        &lt;span class="preproc"&gt;#endregion&lt;/span&gt;
    }
}&lt;/pre&gt;
&lt;pre class="csharpcode"&gt;&lt;/pre&gt;
&lt;pre class="csharpcode"&gt;
Bye&lt;/pre&gt;
&lt;pre class="csharpcode"&gt;Antonio&lt;/pre&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=29212" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/antrad/archive/tags/Design+Patterns/default.aspx">Design Patterns</category></item><item><title>AJAX: Pushing down LINQ objects via Web Services</title><link>http://dotnetslackers.com/Community/blogs/bmains/archive/2008/09/26/ajax-pushing-down-linq-objects-via-web-services.aspx</link><pubDate>Fri, 26 Sep 2008 16:05:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:29179</guid><dc:creator>bmains</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;If you use web services to stream data to the client via the ASP.NET AJAX framework, you may experience challenges when you use LINQ to SQL or Entities as your data model.&amp;nbsp; This is because LINQ objects retain all of their relationships,&amp;nbsp;which the serialization capabilities have trouble serializing entity sets and such.&amp;nbsp; The workaround to this is to create an anonymous type.&lt;/p&gt;
&lt;p&gt;The anonymous type entry works well, as long as the web service method returns an object.&amp;nbsp; The anonymous type ensures that only serializable types are returned; any relationship properties can also be pushed down which makes it nice.&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=29179" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/bmains/archive/tags/Web/default.aspx">Web</category><category domain="http://dotnetslackers.com/Community/blogs/bmains/archive/tags/AJAX/default.aspx">AJAX</category></item><item><title>Could not create type '&lt;WebServiceType&gt;' at System.Web.UI.SimpleWebHandlerParser.GetType(String typeName)</title><link>http://dotnetslackers.com/Community/blogs/bmains/archive/2008/09/26/could-not-create-type-lt-webservicetype-gt-at-system-web-ui-simplewebhandlerparser-gettype-string-typename.aspx</link><pubDate>Fri, 26 Sep 2008 15:41:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:29175</guid><dc:creator>bmains</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I got this error when trying to view the WSDL, and to access the web service via AJAX.&amp;nbsp; The issue turned out to be easy; the type name in the ASMX file didn&amp;#39;t match the full name of the class. I switched folders for this object, so I created it in a different folder, without changing the @WebService directive.&amp;nbsp;&amp;nbsp; So Visual Studio doesn&amp;#39;t rename the paths whenever the folders change, and thus a manual change is required in the code-behind file and the @WebService directive.&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=29175" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/bmains/archive/tags/Web/default.aspx">Web</category></item><item><title>JQuery, the very very basics - Lesson 3</title><link>http://dotnetslackers.com/Community/blogs/xun/archive/2008/09/26/jquery-the-very-very-basics-lesson-3.aspx</link><pubDate>Fri, 26 Sep 2008 15:07:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:29171</guid><dc:creator>xxxd</dc:creator><slash:comments>6</slash:comments><description>&lt;div&gt;&lt;a href="http://dotnetslackers.com/Community/blogs/xun/manipulation.gif"&gt;&lt;/a&gt;&lt;a href="http://dotnetslackers.com/Community/blogs/xun/manipulation.gif"&gt;&lt;/a&gt;&lt;a href="http://dotnetslackers.com/Community/blogs/xun/manipulation.gif"&gt;&lt;/a&gt;&lt;a href="http://dotnetslackers.com/Community/blogs/xun/manipulation1.gif"&gt;&lt;img border="0" width="230" src="http://dotnetslackers.com/Community/blogs/xun/manipulation1.gif" height="351" style="border:0;float:left;margin-left:5px;margin-right:5px;" alt="" /&gt;&lt;/a&gt;Snail on with my learning and writing about the very very basic lessons on JQuery. Again, thanks to all of you for the kicking (ouch! yet the more the merrier), dzon-ing and reddit-ing. I am still glowing in and baffled by the attention (as little as it is. Big for me, since I am no Scott Gu) ...&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="http://dotnetslackers.com/Community/blogs/xun/archive/2008/09/26/jquery-the-very-very-basics-lesson-2.aspx" class="null"&gt;&amp;nbsp;JQuery, the very very basics - Lesson 2&lt;/a&gt;&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&amp;nbsp;&lt;a href="http://dotnetslackers.com/Community/blogs/xun/archive/2008/09/26/jquery-the-very-very-basics-lesson-1.aspx" class="null"&gt;JQuery, the very very basics - Lesson 1&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;In &amp;quot;modern&amp;quot; (DOM) web programming, web pages are made up of a hierarchy of elements. Manipulation of elements goes far beyond styling and positioning, it involves almost everything, adding / deleting content, appending and removing children elements, attaching itself to a new parent, cloning ... Everything is possible. The question is : How?&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;Content manipulation: &lt;span style="background-color:#ff9966;"&gt;html()&lt;/span&gt; and &lt;span style="background-color:#ff9966;"&gt;text()&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;Pretty much all JQuery commands go both ways: get and set. To access a property only, call the command without parameter; to modify, call the command with a parameter.&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ff9966;"&gt;html()&lt;/span&gt; returns the innerHTML property of a element; &lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ff9966;"&gt;html(content)&lt;/span&gt; set the element&amp;#39;s innerHTML to the content passed&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ff9966;"&gt;text()&lt;/span&gt; &amp;nbsp;returns the text content (stripped of any html markups) ;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ff9966;"&gt;text(content)&lt;/span&gt; changes the text content of the calling elements.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;So say for example, we have a little html code as the following:&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;a href="http://dotnetslackers.com/Community/blogs/xun/jquery_3_code1.gif"&gt;&lt;img border="0" width="177" src="http://dotnetslackers.com/Community/blogs/xun/jquery_3_code1.gif" height="132" style="border:1px solid black;margin-top:5px;margin-bottom:5px;" alt="" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ff9966;"&gt;$(&amp;#39;table#table1&amp;#39;).html();&lt;/span&gt; // returns everything inside the table (id=table1), including the html tags&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ff9966;"&gt;$(&amp;#39;table#table1&amp;#39;).text();&lt;/span&gt; // however returns only the actual content (in one big unsepearable string): test1item1&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;Form element values: &lt;span style="background-color:#ff9966;"&gt;val()&lt;/span&gt; &lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;To get or set values of form elements, we use &lt;span style="background-color:#ff9966;"&gt;val()&lt;/span&gt; command (in its two-way street fashion: &lt;span style="background-color:#ff9966;"&gt;val()&lt;/span&gt; for get and&lt;span style="background-color:#ff9966;"&gt; val(content)&lt;/span&gt; for set).&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;A couple of especially neat things about &lt;span style="background-color:#ff9966;"&gt;val()&lt;/span&gt; command with form element.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;blockquote style="margin-right:0px;"&gt;
&lt;div&gt;a) Remember how we used to painstakingly enumerate through a group of radios until we found the chosen one? &lt;/div&gt;
&lt;div&gt;&lt;a href="http://dotnetslackers.com/Community/blogs/xun/jquery_3_code2.gif"&gt;&lt;img border="0" width="409" src="http://dotnetslackers.com/Community/blogs/xun/jquery_3_code2.gif" height="73" style="border:1px solid black;margin:5px;" alt="" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;Now with JQuery (with selectors and &lt;span style="background-color:#ff9966;"&gt;val()&lt;/span&gt;), we may just say:&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ff9966;"&gt;var selected = $(&amp;#39;input[name=selectMe]:checked&amp;#39;).val();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;b) Remember that JQuery command can always multitask, besides that it can chain up more number of commands than a chain smoker do with cigarettes?&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Here is the deal with the val(values) command. It can be used to set up values for each element in selected set in one shot.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;Consider the following code:&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ff9966;"&gt;$(&amp;#39;input&amp;#39;).val([&amp;#39;red&amp;#39;,&amp;#39;blue&amp;#39;,&amp;#39;orange&amp;#39;]);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ff9966;"&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;It will check all checkboxes or radio boxes whose value matches any of the values in the array (red, blue, orange) passed to command.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div&gt;&lt;strong&gt;Appending and inserting&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;JQuery is skilled in moving things around. And it uses exactly the same English words we do (except in&amp;nbsp;a very very economic&amp;nbsp;fashion).&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ff9966;"&gt;append(something)&lt;/span&gt;: stick the &amp;quot;something&amp;quot; passed to the end of a matched set;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ff9966;"&gt;appendTo(target)&lt;/span&gt;: stick everything in the selected set to the end of the target;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ff9966;"&gt;prepend(something)&lt;/span&gt;: stick the &amp;quot;something&amp;quot; passed to the beginning of a matched set;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ff9966;"&gt;prependTo(target)&lt;/span&gt;: stick everything in the selected set to the beginning of the target;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ff9966;"&gt;before(something)&lt;/span&gt;: insert the &amp;quot;something&amp;quot; before each element of the matched set&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ff9966;"&gt;insertBefore(target)&lt;/span&gt;: insert the whole matched set before the targeted set of elements&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ff9966;"&gt;after(something) &lt;/span&gt;: insert the &amp;quot;something&amp;quot; after each element of the matched set&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ff9966;"&gt;insertAfter(target)&lt;/span&gt; : insert the whole matched set after the targeted set of elements&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;Wrapping and removing &lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Like candies that need sparkling wrapping paper, sometimes we want to wrap our element(s) in some sort of wrappers too. For this, we can use &lt;span style="background-color:#ff9966;"&gt;wrap(wrapper)&lt;/span&gt; command.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ff9966;"&gt;$(&amp;#39;p.note&amp;#39;).wrap(&amp;quot;&amp;lt;div class=&amp;#39;note&amp;#39;&amp;gt;This is our notes section&amp;lt;/div&amp;gt;&amp;quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;Flipping the coin,&amp;nbsp;we may want to remove things from a wrapper too.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ff9966;"&gt;remove():&lt;/span&gt; removes all elements in a selected set. For example:&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ff9966;"&gt;$(&amp;#39;div.note&amp;#39;).remove();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ff9966;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;Cloning with &lt;span style="background-color:#ff9966;"&gt;clone()&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;We do cloning with clone(), then move the clone to elsewhere, chaining up with commands such as &lt;span style="background-color:#ff9966;"&gt;appendTo, insertBefore, before, after&lt;/span&gt;, etc.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ff9966;"&gt;$(&amp;#39;img#cloneme&amp;#39;).clone().appendTo(&amp;#39;div#gallary&amp;#39;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Read more&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;a href="http://dotnetslackers.com/Community/blogs/xun/archive/2008/09/26/jquery-the-very-very-basics-lesson-4.aspx"&gt;JQuery, the very very basics - Lesson 4&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fdotnetslackers.com%2fCommunity%2fblogs%2fxun%2farchive%2f2008%2f09%2f26%2fjquery-the-very-very-basics-lesson-3.aspx"&gt;&lt;img border="0" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fdotnetslackers.com%2fCommunity%2fblogs%2fxun%2farchive%2f2008%2f09%2f26%2fjquery-the-very-very-basics-lesson-3.aspx" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=29171" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/xun/archive/tags/JQuery/default.aspx">JQuery</category></item><item><title>Inheritance and Associations with Entity Framework Part 1</title><link>http://dotnetslackers.com/Community/blogs/mosessaur/archive/2008/09/26/inheritance-and-associations-with-entity-framework-part-1.aspx</link><pubDate>Fri, 26 Sep 2008 11:44:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:29163</guid><dc:creator>mosessaur</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;In this multi parts series I&amp;#39;ll explore how to build inheritance with &lt;a href="http://msdn.microsoft.com/en-us/library/bb399567.aspx" target="_blank"&gt;Entity Framework&lt;/a&gt; showing 2 different approaches of inheritance in &lt;a href="http://msdn.microsoft.com/en-us/library/bb399567.aspx" target="_blank"&gt;Entity Framework&lt;/a&gt;.
Beside that I&amp;#39;ll show how to build simple association between 2
entities and show how to provide custom code to retrieve other parts of
the relation when inheritance is applied.&lt;/p&gt;
&lt;p&gt;My plan not to exceed
3 parts as the subject is not that huge, it is just the demonstration
with screen shots that will make the post large that is why I divided
it to multi part. I am not good at screen casts beside I don&amp;#39;t have a
software license to produce one.&lt;/p&gt;
&lt;p&gt;&lt;a target="_self" href="http://mosesofegypt.net/post/Inheritance-and-Associations-with-Entity-Framework-Part-1.aspx"&gt;Read more about it here&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=29163" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/mosessaur/archive/tags/Entity+Framework/default.aspx">Entity Framework</category></item><item><title>Sys.InvalidOperationException: Cannot serialize non finite numbers</title><link>http://dotnetslackers.com/Community/blogs/bmains/archive/2008/09/25/sys-invalidoperationexception-cannot-serialize-non-finite-numbers.aspx</link><pubDate>Thu, 25 Sep 2008 19:14:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:29162</guid><dc:creator>bmains</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I got the above error when passing data to a web service.&amp;nbsp; On the web service, a field is defined as int?.&amp;nbsp; But when I try to pass a null value, I get the above error because the value is showing up as NaN.&amp;nbsp; So it sees NaN and throws this exception.&amp;nbsp; As an alternative, I&amp;#39;m going to have to use a -1 instead, or convert the value to a string.&lt;/p&gt;
&lt;p&gt;I chose the conversion to a string as the option to use as I convert the values to a string to pass in serialized form, which turned out to be the best option.&amp;nbsp; It really worked well for passing data to/from client and server.&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=29162" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/bmains/archive/tags/AJAX/default.aspx">AJAX</category></item><item><title>Page.Request.ApplicationPath Not Working in IIS 6</title><link>http://dotnetslackers.com/Community/blogs/bmains/archive/2008/09/25/page-request-applicationpath-not-working-in-iis-6.aspx</link><pubDate>Thu, 25 Sep 2008 14:11:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:29151</guid><dc:creator>bmains</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;For whatever reason,&amp;nbsp;an application of mine errorred on the page.Request.ApplicationPath statement.&amp;nbsp; Apparently in IIS6, this isn&amp;#39;t working for whatever reason.&amp;nbsp; It returns null and the pathing doesn&amp;#39;t&amp;nbsp;work&amp;nbsp;correctly.&amp;nbsp; The virtual pathing approach with the tilde did work correctly in this scenario.&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=29151" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/bmains/archive/tags/Web/default.aspx">Web</category></item><item><title>Redirect to Error Page When Maximum Request Length is Exceeded [FileUpload]</title><link>http://dotnetslackers.com/Community/blogs/haissam/archive/2008/09/25/redirect-to-error-page-when-maximum-request-length-is-exceeded-fileupload.aspx</link><pubDate>Thu, 25 Sep 2008 07:01:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:29147</guid><dc:creator>haissam</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&amp;nbsp;How many times you tried to catch the maximum request length error thrown by the FileUplad control if the web.config HttpRuntime entry is not modified? &lt;br /&gt;In this blog post, Haissam Abdul Malak will create an HttpModule which check if the file is larger than 4 MB to redirect the user to a webform &amp;quot;Error.aspx&amp;quot;. &lt;br /&gt;The module will register to the BeginRequest event to execute the needed code&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Below is the implementation&lt;/p&gt;
&lt;p&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Text;&lt;br /&gt;using System.Web;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;namespace HAMModule&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class MyModule : IHttpModule&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void Init(HttpApplication app)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; app.BeginRequest += new EventHandler(app_BeginRequest);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; void app_BeginRequest(object sender, EventArgs e)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HttpContext context = ((HttpApplication)sender).Context;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (context.Request.ContentLength &amp;gt; 4096000)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IServiceProvider provider = (IServiceProvider)context;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HttpWorkerRequest wr = (HttpWorkerRequest)provider.GetService(typeof(HttpWorkerRequest));&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Check if body contains data&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (wr.HasEntityBody())&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // get the total body length&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int requestLength = wr.GetTotalEntityBodyLength();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Get the initial bytes loaded&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int initialBytes = wr.GetPreloadedEntityBody().Length;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!wr.IsEntireEntityBodyIsPreloaded())&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; byte[] buffer = new byte[512000];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Set the received bytes to initial bytes before start reading&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int receivedBytes = initialBytes;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (requestLength - receivedBytes &amp;gt;= initialBytes)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Read another set of bytes&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; initialBytes = wr.ReadEntityBody(buffer, buffer.Length);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Update the received bytes&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; receivedBytes += initialBytes;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; initialBytes = wr.ReadEntityBody(buffer, requestLength - receivedBytes);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;// Redirect the user to an error page. &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; context.Response.Redirect(&amp;quot;Error.aspx&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void Dispose()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;Now all you need to do is to add the module in the web.config file by adding the below entry under system.Web &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;lt;httpModules&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add type=&amp;quot;HAMModule.MyModule&amp;quot; name=&amp;quot;MyModule&amp;quot;/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;/httpModules&amp;gt;&lt;/p&gt;
&lt;p&gt;Hope this helps,&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=29147" width="1" height="1"&gt;</description></item><item><title>Username Availability Validator almost ready, the early demo</title><link>http://dotnetslackers.com/Community/blogs/mosessaur/archive/2008/09/22/username-availability-validator-almost-ready-the-early-demo.aspx</link><pubDate>Mon, 22 Sep 2008 16:52:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:29095</guid><dc:creator>mosessaur</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Few weeks ago Dave started the &lt;a href="http://encosia.com/2008/09/09/contribute-to-open-source-get-a-shot-at-a-free-book/" target="_blank"&gt;Advanced ASP.NET AJAX Server Controls book giveaway contest&lt;/a&gt;. And yesterday he &lt;a href="http://encosia.com/2008/09/18/username-availability-validator-is-nearing-availability/" target="_blank"&gt;announced&lt;/a&gt; that the control is almost completed, but the contest door is still open. So I thought to &lt;a href="http://www.codeplex.com/UsernameAvailability" target="_blank"&gt;grape the bits&lt;/a&gt; and start testing it and build a simple sample. [&lt;a target="_blank" href="http://mosesofegypt.net/samples00/usernameavailability/CreateUser.aspx"&gt;View Demo&lt;/a&gt;]&lt;/p&gt;
&lt;p&gt;The
sample that I am going to demonstrate here will use ASP.NET Create User
Wizard control with UserName Availability Validator. In this sample
I&amp;#39;ll show the important properties of this control as well as the
current issues exist.&lt;/p&gt;
&lt;p&gt;&lt;a target="_self" href="http://mosesofegypt.net/post/2008/09/19/Username-Availability-Validator-almost-ready-the-early-demo.aspx"&gt;Read more on this demo&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=29095" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/mosessaur/archive/tags/ASP.NET+2.0/default.aspx">ASP.NET 2.0</category><category domain="http://dotnetslackers.com/Community/blogs/mosessaur/archive/tags/AJAX/default.aspx">AJAX</category><category domain="http://dotnetslackers.com/Community/blogs/mosessaur/archive/tags/ASP.NET+AJAX/default.aspx">ASP.NET AJAX</category><category domain="http://dotnetslackers.com/Community/blogs/mosessaur/archive/tags/Samples/default.aspx">Samples</category><category domain="http://dotnetslackers.com/Community/blogs/mosessaur/archive/tags/Custom+Controls/default.aspx">Custom Controls</category><category domain="http://dotnetslackers.com/Community/blogs/mosessaur/archive/tags/JavaScript/default.aspx">JavaScript</category></item><item><title>jBlogMvc Series Started! Keep tuned with Amr Elsehemy</title><link>http://dotnetslackers.com/Community/blogs/mosessaur/archive/2008/09/22/jblogmvc-series-started-keep-tuned-with-amr-elsehemy.aspx</link><pubDate>Mon, 22 Sep 2008 16:51:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:29094</guid><dc:creator>mosessaur</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;&lt;a title="XFN relationship: friend" href="http://amrelsehemy.net/" rel="friend"&gt;Amr Elsehemey&lt;/a&gt; started to blog about ASP.NET MVC. He picked up a good subject to blog about; &lt;a href="http://amrelsehemy.net/post/2008/09/21/Introducing-jBlogMvc.aspx" target="_blank" rel="tag"&gt;Building ASP.NET MVC Blog Engine using ASP.NET MVC&lt;/a&gt; and &lt;a href="http://jquery.com/" target="_blank"&gt;jQuery&lt;/a&gt;, he named it &amp;quot;&lt;a href="http://amrelsehemy.net/post/2008/09/21/Introducing-jBlogMvc.aspx" target="_blank" rel="tag"&gt;jBlogMvc&lt;/a&gt;&amp;quot;
Yesterday he posted his first post in the series, and myself I am
waiting for the rest of the series as for it is going to be very
interesting, because I have couple of ideas in mind.&lt;/p&gt;
&lt;p&gt;He is going
to explore the code and posting samples as he developing this simple
blog engine. We have been talking about this subject for few days now,
and really he has some cool ideas to present. Keep tuned with &lt;a href="http://amrelsehemy.net/" target="_blank"&gt;Amr&lt;/a&gt;, I am sure he is going to amuse us with some kicking posts just as he did in his &lt;a href="http://amrelsehemy.net/?tag=/design+time+support" target="_blank" rel="tag"&gt;Design Time Support post series&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=29094" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/mosessaur/archive/tags/ASP.NET+MVC/default.aspx">ASP.NET MVC</category></item><item><title>Digsby - Bringing Many Content Sources to One Place</title><link>http://dotnetslackers.com/Community/blogs/bmains/archive/2008/09/20/digsby-bringing-many-content-sources-to-one-place.aspx</link><pubDate>Sat, 20 Sep 2008 03:17:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:29063</guid><dc:creator>bmains</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;If you haven&amp;#39;t had a chance to check it out, check out the Digsby tool:&amp;nbsp; &lt;a href="http://www.digsby.com/?utm_campaign=new&amp;amp;utm_content=new&amp;amp;utm_medium=new&amp;amp;utm_source=new"&gt;http://www.digsby.com/?utm_campaign=new&amp;amp;utm_content=new&amp;amp;utm_medium=new&amp;amp;utm_source=new&lt;/a&gt;.&amp;nbsp; It brings your IM, social networking, and email all into one little application.&amp;nbsp; It works really well and I like it a lot.&amp;nbsp; It&amp;#39;s a great IM tool and has a lot of great features.&amp;nbsp; If you&amp;#39;re into facebook, you can set your facebook status right in the tool, and check all mini-feed.&lt;/p&gt;
&lt;p&gt;In addition, you can check your gmail, msn, yahoo chat/email right in the tool as well.&amp;nbsp; Really cool.&amp;nbsp; But, if you read the EULA, it&amp;#39;s not for work purposes (but can be installed on a work machine for personal purposes).&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=29063" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/bmains/archive/tags/Third+Party+Tools/default.aspx">Third Party Tools</category></item><item><title>Localization\Globalization Considerations and Tips</title><link>http://dotnetslackers.com/Community/blogs/mosessaur/archive/2008/09/19/localization-globalization-considerations-and-tips.aspx</link><pubDate>Fri, 19 Sep 2008 00:08:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:29049</guid><dc:creator>mosessaur</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I&amp;#39;ve been worked with localization and globalization for a while now.
During that period I faced issues and learned many things about the
subject. Here I am going to share some of my own ideas and tips to
avoid falling in certain issues. It worth to mention that I am talking
from GUI point of view and not Application Data point of view.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://mosesofegypt.net/post/2008/09/18/Localization5cGlobalization-Considerations-and-Tips.aspx"&gt;Read more about it&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=29049" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/mosessaur/archive/tags/ASP.NET+2.0/default.aspx">ASP.NET 2.0</category><category domain="http://dotnetslackers.com/Community/blogs/mosessaur/archive/tags/localization/default.aspx">localization</category><category domain="http://dotnetslackers.com/Community/blogs/mosessaur/archive/tags/Tips/default.aspx">Tips</category></item><item><title>Unrecognized Configuration Section "name"</title><link>http://dotnetslackers.com/Community/blogs/bmains/archive/2008/09/18/unrecognized-configuration-section-quot-name-quot.aspx</link><pubDate>Thu, 18 Sep 2008 19:18:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:29040</guid><dc:creator>bmains</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;If you get the error above, there could be a couple of reasons:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The XML setup in the configuration file is in error; maybe there isn&amp;#39;t a closing tag or something syntacticly is missing.&lt;/li&gt;
&lt;li&gt;If creating a custom configuration section, this could be that the entry in the &amp;lt;configSections&amp;gt; collection is missing; every custom configuration section must be registered in &amp;lt;configSections&amp;gt;.&lt;/li&gt;
&lt;li&gt;The type provided is incorrect; maybe the type is in a different assembly than is stated, or the type name has a typo.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Some things to try out if you get this.&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=29040" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/bmains/archive/tags/Web/default.aspx">Web</category></item><item><title>WPF Path Markup Syntax</title><link>http://dotnetslackers.com/Community/blogs/bmains/archive/2008/09/18/wpf-path-markup-syntax.aspx</link><pubDate>Wed, 17 Sep 2008 23:48:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:29029</guid><dc:creator>bmains</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;You may have seen in my previous post a series of coordinates with a combination of letters to form one really long string in the PathGeometry.&amp;nbsp; This string is actually a syntax that evaluates to various Segment objects (ArcSegment, LineSegment, etc).&amp;nbsp;&amp;nbsp;This is called path markup language, or has also been called path mini language.&lt;/p&gt;
&lt;p&gt;So what do M, C, Z, etc. mean in the markup language?&amp;nbsp; You can find a guide to these options here:&amp;nbsp; &lt;a href="http://msdn.microsoft.com/en-us/library/ms752293.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms752293.aspx&lt;/a&gt;&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=29029" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/bmains/archive/tags/WPF_2F00_XAML/default.aspx">WPF/XAML</category></item><item><title>JQuery, the very very basics - Lesson 2</title><link>http://dotnetslackers.com/Community/blogs/xun/archive/2008/09/17/jquery-the-very-very-basics-lesson-2.aspx</link><pubDate>Wed, 17 Sep 2008 18:24:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:29027</guid><dc:creator>xxxd</dc:creator><slash:comments>3</slash:comments><description>&lt;p&gt;Continue on with the series of lessons I learned about some of the very basics of JQuery. Thanks to all of you who has generously kicked, dzoned, redditted my first of N posts on this topic:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://dotnetslackers.com/Community/blogs/xun/archive/2008/09/13/jquery-the-very-very-basics-lesson-1.aspx" class="null"&gt;JQuery, the very very basics - Lesson 1&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So it is nice to be able to use a combination of JQuery selectors to grab an array of&amp;nbsp;elements, however, it would be better&amp;nbsp;if we know&amp;nbsp;how to&amp;nbsp;inspect them&amp;nbsp;one by one&amp;nbsp;and operate on them.&lt;/p&gt;
&lt;div&gt;&amp;nbsp;&lt;strong&gt;size() and each(iterator) &lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;To&amp;nbsp;determine the size&amp;nbsp;of the set&amp;nbsp;we just selected, we use the &lt;span style="background-color:#ff9966;"&gt;size()&lt;/span&gt; command. &lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;For example, to list all the ids&amp;nbsp;of the&amp;nbsp;&amp;lt;p&amp;gt; elements&amp;nbsp;we just selected, we can use a &lt;span style="background-color:#ff9966;"&gt;for ..&lt;/span&gt;. loop&amp;nbsp;and the &lt;span style="background-color:#ff9966;"&gt;size()&lt;/span&gt; command:&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;a href="http://dotnetslackers.com/Community/blogs/xun/jquery_code1.gif"&gt;&lt;img border="0" width="329" src="http://dotnetslackers.com/Community/blogs/xun/jquery_code1.gif" height="37" style="border:1px solid black;margin-top:10px;margin-bottom:10px;" alt="" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;To cut the chase even more, we can use the &lt;span style="background-color:#ff9966;"&gt;each()&lt;/span&gt; command, which takes a&amp;nbsp;literal function&amp;nbsp;as parameter to&amp;nbsp;deal with&amp;nbsp;each&amp;nbsp;element in the set. The element can be accessed using the &lt;span style="background-color:#ff9966;"&gt;this&lt;/span&gt; keyword. So rewrite the above code:&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;a href="http://dotnetslackers.com/Community/blogs/xun/jquery_code2.gif"&gt;&lt;img border="0" width="327" src="http://dotnetslackers.com/Community/blogs/xun/jquery_code2.gif" height="50" style="border:1px solid black;margin-top:10px;margin-bottom:10px;" alt="" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;Get and set attributes&amp;#39; values&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;span style="background-color:#ff9966;"&gt;attr(name) and attr(name, value)&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;span style="background-color:#ff9966;"&gt;&lt;/span&gt;&lt;/strong&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ffffff;"&gt;Well, you probably have guessed it. The first &lt;span style="background-color:#ff9966;"&gt;attr()&lt;/span&gt; command lets you access the value of an attibute designated by the name, the second &lt;span style="background-color:#ff9966;"&gt;attr()&lt;/span&gt; command assign the named attribute with the value specified in the second parameter.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;For example, I have a dummy &amp;lt;p&amp;gt; element as such:&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size:x-small;color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-size:x-small;color:#a31515;"&gt;p&lt;/span&gt;&lt;span style="font-size:x-small;"&gt; &lt;/span&gt;&lt;span style="font-size:x-small;color:#ff0000;"&gt;id&lt;/span&gt;&lt;span style="font-size:x-small;color:#0000ff;"&gt;=&amp;quot;p1&amp;quot;&lt;/span&gt;&lt;span style="font-size:x-small;"&gt; &lt;/span&gt;&lt;span style="font-size:x-small;color:#ff0000;"&gt;title&lt;/span&gt;&lt;span style="font-size:x-small;color:#0000ff;"&gt;=&amp;quot;test&amp;quot;&amp;gt;&lt;/span&gt;&lt;span style="font-size:x-small;"&gt;Test, test&lt;/span&gt;&lt;span style="font-size:x-small;color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-size:x-small;color:#a31515;"&gt;p&lt;/span&gt;&lt;span style="font-size:x-small;color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="background-color:#ff9966;"&gt;$(&amp;#39;p#p1&amp;#39;).attr(&amp;#39;title&amp;#39;)&lt;/span&gt;&amp;nbsp;returns the value of the attribute title (&amp;#39;test&amp;#39;),&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="background-color:#ff9966;"&gt;$(&amp;#39;p#p1&amp;#39;).attr(&amp;#39;title&amp;#39;, &amp;#39;more than a test&amp;#39;)&lt;/span&gt;&amp;nbsp;change the title&amp;#39;s value to &amp;quot;more than a test&amp;quot;.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Css Style: Dress up, dress down &lt;a href="http://dotnetslackers.com/Community/blogs/xun/style.gif"&gt;&lt;img border="0" width="224" src="http://dotnetslackers.com/Community/blogs/xun/style.gif" height="386" style="float:right;margin:10px;border:black 1px solid;" alt="" /&gt;&lt;/a&gt;&lt;a href="http://dotnetslackers.com/Community/blogs/xun/hair_style1.jpg"&gt;&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ff9966;"&gt;&amp;nbsp;&lt;strong&gt;addClass(names), removeClass(names) and toggleClass(name)&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ff9966;"&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ff9966;"&gt;addClass&lt;/span&gt;&lt;span style="background-color:#ffffff;"&gt; dresses up all of the elements in a selected set with one css class or multiple css classes; conversely, removeClass strips off the elements one or more css classes specified by the name paramter, as in:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ff9966;"&gt;$(&amp;#39;p.notes&amp;#39;).addClass(&amp;#39;notes&amp;#39;, &amp;#39;highlight&amp;#39;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ff9966;"&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ffffff;"&gt;&lt;/span&gt;
&lt;div&gt;&lt;span style="background-color:#ff9966;"&gt;$(&amp;#39;p.notes&amp;#39;).removeClass(&amp;#39;highlight&amp;#39;);&lt;/span&gt;&lt;/div&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div&gt;Do not we all love to toggle, add and remove, switch and off? Well, toggleClass command does just this, add the specified css class to element(s) if it is not there, remove it if it is.&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span style="background-color:#ff9966;"&gt;$(&amp;#39;p.notes&amp;#39;).toggleClass(&amp;#39;highlight&amp;#39;);&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;span style="background-color:#ff9966;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="background-color:#ff9966;"&gt;css(name, value)&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;What if we want to change css style of elements without using any css class names? There, css command affords us to do so. &lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="background-color:#ff9966;"&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-size:x-small;"&gt;$(&amp;#39;p.note&amp;#39;&lt;/span&gt;&lt;span style="font-size:x-small;"&gt;).css(&lt;/span&gt;&lt;span style="font-size:x-small;"&gt;&amp;#39;background-color&amp;#39;&lt;/span&gt;&lt;span style="font-size:x-small;"&gt;, &lt;/span&gt;&lt;span style="font-size:x-small;"&gt;&amp;#39;yellow&amp;#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="color:#000000;background-color:#ff9966;"&gt;);&lt;/span&gt; changes the background color of all &amp;lt;p&amp;gt; elements whose class name is note. &lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="font-size:small;"&gt;There are more css related commands such as &lt;span style="background-color:#ff9966;"&gt;width(value), height(value)&lt;/span&gt; to allow us to directly change elements&amp;#39; apparence, for example:&lt;/span&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;span style="background-color:#ff9966;"&gt;&lt;span style="font-size:x-small;"&gt;$(&lt;/span&gt;&lt;span style="font-size:x-small;color:#a31515;"&gt;&amp;#39;p.note&amp;#39;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="background-color:#ff9966;"&gt;).width(500).height(100);&lt;/span&gt; changes the&amp;nbsp;width&amp;nbsp;then height&amp;nbsp;of all &amp;lt;p&amp;gt; elements whose class name is note.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;Read more&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;a href="http://dotnetslackers.com/Community/blogs/xun/archive/2008/09/26/jquery-the-very-very-basics-lesson-3.aspx"&gt;JQuery, the very very basics - Lesson 3&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;a href="http://dotnetslackers.com/Community/blogs/xun/archive/2008/09/26/jquery-the-very-very-basics-lesson-4.aspx"&gt;JQuery, the very very basics - Lesson 4&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fdotnetslackers.com%2fCommunity%2fblogs%2fxun%2farchive%2f2008%2f09%2f17%2fjquery-the-very-very-basics-lesson-2.aspx"&gt;&lt;img border="0" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fdotnetslackers.com%2fCommunity%2fblogs%2fxun%2farchive%2f2008%2f09%2f17%2fjquery-the-very-very-basics-lesson-2.aspx" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=29027" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/xun/archive/tags/JQuery/default.aspx">JQuery</category></item></channel></rss>