<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.dotnetzone.gr:443/cs/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="el"><title type="html">.NET Hints</title><subtitle type="html" /><id>https://www.dotnetzone.gr:443/cs/blogs/kbadas/atom.aspx</id><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/kbadas/default.aspx" /><link rel="self" type="application/atom+xml" href="https://www.dotnetzone.gr:443/cs/blogs/kbadas/atom.aspx" /><generator uri="http://communityserver.org" version="2.1.20423.1">Community Server</generator><updated>2014-03-20T22:14:56Z</updated><entry><title>Enumerations, bitwise operators and flags</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2017/07/19/enumerations-bitwise-operators-and-flags.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2017/07/19/enumerations-bitwise-operators-and-flags.aspx</id><published>2017-07-19T16:51:16Z</published><updated>2017-07-19T16:51:16Z</updated><content type="html">&lt;font style="font-size:12pt;"&gt;&lt;/font&gt;&lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;Enumerations are a simple and efficient way to deal with a set of values. The most common way to use an enumeration is to use its values separately. There are however times when we want to use a combination of the enumeration's values. In that case we can use bitwise operators. To make things easier, we can also use flags. &lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 10pt;line-height:normal;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-outline-level:2;"&gt;&lt;b&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;Enumeration&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;Let's start using a simple enumeration example. Enumerations are structs consisting of a set of values the type can be assigned. So let's use an enumeration of payment methods. Here's the enumeration.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#0000ff"&gt;public enum&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethods&lt;/font&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; None = 0,&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; Cash = 1,&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; Cheque = 2,&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; CreditCard = 3&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;We can now use this enumeration to connect PaymentMethod values with their integer representation. For example &lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;creditCard = 3;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethods &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;creditCardMethod = (&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethods&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;)creditCard;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;or&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;creditCard = (&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;)&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethods&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;.CreditCard;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;It is quite easy to switch between the enumeration and its numeric equivalent and use it anyway we want. Either in order to set the value to a select item or to store it in a database table. This method seems to be ok for let's say an e-shop where the customer chooses a product and selects a method to pay. However, that wouldn't work in case of a crm system where the customers wished to have more than one way of payment. For example, some client might wish to choose as payment method Cheque or CreditCard.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 10pt;line-height:normal;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-outline-level:2;"&gt;&lt;b style="mso-bidi-font-weight:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-fareast-language:el;mso-no-proof:yes;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;/font&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;/font&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 10pt;line-height:normal;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-outline-level:2;"&gt;&lt;b&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;Bitwise Operators&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;In order to choose multiple values rather than a single one, we can use bitwise operators. In other words we can use an enumeration's binary value instead of the integer representation. This is called Flag Enumeration, even though using the Flag keyword is not mandatory.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;For example, in the PaymentMethods enumeration each value's binary representation would be&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;Name&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Integer&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Binary&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;None&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 000&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;Cash&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 001&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;Cheque&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 010&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;CreditCard&amp;#160;&amp;#160;&amp;#160; 3&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 011&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;Now, we could change the enumeration's values so they were all represented by powers of 2.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#0000ff"&gt;public enum&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethodsAdvanced&lt;/font&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; None = 0,&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; Cash = 1,&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; Cheque&amp;#160; = 2,&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; CreditCard = 4&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;In that case the previous table would look like&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;Name&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Integer&amp;#160;&amp;#160;&amp;#160;&amp;#160; Binary&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;None&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 000&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;Cash&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 001&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;Cheque&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 010&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;CreditCard&amp;#160;&amp;#160;&amp;#160;&amp;#160; 4&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 100&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;It's pretty clear that all we have said so far concerning PaymentMethods applies to PaymentMethodsAdvanced as well. Now let's see what choosing a combination of these values would look like.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;cashOrCheque = &lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethodsAdvanced&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;.Cash | &lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethodsAdvanced&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;.Cheque;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;cashOrCreditCard = &lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethodsAdvanced&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;.Cash | &lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethodsAdvanced&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;.CreditCard;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;Name&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Integer&amp;#160;&amp;#160;&amp;#160;&amp;#160; Binary&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;None&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 0&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 000&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;Cash&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 001&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;Cheque&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 010&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;CreditCard&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 4&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 100&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;cashOrCheque&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 3&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 011&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;cashOrCreditCard&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 5&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 101&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;This way we can represent multiple options by using an option that is created on the fly.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;In order to check if a variable contains an option we can use the &amp;amp; operator.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;paymentMethodAdvancedIntValue = 3;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;paymentMethodAdvancedValue = (&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethodsAdvanced&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;)paymentMethodAdvancedIntValue;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#0000ff"&gt;bool&lt;/font&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;isCash = (paymentMethodAdvancedValue &amp;amp; &lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethodsAdvanced&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;.Cash) == &lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethodsAdvanced&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;.Cash; &lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#008000"&gt;//true&lt;/font&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;cashOrCheque = &lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethodsAdvanced&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;.Cash | &lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethodsAdvanced&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;.Cheque;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#0000ff"&gt;bool&lt;/font&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;isCashOrCheque = (paymentMethodAdvancedValue &amp;amp; cashOrCheque) == cashOrCheque;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#008000"&gt;//true&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;Instead of using logical operators we can use the HasFlag method. HasFlag works in a similar way but it makes things easier to read and use. &lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#0000ff"&gt;int &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;paymentMethodAdvancedIntValue = 3;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;paymentMethodAdvancedValue = (&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethodsAdvanced&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;)paymentMethodAdvancedIntValue;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#0000ff"&gt;bool&lt;/font&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;isCash = paymentMethodAdvancedValue.HasFlag(&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethodsAdvanced&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;.Cash); &lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#008000"&gt;//true&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;cashOrCheque = &lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;PaymentMethodsAdvanced&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;.Cash | &lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethodsAdvanced&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;.Cheque;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#0000ff"&gt;bool&lt;/font&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;isCashOrCheque = paymentMethodAdvancedValue.HasFlag(cashOrCheque);&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#008000"&gt;//true&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;cashOrCreditCard = &lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethodsAdvanced&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;.Cash | &lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethodsAdvanced&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;.CreditCard;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#0000ff"&gt;bool&lt;/font&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;isCashOrCreditCard = paymentMethodAdvancedValue.HasFlag(cashOrCreditCard);&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;font color="#008000"&gt;//false&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;One thing to keep in mind is how the 0 value works; the one called None in our example. Suppose we use HasFlag or the &amp;amp; operator (which actually end up in the same thing). Here's how things might get tricky.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;cashOrCheque = &lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethodsAdvanced&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;.Cash | &lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethodsAdvanced&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;.Cheque;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#0000ff"&gt;bool&lt;/font&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;isNone = cashOrCheque.HasFlag(&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethodsAdvanced&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;.None);&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;isNone is true. Actually everything you compare to None returns true. Why would you say this is? It all ends up to this.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#0000ff"&gt;bool&lt;/font&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;isNone = (cashOrCheque &amp;amp; &lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethodsAdvanced&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;.None) == &lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethodsAdvanced&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;.None;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;3 &amp;amp; 0 == 0&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;This expression is always true regardless of the first value. So this is not the right way to tell if the value is None. &lt;/font&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;To do so, we should do a direct comparison.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#0000ff"&gt;bool&lt;/font&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;isNone = cashOrCheque == &lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethodsAdvanced&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;.None;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;One last thing: remember how we created our enumeration?&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#0000ff"&gt;public enum&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethodsAdvanced&lt;/font&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; None = 0,&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; Cash = 1,&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; Cheque= 2,&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; CreditCard = 4&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;The exact same thing can be done using bit shifting which can make things less complicated in case of long enumerations.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#0000ff"&gt;public enum&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethodsAdvanced&lt;/font&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; None = 0,&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; Cash = 1 &amp;lt;&amp;lt; 0,&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; Cheque= 1 &amp;lt;&amp;lt; 1,&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; CreditCard = 1 &amp;lt;&amp;lt; 2&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 10pt;line-height:normal;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-outline-level:2;"&gt;&lt;b&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;Using Flags&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;It is a strange thing that many people tend to think that you need to use the Flags attribute in order to use bitwise operators. That is not true. We can use Flags however, to make things easier for us developers to debug or to display selected values.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;To use Flags the only thing we need to do is to place the Flag keyword before the enumeration.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;[&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;" color="#4bacc6"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;Flags&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;]&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#0000ff"&gt;public enum&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethodsFlags&lt;/font&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; None = 0,&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; Cash = 1,&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; Cheque = 2,&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; CreditCard = 4&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;So, if we had an enumeration with Flags as mentioned and another one without Flags, like this &lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#0000ff"&gt;public enum&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethods&lt;/font&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; None = 0,&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; Cash = 1,&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; Cheque = 2,&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; CreditCard = 4&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;using the debugger we would get the following results&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;cashOrCheque = &lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethods&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;.Cash | &lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethods&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;.Cheque; &lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#008000"&gt;//Debugger says 3&lt;/font&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;cashOrChequeFlags = &lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethodsFlags&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;.Cash | &lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethodsFlags&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;.Cheque; &lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#008000"&gt;//Debugger says Cash | Cheque&lt;/font&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;Similarly&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;cashOrCheque = (&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethods&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;.Cash | &lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethods&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;.Cheque).ToString();&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;font color="#008000"&gt;//Equals to &amp;quot;3&amp;quot;&lt;/font&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;cashOrChequeFlags = (&lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethodsFlags&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;.Cash | &lt;font style="font-size:10.5pt;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#ccb400"&gt;PaymentMethodsFlags&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;.Cheque).ToString(); &lt;/span&gt;&lt;/font&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#008000"&gt;//Equals to &amp;quot;Cash, Cheque&amp;quot;&lt;/font&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 10pt;line-height:normal;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-outline-level:2;"&gt;&lt;b&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;Summary&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;We can use bitwise operators to combine multiple values from one single enumeration. The enumeration needs to contain powers of two as values. To compare such values we can use logical operators or the HasFlag method. In addition, we can use the Flags attribute to make debugging or parsing enumeration values easier.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;Reference – &lt;a href="http://dotnethints.com/blogs/enumerations-bitwise-operators-and-flags"&gt;DotNetHints&lt;/a&gt;&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=78140" width="1" height="1"&gt;</content><author><name>k badas</name><uri>https://www.dotnetzone.gr:443/cs/members/k+badas.aspx</uri></author></entry><entry><title>Getting random values</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2017/06/25/getting-random-values.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2017/06/25/getting-random-values.aspx</id><published>2017-06-26T01:34:50Z</published><updated>2017-06-26T01:34:50Z</updated><content type="html">&lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;You do not have to be working on some gambling project in order to request for a random number. Things like that happen all the time. Either you may need to pick a random product to show out of a list or you may want to present some results randomly ordered. Anyway, getting a random number is something you will need to do from time to time. To get a random number we may use the Random or the RNGCryptoServiceProvider class. We are going to find out what is the difference between them and talk about what makes a random number.&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/div&gt;  &lt;h2 style="margin:11px 0px;text-transform:none;text-indent:0px;letter-spacing:normal;padding-bottom:0px;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;Randomness&lt;/font&gt;&lt;/h2&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;Let's start with the basics. What makes a random number? A number is considered random when there is no method to predict what that will be before it is presented. You may think of this as something obvious, however it is not.&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;Let's say someone asked you to pick a number between 1 and 10 and you picked 5. Why would that be? Maybe that is because you like number 5, or you like the fact it is located in the middle of the 1 to 10 range, or because of a subconscious thought of the 5 euro note you were holding a while ago, or well, pretty much anything. Not being able to predict the number you are going to pick, makes it quite a random guess. &lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;However, no matter why you have chosen number five, there will always be some reason why you picked that number. A person may be able to locate that reason and from that moment on be able to predict what number you are going to pick at given circumstances If the value of the cause and the way it affects the result number is easy to guess, this makes your number pseudo-random.&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;The value of the reason that causes the number to be selected is called seed. &lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;So a random number will never be 100% pure random. However, the less easy to compute the seed, the more random it will be. In case you've been wondering what all this fuss is about, that's because Random class is far more pseudo-random than RNGCryptoServiceProvider. And we are now going to see the reason why.&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;img alt="random dice" src="http://dotnethints.com/admin/gallery/dice.png" width="102" height="102" /&gt;&lt;/div&gt;  &lt;h2 style="margin:11px 0px;text-transform:none;text-indent:0px;letter-spacing:normal;padding-bottom:0px;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;Using the Random class&lt;/font&gt;&lt;/h2&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;To use the Random we first have to create an object instance like this&lt;/font&gt;&lt;/div&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;p&gt;&lt;font color="#0080c0"&gt;Random&lt;/font&gt; rnd = &lt;font color="#0000ff"&gt;new&lt;/font&gt; &lt;font color="#0080c0"&gt;Random&lt;/font&gt;();&lt;/p&gt; &lt;font style="font-size:12pt;"&gt;&lt;/font&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;After that, there are a few handful methods we can use to get our random values. For example&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;span&gt;&lt;font style="font-size:10.5pt;" color="#008000"&gt;//Get a random integer greater than or equal to 0&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;span&gt;&lt;font style="font-size:10.5pt;" color="#0000ff"&gt;int&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;random = rnd.Next();&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;span&gt;&lt;font style="font-size:10.5pt;" color="#008000"&gt;//Get a random integer greater than or equal to 0 and less than 100&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span&gt;&lt;font style="font-size:10.5pt;" color="#0000ff"&gt;int&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;random = rnd.Next(100);&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;span&gt;&lt;font style="font-size:10.5pt;" color="#008000"&gt;//Get a random integer greater than or equal to -10 and less than 100&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span&gt;&lt;font style="font-size:10.5pt;" color="#0000ff"&gt;int&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;random = rnd.Next(-10, 100);&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;span&gt;&lt;font style="font-size:10.5pt;" color="#008000"&gt;//Get a random floating point number greater than or equal to 0 and less than 1&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;span&gt;&lt;font style="font-size:10.5pt;" color="#0000ff"&gt;double&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;random = rnd.NextDouble();&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;span&gt;&lt;font style="font-size:10.5pt;" color="#008000"&gt;//Get a random 32-bit integer than or equal to 0&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span&gt;&lt;font style="font-size:10.5pt;" color="#0000ff"&gt;double&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;random = rnd.NextDouble() *&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span&gt;&lt;font color="#0080c0"&gt;Int32&lt;/font&gt;&lt;/span&gt;.MaxValue;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;By using the Next method (or a similar one) we get a new random value generated by our Random object.&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;Now, there are two ways to instantiate a Random object. One is the default one we used earlier&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;span&gt;&lt;font style="font-size:10.5pt;"&gt;Random&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt; rnd = &lt;span&gt;new&lt;/span&gt;&amp;#160;&lt;span&gt;Random&lt;/span&gt; ();&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;The other one is using a seed of our own by setting an integer argument to the constructor like that.&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font color="#0080c0"&gt;Random&lt;/font&gt;&lt;font style="font-size:10.5pt;"&gt; rnd = &lt;font color="#0000ff"&gt;new&lt;/font&gt; &lt;font color="#0080c0"&gt;Random&lt;/font&gt;(5);&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;What should be taken into account here is that Random objects initialized using the same seed will produce the same results.&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#0080c0"&gt;Random &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;rnd = &lt;font color="#0000ff"&gt;new&lt;/font&gt; &lt;font color="#0080c0"&gt;Random&lt;/font&gt;(5);&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#0080c0"&gt;Random &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;rnd2 = &lt;font color="#0000ff"&gt;new&lt;/font&gt; &lt;font color="#0080c0"&gt;Random&lt;/font&gt;(5);&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span&gt;&lt;font style="font-size:10.5pt;" color="#0000ff"&gt;int&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;random11 = rnd.Next();&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span&gt;&lt;font style="font-size:10.5pt;" color="#0000ff"&gt;int&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;random21 = rnd2.Next();&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span&gt;&lt;font style="font-size:10.5pt;" color="#0000ff"&gt;int&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;random12 = rnd.Next();&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span&gt;&lt;font style="font-size:10.5pt;" color="#0000ff"&gt;int&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;random22 = rnd2.Next();&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;span&gt;&lt;font style="font-size:10.5pt;" color="#008000"&gt;//random1 equals random21 and random12 equals random22&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;So Random will produce no actual random results, rather it is considered a pseudo-random method since its integer seed is responsible for all results.&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;So, how about using the default constructor?&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;span&gt;&lt;font style="font-size:10.5pt;"&gt;Random&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt; rnd = &lt;span&gt;new&lt;/span&gt;&amp;#160;&lt;span&gt;Random&lt;/span&gt;();&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;In case we feed no seed to Random, it gets its own value from the CPU-clock time value. In that case, things are not as bad as when we use our own seed, since time values can vary. Still it is not considered actual random since, as mentioned, some easy to guess seed determines all results. Actually if you find out a few results created, you can even predict what the next result will be even before it pops up.&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;Also, take a look at the following example.&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;span&gt;&lt;font style="font-size:10.5pt;" color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;randoms =&lt;span&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt; int[&lt;/span&gt;5];&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;span&gt;&lt;font style="font-size:10.5pt;" color="#0000ff"&gt;for&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;(&lt;span&gt;&lt;font style="font-size:10.5pt;" color="#0000ff"&gt;int&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;i = 0; i &amp;lt; randoms.Length; i++)&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;span&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#0080c0"&gt;Random &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;rnd = &lt;font color="#0000ff"&gt;new&lt;/font&gt; &lt;font color="#0080c0"&gt;Random&lt;/font&gt;();&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; randoms[ i ] = rnd.Next();&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;Since each of my loops takes a tiny amount of time to complete, all rnd objects we create use the same seed. As a result all values in the randoms array are equal. To avoid this we should have created one Random object and then use Next on the loop like this.&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;span&gt;&lt;font style="font-size:10.5pt;"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt; randoms =&lt;span&gt;&amp;#160;&lt;font color="#0000ff"&gt;new&lt;/font&gt; int[&lt;/span&gt;5];&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#0080c0"&gt;Random &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;rnd = &lt;font color="#0000ff"&gt;new&lt;/font&gt; &lt;font color="#0080c0"&gt;Random&lt;/font&gt;();&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span&gt;&lt;font style="font-size:10.5pt;" color="#0000ff"&gt;for&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(&lt;span&gt;&lt;font style="font-size:10.5pt;" color="#0000ff"&gt;int&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;i = 0; i &amp;lt; randoms.Length; i++)&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; randoms[ i ] = rnd.Next();&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;You may now be wondering, is there any point in using the constructor that takes a seed, if it makes things far less random than the default constructor does? Well, not much, but you can use it, if you want to test your random methods more than once so they will return the same values every time.&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;So, using Random is ok when we need a few random values that we do not mind if they are not actually random. And this applies perfectly most of the times. Actually, I've never found myself in need of more than that. However there are times we do need something more. This is where RNGCryptoServiceProvider comes into play.&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;img alt="random casino" src="http://dotnethints.com/admin/gallery/casino.png" width="104" height="104" /&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/div&gt;  &lt;h2 style="margin:11px 0px;text-transform:none;text-indent:0px;letter-spacing:normal;padding-bottom:0px;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;Using the RNGCryptoServiceProvider class&lt;/font&gt;&lt;/h2&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;RNGCryptoServiceProvider located in the System.Security.Cryptography will implement a cryptographic Random Number Generator using the implementation provided by the cryptographic service provider. What is the meaning of all that? Simply put, RNGCryptoServiceProvider uses OS Entropy as a seed. That OS Entropy is a value produced by things like keyboard timings, thermal temp, sound etc so it can be really hard to predict. As a result this makes it quite a random value generator.&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;We can use RNGCryptoServiceProvider like this.&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;span style="text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;" color="#0000ff"&gt;using&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;float:none;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;(&lt;/span&gt;&lt;span style="text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;span style="text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;float:none;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;rng =&lt;span&gt;&amp;#160;&lt;font color="#0000ff"&gt;new&lt;/font&gt; &lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;float:none;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span&gt;&lt;/span&gt;RNGCryptoServiceProvider())&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span&gt;byte&lt;/span&gt;[] bytesArray =&lt;font color="#0000ff"&gt;new&lt;/font&gt; byte[5];&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; rng.GetBytes(bytesArray);&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span&gt;&lt;font style="font-size:10.5pt;" color="#0000ff"&gt;int&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;randomvalue =&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span&gt;&lt;font color="#0080c0"&gt;BitConverter&lt;/font&gt;&lt;/span&gt;.ToInt32(bytesArray, 0); &lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;Even though RNGCryptoServiceProvider generates random results, using it instead of Random all the time is not a good idea since it is slower. If you do not wish to go for totally random values, stick to the simpler Random class.&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;It is also worth mentioning that the random number generators we described provide random (or pseudo-random numbers). However, randomness should not be mistaken with uniqueness. That means that a random generator does not necessarily produce unique numbers, even though it may be quite unusual to get two equal numbers one after the other in a sequence. To face the uniqueness problem we can use GUIDs which on the contrary are meant to be unique but not random. You can read&lt;a href="http://dotnethints.com/blogs/let-s-talk-about-guids"&gt;&lt;span&gt;&lt;font style="text-decoration:none;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;font style="text-decoration:none;"&gt;this article of mine&lt;/font&gt;&lt;/a&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;concerning GUIDs if you wish to learn more.&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/div&gt;  &lt;h2 style="margin:11px 0px;text-transform:none;text-indent:0px;letter-spacing:normal;padding-bottom:0px;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;Summary&lt;/font&gt;&lt;/h2&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;To generate random values we can use either the Random or the RNGCryptoServiceProvider class. Random is actually a pseudo-random generator based on its initialization seed. On the other hand RNGCryptoServiceProvider creates actual random values.&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;/div&gt;  &lt;div style="border:0px solid red;border-image:none;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;span style="text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;float:none;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:9.8pt;"&gt;Reference –&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;a href="http://dotnethints.com/blogs/getting-random-values"&gt;DotNetHints&lt;/a&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal;orphans:2;widows:2;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;text-decoration-style:initial;text-decoration-color:initial;"&gt;&lt;font style="font-size:9.8pt;"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=78124" width="1" height="1"&gt;</content><author><name>k badas</name><uri>https://www.dotnetzone.gr:443/cs/members/k+badas.aspx</uri></author></entry><entry><title>Yield and iterator methods</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2017/06/11/yield-and-iterator-methods.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2017/06/11/yield-and-iterator-methods.aspx</id><published>2017-06-12T02:32:19Z</published><updated>2017-06-12T02:32:19Z</updated><content type="html">&lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;All around C#, there are over a few dozen keywords. One of them, which is rarely used and is sometimes misunderstood, is yield. However, if used properly, yield can help in optimizing your code. Let's take a look at how it works.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;h2 style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;padding-bottom:0px;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;What does yield do?&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Let's get to what yield does using an example. We are going to create a method that returns a Fibonacci sequence. You have probably heard what Fibonacci numbers are, from your first for loop classes. So, a Fibonacci sequence is a series of numbers in which each number is the sum of the two preceding numbers. Well, this may not be the exciting way you would expect to implement yield, but I guess this will make things easier to grasp. So let's write the following code.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;fibonacciSequence = &amp;quot;&amp;quot;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;foreach&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;f&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;in&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;FibonacciEnum(10))&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; fibonacciSequence += f +&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot; &amp;quot;&lt;/font&gt;&lt;/span&gt;; &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The following method returns a Fibonacci sequence.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;private&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#daa520"&gt;IEnumerable&lt;/font&gt;&lt;/span&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int&lt;/font&gt;&lt;/span&gt;&amp;gt; FibonacciEnum(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;n)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; List&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int&lt;/font&gt;&lt;/span&gt;&amp;gt; fibonacciEnum =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;List&lt;/font&gt;&lt;/span&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int&lt;/font&gt;&lt;/span&gt;&amp;gt;();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; int &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;a = 0; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int &lt;/font&gt;&lt;/span&gt;b = 1; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int &lt;/font&gt;&lt;/span&gt;sum = 0;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; for&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int &lt;/font&gt;&lt;/span&gt;i = 0; i &amp;lt; n; i++)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; fibonacciEnum.Add(a);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sum = a + b;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; a = b;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; b = sum;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;fibonacciEnum;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So, we just created a method that returns an IEnumerable of integers by adding every number to a list. We call the method, get that IEnumerable and then loop through it and create the following string.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;0 1 1 2 3 5 8 13 21 34 &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Ok, let's implement the same method using yield and see what it looks like.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;private &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#daa520"&gt;IEnumerable&lt;/font&gt;&lt;/span&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int&lt;/font&gt;&lt;/span&gt;&amp;gt; Fibonacci(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int &lt;/font&gt;&lt;/span&gt;n)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; int &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;a = 0; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int &lt;/font&gt;&lt;/span&gt;b = 1; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int &lt;/font&gt;&lt;/span&gt;sum = 0;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; for &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int &lt;/font&gt;&lt;/span&gt;i = 0; i &amp;lt; n; i++)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; yield return&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;a;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sum = a + b;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; a = b;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; b = sum;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This is what implementing yield looks like. You can tell both methods look alike. It's like we removed our list object and use yield return to add one integer at a time to our IEnumerable on every iteration. What's even more confusing is that the result string we get is the same.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;0 1 1 2 3 5 8 13 21 34&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So, is there any reason to use yield at all?&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The answer is yes. Actually using yield is totally different that using a typical method. The answer would be easier to show if you could place a breakpoint within the Fibonacci method. Then you would notice that the method is not executed at all when called. On the contrary it will start executing when it is needed, in other words, when the for loop in the caller method begins. At that moment the Fibonacci method starts executing but stops as soon as it reaches yield return. When it does, code returns to the outer for loop and will get back to the method the next time an IEnumerable element is requested. The following picture will make things clearer.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:257px;width:256px;" alt="" src="http://dotnethints.com/admin/gallery/yield-fibonacci.png" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;As you can see, yield allows us to move in and out from our method but the method does not initialize. Its variables store the same values the way they were during last iteration. It's like the execution is paused, saved and then resumed from the save point later on. Repetitions will go on until we stop requesting elements or there are no more elements to return.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Yield can be used in combination with return on a method or a get accessor that returns an IEnumerable or IEnumerator. Using yield the method turns into an iterator. In other words the method is turned into a stateful machine which calculates each element of the IEnumerable only when needed. The compiler does all that transformation hard work here. All you have to do is use yield.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Before moving on, we should mention yield break. This is another way to end the iteration loop on our own. Suppose we do not want to compute Fibonacci numbers forever and ever, we can insert yield break, like this.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;private&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;IEnumerable&lt;/font&gt;&lt;/span&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int&lt;/font&gt;&lt;/span&gt;&amp;gt; Fibonacci(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;n)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; int &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;a = 0; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int &lt;/font&gt;&lt;/span&gt;b = 1; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int &lt;/font&gt;&lt;/span&gt;sum = 0;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; for&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int &lt;/font&gt;&lt;/span&gt;i = 0; i &amp;lt; n; i++)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(i &amp;lt; 9)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; yield return&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;a;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sum = a + b;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; a = b;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; b = sum;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; else&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; yield break&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This will end our method on the 9th iteration.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;0 1 1 2 3 5 8 13 21 &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;h2 style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;padding-bottom:0px;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Using yield&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Let's move on to another example. I'm not saying that Fibonacci numbers are boring but, well, I personally never had to use them since first year at school. So let's use sights that people visit on trips instead.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Here's a Sight class&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;public class&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#008080"&gt;Sight&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public int&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;Id;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public int&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt; CityId;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;Title;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Sight&lt;/font&gt;&lt;/span&gt;(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int&lt;/font&gt;&lt;/span&gt; id, &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int&lt;/font&gt;&lt;/span&gt; cityId, &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string &lt;/font&gt;&lt;/span&gt;title)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Id = id;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; CityId = cityId;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Title = title;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Here's a list so we can have some something to work with&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;public List&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Sight&lt;/font&gt;&lt;/span&gt;&amp;gt; sightsList =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new List&lt;/font&gt;&lt;/span&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Sight&lt;/font&gt;&lt;/span&gt;&amp;gt;() { &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Sight&lt;/font&gt;&lt;/span&gt;(1, 1,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Eye Of London&amp;quot;&lt;/font&gt;&lt;/span&gt;), &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Sight&lt;/font&gt;&lt;/span&gt;(2, 1,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Westminster Abbey&amp;quot;&lt;/font&gt;&lt;/span&gt;), &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Sight&lt;/font&gt;&lt;/span&gt;(3, 2,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Louvre&amp;quot;&lt;/font&gt;&lt;/span&gt;), &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Sight&lt;/font&gt;&lt;/span&gt;(4, 1,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Tower Bridge&amp;quot;&lt;/font&gt;&lt;/span&gt;), &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Sight&lt;/font&gt;&lt;/span&gt;(5, 2,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Notre-Dame&amp;quot;&lt;/font&gt;&lt;/span&gt;) };&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;And finally, here's the method that returns sights that are located within a city with a given Id, or return all sights in case cityId is 0.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;   &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;private&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#a52a2a"&gt;IEnumerable&lt;/font&gt;&lt;/span&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Sight&lt;/font&gt;&lt;/span&gt;&amp;gt; GetSightsByCategoryId(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;List&lt;/font&gt;&lt;/span&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Sight&lt;/font&gt;&lt;/span&gt;&amp;gt; sights,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;cityId)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;foreach&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;(&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Sight&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;sight&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;in&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;sights)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;if&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;(sight.CityId == cityId || cityId == 0)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;yield return&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;sight;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt; &lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Let's call GetSightsByCategoryId in a similar way we did the Fibonacci numbers.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;sightSeeing =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;foreach&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Sight&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;sight&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;in&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;GetSightsByCategoryId(sightsList, 1))&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sightSeeing += sight.Title +&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot; | &amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;You can probably guess how things work, but let's give it a try together. At first GetSightsByCategoryId will return Eye Of London, then Westminster Abbey. On next call it will ignore Louvre and move on to Tower Bridge. After that ,it will move on to the final two iterations trying to find more Sights but since there are no more that match, will return nothing more.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The result will look like that.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Eye Of London | Westminster Abbey | Tower Bridge | &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The same pattern would be followed if instead we had used&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;sightSeeing =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;String&lt;/font&gt;&lt;/span&gt;.Join(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot; | &amp;quot;&lt;/font&gt;&lt;/span&gt;, GetSightsByCategoryId(sightsList, 1).Select(x =&amp;gt; x.Title));&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Needless to say that yield does not need to show up only in methods that contain iteration loops. For example the following method is totally valid.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;   &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;private&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#a52a2a"&gt;IEnumerable&lt;/font&gt;&lt;/span&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Sight&lt;/font&gt;&lt;/span&gt;&amp;gt; GetSights()&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;yield return new&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Sight&lt;/font&gt;&lt;/span&gt;(1, 1,&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot;Eye Of London&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;yield return new&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Sight&lt;/font&gt;&lt;/span&gt;(2, 1,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Westminster Abbey&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt; &lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Now let's add some LINQ in our recipe.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;sightSeeing = GetSightsByCategoryId(sightsList, 1).First().Title;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This will enter GetSightsByCategoryId only once, since there is no need to get more elements. It will return&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Eye Of London&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:188px;width:250px;" alt="Eye Of London - Yield" src="http://dotnethints.com/admin/gallery/london-eye.jpg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;sightSeeing = GetSightsByCategoryId(sightsList, 0).Last().Title;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This will loop through all elements of sightsList till it gets to the last one. In contrast to the Fibonacci numbers there actually is no point in searching every single element since we know that the last element of the list has nothing to do with the previous ones. So this might not be a perfect case to use yield. Anyway, the result would be &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Notre-Dame&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;sightSeeing = GetSightsByCategoryId(sightsList, 1).First().Title + &amp;quot; | &amp;quot; + GetSightsByCategoryId(sightsList, 1).Last().Title;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;You may have probably guessed that the result is &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Eye Of London | Notre-Dame&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:276px;width:183px;" alt="notre-dame-yield" src="http://dotnethints.com/admin/gallery/notre-dame-yield.jpg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;I know, it's not much different than the previous one and, well, if you understand how yield works it's always the same pattern. What's more interesting is this. How many iterations do you think took place in order for the previous statement to be completed? If you guessed the same as the number of the list elements, you would be wrong. The thing is that a method containing yield is always computed from the beginning whenever it is called.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;If for example we had &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;sightSeeing = GetSightsByCategoryId(sightsList, 1).Last().Title +&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot; | &amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;+ GetSightsByCategoryId(sightsList, 1)Last().Title;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;this would require iterations twice the size of the list. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;If you are familiar with Data contexts this is probably not the first time you've heard of such things. Actually LINQ is based on yield. You may have already noticed that GetSightsByCategoryId(sightsList, 1) is no different than sightsList.Where(x =&amp;gt; x.CityId == 1). As a result yield carries along all pros and cons of LINQ.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;h2 style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;padding-bottom:0px;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Why should I use yield?&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Keep in mind that yield takes effect only in sequences like enumerators. So we may need to use it only in case we want to return a collection of objects.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Imagine you want to do some processing with a lot of elements contained within a sequence (that sequence could be anything, for example a database table or a group of files) but you want to process them one at a time. There is no point in wasting time and memory into loading all elements first and process them later. Instead you can get the first one, do what you want with it and then move to the next one. And so on. You can use yield to obtain lazy loading.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Otherwise suppose you have thousands of database records but you only need a few of them. Why would you want to fetch them all at the first place? Use yield instead.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Or maybe you want to get a sequence like the Fibonacci we talked about earlier. There surely is no end to that sequence, so you may want to give yield a try and get the sequence little by little.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Accessing one item at a time can make things less complicated if something goes wrong. Only the items currently in use need to be examined instead of the whole list.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Finally think of a sequence source bound to continuous changes. Creating a list of the objects could contain objects that might have changed from the time the list is loaded till we actually use them.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So, yield can be of help in certain situations but offers nothing in other cases. For example if we do want to loop through all elements of a sequence, there is no point in using yield. Or if we want to use the returned elements more than once. In that case data we ask for will be computed from the begining every time we need them. Transforming a method into an iteration and moving through all its objects takes time. Much more time than creating a list would take. So, whenever you think using yield would do good, remember to test your code afterwards so it doesn't backfire. Anyway, keep in mind that if there is no actual reason to use yield, then don't use it.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;h2 style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;padding-bottom:0px;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Conclusion&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Yield can be used to create an iterator out of a simple method. This can help us access the method's elements one at a time, whenever we need them instead of getting them all at once and then process them. This way, yield can help us when we want to get lazy loading; still it can be helpful in other cases as well. However we should be careful cause using yield is not always as good an idea as it may seem.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;float:none;color:;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font style="font-size:9.8pt;"&gt;Reference –&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:9.8pt;"&gt;&lt;a href="http://dotnethints.com/blogs/yield-and-iterator-methods"&gt;DotNetHints&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=78112" width="1" height="1"&gt;</content><author><name>k badas</name><uri>https://www.dotnetzone.gr:443/cs/members/k+badas.aspx</uri></author></entry><entry><title>Session in ASP.NET MVC applications</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2016/11/21/session-in-asp-net-mvc-applications.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2016/11/21/session-in-asp-net-mvc-applications.aspx</id><published>2016-11-22T05:04:51Z</published><updated>2016-11-22T05:04:51Z</updated><content type="html">&lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Session is a simple and nice way to store info in memory and has been used in ASP.NET for a long time. Since MVC came out, there were many people out there saying that session should be abandoned and replaced by other methods while others said that there is no problem using session the way we used to. As this may confuse developers that are not highly experienced in MVC, let's see what actually happens here.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;h2 style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;padding-bottom:0px;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Before MVC&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Web Forms have been the basic model for a developer who has been working on ASP.NET, for a long time. Web Forms was the result of Microsoft's efforts to create a web application based on windows standards. By default, web is stateless. If I send a request, this is supposed to be a request of its own, no matter what the history between me and the web server has been. To use a RESTful model, info should be sent using GET, POST requests, cookies etc. However, this model did not resemble windows applications. In order to avoid this, developers started using state management tools, like session for example.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;If you are not so sure what session is, you can take a look at&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;a style="text-decoration:;color:;" href="http://dotnethints.com/blogs/state-management-part-2-session"&gt;&lt;font color="#67217a"&gt;&lt;font style="text-decoration:none;" face="Segoe UI"&gt;this older post&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/font&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;of mine. Now, the thing is that as applications became more and more complex so did the way we used session. People had to be extra careful that nothing bad happened to their session.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:125px;width:125px;" alt="session_mvc_aspnet" src="http://dotnethints.com/admin/gallery/session_mvc.jpg" /&gt;&lt;/div&gt;  &lt;h2 style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;padding-bottom:0px;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;After MVC&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Then MVC was introduced and people who had been watching Web Forms growing all these years along with the troubles they carried, felt like something new, pure and RESTful could happen. These people felt like in order to achieve this, all the bad stuff Web Forms contained should be sent away, session being one of them. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So, using Session in MVC projects is no different than using session in Web Forms projects. The same problems that showed up in Web Forms are still right there. Then let's take a look at a few of them and see what all the fuss is about.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;ul style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;   &lt;li&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Session by default is stored in the IIS and uses its memory. This means that if IIS needs to recycle the application pool or memory is not enough, the session will be gone. There are other places to store session e.g. the Sql server; however this is not much different than storing the info in database tables in the first place.&lt;/font&gt;&lt;/font&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;ul style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;   &lt;li&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Session will expire after a while, depending on your timeout value. If you choose to increase timeout carelessly, you may end up consuming much more memory than you thought you would.&lt;/font&gt;&lt;/font&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;ul style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;   &lt;li&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;If you are using load balancers (and most enterprise website do so) you need to make sure that a user will get the same response no matter which server will serve him.&lt;/font&gt;&lt;/font&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:115px;width:165px;" alt="" src="http://dotnethints.com/admin/gallery/mvc_session.jpg" /&gt;&lt;/div&gt;  &lt;h2 style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;padding-bottom:0px;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Conclusion&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Using session on an MVC project is no different than doing so in a Web Forms project. Since choosing between using session or other ways of storing data depends on your case and your specs, there is no reason why you should not do it. If you believe that using session will do no harm to your project you may go for it, no matter what the project type is. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;"&gt;Reference – &lt;a href="http://dotnethints.com/blogs/session-in-asp-net-mvc-applications"&gt;DotNetHints&lt;/a&gt;&lt;/div&gt;&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=77874" width="1" height="1"&gt;</content><author><name>k badas</name><uri>https://www.dotnetzone.gr:443/cs/members/k+badas.aspx</uri></author></entry><entry><title>Boolean types - To null or not to null?</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2016/05/29/boolean-types-to-null-or-not-to-null.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2016/05/29/boolean-types-to-null-or-not-to-null.aspx</id><published>2016-05-30T01:28:12Z</published><updated>2016-05-30T01:28:12Z</updated><content type="html">&lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Boolean types are quite common to be found within a database. Alike many other types there are boolean and nullable boolean types. Simple boolean types consist of two values: True and False. Nullable ones offer null as a third choice. So, do we really need this third option in our database or source code and if so how should we deal with it?&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;h2 style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;padding-bottom:0px;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Nullable types&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Nullable bool is not the only type that accepts null values. For example we got nullable integers and nullable DateTimes. So, what is the meaning of null? To put it simply null means we have no idea what the value is.&amp;#160; So if, you got a nullable int, its values could be 10, 100, 0 or null. Now, 10 and 100 are standard values. So is 0, even if it actually refers to the number of zero objects. However null tells us that we do not know if the value is any one of these. Supposing int refers to the Bahamas' number of citizens. Setting null value to that variable does not imply that the Bahamas do not exist or have no citizens or that there is no record of that number somewhere out there. What it means is that at that given moment we do not know what the number is and this is quite different from using 0 as that would tell that there are no citizens at all.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The same thing goes for the DateTime. Using null as a DateTime value is like saying that we do not know when something happened. A person who is not really fond of history classes might respond &amp;quot;I have no idea at all&amp;quot; when asked when the French Revolution took place while another person might answer that it took place at 1789.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The same thing goes for boolean types. When asked whether it rained all day yesterday or not you could answer yes or no, but you could also answer &amp;quot;I don't know&amp;quot; (null) if you were all day long inside your no-windows office trying to finish that project that had to be delivered no matter what.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:183px;width:275px;" alt="bahamas-bool" src="http://dotnethints.com/admin/gallery/bahamas%20-%20bool.jpg" /&gt;&lt;/div&gt;  &lt;h2 style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;padding-bottom:0px;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Nullable boolean types on database&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;By now you may be wondering why I'm writing this article concerning nullable boolean types and not nullable types in general. The reason is, common types such as integers and DateTimes I mentioned earlier can get a lot of different values. However a boolean type has only two values and by adding an extra one we move on from binary to three-value logic. So even though all nullable types share common concepts, this case makes things a little more different.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Imagine you create a table named Orders. This table may contain two columns: DateCreated and DateDelivered. When creating an order row you know what the DateCreated is (the date the Order is created) but you have no knowledge of when the order is going to be be delivered. Keep in mind DateDelivered does not represent the date the order is expected to be delivered, but the date the order was actually delivered. As a result this column should be addressed as nullable.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Now, let's see how boolean types fit in. Suppose the table requires one more column called IsPriorityOrder and by default an order is not set as having priority unless assigned to. Should that be a nullable boolean (actually the exact SQL server type name is bit) or just a plain boolean? The question that needs to be answered is &amp;quot;Could there be a case where we will not know if IsPriorityOrder is either true or false?&amp;quot; . If the answer is true, go for the nullable, otherwise go for the boolean.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;In the case of IsPriorityOrder, if all orders by default get false value, which can then be altered to true if needed, then the answer is boolean. This case does not prove to be much difficult. However, suppose in the same scenario, that there is no way to know what the default value should be (there are as many priority as non-priority orders) and that after a person creates an order, there is some other person who gets all orders that have no IsPriorityOrder value in order to add one to them. How would you get all such orders, if both these and the ones that have verified false value look the same? Of course, using a nullable type is not the only way to move on. I am just trying to point out that in order to choose between nullable and not nullable bools you need to pay extra attention to where you want to get (as goes on with everything concerning database actually).&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Let's do one more column. We add a column called HasPositiveReview. In this case using a simple bool type would make thinks complicated. Sure you can use it if you want, and say for example that all records get by default HasPositiveReview false value. Now when the order is completed and we get the review we can set the value to true if we want to. However, imagine you are asked for a review mentioning how many orders contain false reviews. Now you have to find all orders having false HasPositiveReview and add some extra check to avoid the ones that have not yet been set (check if DateDelivered is null for example) while in the case of nullable bool all you had to do was check the HasPositiveReview value for false.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Personally, I prefer solutions that make things clearer. The ones that wil make things easier for some other person (or yourself after a while) to comprehend how things work. However, since there are people who prefer to try out custom solutions, you can always choose the method you want, just make sure that it won't cause you extra trouble in future.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So the thing is, if you do need an extra third case, apart from true or false, use nullable boolean. If not, don't use it just in case there might be a time in future when you will need a nullable boolean, as nullable types are more complex than non-nullable ones and might cause trouble.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;For example, keep in mind that null is neither false nor true or anything else. Null is nothing. That's the reason when we write a select query the correct syntax is&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;SELECT * FROM Orders WHERE IsPriorityOrder IS NULL&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;while the following query&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;SELECT * FROM Orders WHERE IsPriorityOrder = NULL&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;will not work properly.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:192px;width:262px;" alt="bahamas bool" src="http://dotnethints.com/admin/gallery/bahamas-bool2.jpg" /&gt;&lt;/div&gt;  &lt;h2 style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;padding-bottom:0px;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Nullable types and C#&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Nullable types are different from their non-nullable equivalent. They are actually instances of the System.Nullable&amp;lt;T&amp;gt; struct. Using the '?' symbol after a type, is nothing more than a shortcut to the nullable type. Using nullable types when not needed, will make you take extra actions.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Nullable types, being different, may not directly be used with non-nullable types. So they contain the bool property HasValue. Checking that property, is similar to testing your nullable value for null. After that you can get its non-nullable type value by using the Value property. Here's what it looks like in case of bool types (it really makes no difference any type you choose).&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;bool&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;nonNullableType =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;false&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;bool&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;? nullableType =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;null&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;(nullableType.HasValue)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;//Check for if(nullableType != null) if you prefer&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; nonNullableType = nullableType.Value;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //You could also use nonNullableType = (bool)nullableType;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;In case the bool? contained null value and the HasValue test was omitted, an InvalidOperationException would be thrown.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;As you can see, using nullable types may cause bugs, which would have been avoided by non-nullable types, to show up. Take the following example. Even though bool types have no such problems, greater than and lower than operators will not work as expected when comparing nullable types. Comparing with null will return false; and that makes perfect sense since we can't tell what a value we don't know has to do with a value we do know. Look at the following example to see how things can get complicated in the third case where lower than returns false while not greater than returns true.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;int&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;? i = 4;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(i &amp;lt; 5)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;// true&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(i &amp;gt; 5)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;// false&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(!(i &amp;gt; 5))&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ; &lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;// true&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;int&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;? i = &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;null&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(i &amp;lt; 5)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ; &lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;// false&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(i &amp;gt; 5)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ; &lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;// false&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(!(i &amp;gt; 5))&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ; &lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;// true&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;h2 style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;padding-bottom:0px;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Summary&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Nullable types are used to insert null, as an extra option, when we don't know what the value is. Nullable Boolean types create a three-value logic type. Nullable values are better to be avoided, if not necessary, to avoid possible bugs as well.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;Reference – &lt;a href="http://dotnethints.com/blogs/boolean-types-to-null-or-not-to-null-"&gt;DotNetHints&lt;/a&gt;&lt;/font&gt;&lt;/div&gt;&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=77730" width="1" height="1"&gt;</content><author><name>k badas</name><uri>https://www.dotnetzone.gr:443/cs/members/k+badas.aspx</uri></author></entry><entry><title>Shorten your URLs using goo.gl</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2016/04/11/shorten-your-urls-using-goo-gl.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2016/04/11/shorten-your-urls-using-goo-gl.aspx</id><published>2016-04-12T03:42:15Z</published><updated>2016-04-12T03:42:15Z</updated><content type="html">&lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Shortened URLs have slowly turned into one of the latest trends. Even though it's been about 15 years they've been helping people having difficulty with limited character messaging applications and SMS, social networks sharing such limitations have caused some major increment in their use. We are going to see what shortened URLs are, and how we can create our own, using goo.gl API.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;h2 style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;padding-bottom:0px;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;What is a shortened URL?&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;A shortened URL is a URL that redirects to the same address as the one requested. For example you can use goo.gl (Google's URL shortener service) to create a shortened URL by visiting https://goo.gl/ and placing the URL you want to shorten. If you place http://dotnethints.com/&amp;#160; you get http://goo.gl/5nIcLC.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Now, if you hit that new address on your browser you will head to that URL shortener's company site. The original URL will be found and you will be automatically redirected to your destination. Keep in mind that shortened URLs are supposed to last forever.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So, we may use shortened URLs when we want to minimize the number of characters contained within our URL. Shortened URLs can also be used if we want to hide the address our original URL is pointing to from the person to click it. This is the reason many spammers choose to use URL shortening.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;There are many URL shortening services out there, including bitly and tiny URL. goo.gl, the service supported by Google, is the one we will be using in this article.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;h2 style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;padding-bottom:0px;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Using goo.gl&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:323px;width:400px;" alt="goo.gl" src="http://dotnethints.com/admin/gallery/google-goo-gl-url-shortening-service.jpg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;As mentioned earlier, to use goo.gl a single person can use the service in the https://goo.gl/ page.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;A developer can also make use of the goo.gl API to create a JSON request containing the original URL and get a JSON response containing the shortened URL.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;To use the goo.gl API a developer needs to have an API key. You can get a key in&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;a style="text-decoration:;color:;" href="https://console.developers.google.com/apis/api/urlshortener/overview"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#67217a"&gt;&lt;font style="text-decoration:none;"&gt;this page &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Now that we have our key, we need to create our request to https://www.googleapis.com/urlshortener/v1/url?key=my_API_key and deal with the results so we get the shortened URL.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;To accomplish this we can use the following method:&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;var&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;httpWebRequest&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;= (&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;HttpWebRequest&lt;/font&gt;&lt;/span&gt;)WebRequest.Create(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;https://www.googleapis.com/urlshortener/v1/url?key=my_API_key&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;httpWebRequest.ContentType =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;application/json&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;httpWebRequest.Method =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;POST&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;using&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;var&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;streamWriter =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;StreamWriter&lt;/font&gt;&lt;/span&gt;(httpWebRequest.GetRequestStream()))&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;json = &amp;quot;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;{\&amp;quot;longUrl\&amp;quot;:\&amp;quot;&lt;/font&gt;&lt;/span&gt;&amp;quot; + url + &amp;quot;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;\&amp;quot;}&lt;/font&gt;&lt;/span&gt;&amp;quot;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; streamWriter.Write(json);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;span class="Apple-tab-span" style="white-space:nowrap;"&gt;&lt;font style="font-size:10.5pt;"&gt; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We create a POST request containing a JSON object with a longUrl element. That is the original URL we want to shorten.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Then we will get a JSON response containing a serialized object (in the form of the UrlShortener class we create) containing three elements: kind, id and longUrl.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;kind&amp;#160; is the kind of response we get eg urlshortener#url&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;longURL is the original URL we want shorten&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;id is the shortened URL.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;private string&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;GetShortenedURL(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;url)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;var&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;shortenedURL = url;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Create the request&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;var &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;httpWebRequest &lt;/font&gt;&lt;/span&gt;= (&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;HttpWebRequest&lt;/font&gt;&lt;/span&gt;)WebRequest.Create(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;https://www.googleapis.com/urlshortener/v1/url?key=my_API_key&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; httpWebRequest.ContentType = &lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;application/json&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; httpWebRequest.Method = &lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;POST&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Add longURL&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; using &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;var &lt;/font&gt;&lt;/span&gt;streamWriter = &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;StreamWriter&lt;/font&gt;&lt;/span&gt;(httpWebRequest.GetRequestStream()))&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; string &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;json = &amp;quot;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;{\&amp;quot;longUrl\&amp;quot;:\&amp;quot;&lt;/font&gt;&lt;/span&gt;&amp;quot; + url + &amp;quot;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;\&amp;quot;}&lt;/font&gt;&lt;/span&gt;&amp;quot;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; streamWriter.Write(json);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;span class="Apple-tab-span" style="white-space:nowrap;"&gt;&lt;font style="font-size:10.5pt;"&gt; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;var&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;httpResponse = (&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;HttpWebResponse&lt;/font&gt;&lt;/span&gt;)httpWebRequest.GetResponse();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;using &lt;/font&gt;&lt;/span&gt;(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;var &lt;/font&gt;&lt;/span&gt;streamReader = &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;StreamReader(httpResponse.GetResponseStream()))&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Deserialize response&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;var &lt;/font&gt;&lt;/span&gt;responseText = streamReader.ReadToEnd();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;var &lt;/font&gt;&lt;/span&gt;jsonSerializer = &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;System.Web.Script.Serialization.JavaScriptSerializer();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; jsonSerializer.MaxJsonLength = 2147483647;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;UrlShortener&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;shortener = jsonSerializer.Deserialize&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;UrlShortener&lt;/font&gt;&lt;/span&gt;&amp;gt;(responseText);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; shortenedURL = shortener.id;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;shortenedURL;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; private class&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#008080"&gt;UrlShortener&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;public string&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;kind;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt; public string&lt;/font&gt;&lt;/span&gt; id;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt; public string&lt;/font&gt;&lt;/span&gt; longUrl;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;For example if I used the code above to ask for the http://dotnethints.com/ shorten URL, I would get the following JSON&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt; &amp;quot;kind&amp;quot;: &amp;quot;urlshortener#url&amp;quot;,&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt; &amp;quot;id&amp;quot;: &amp;quot;http://goo.gl/RWZBj0&amp;quot;,&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt; &amp;quot;longUrl&amp;quot;: &amp;quot;http://dotnethints.com/&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;span class="Apple-tab-span" style="white-space:nowrap;"&gt;&lt;font style="font-size:10.5pt;"&gt; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Since a serialized JSON is no more than a string we can also get its id by using string methods, but I personally find this way to be a better one.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;h2 style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;padding-bottom:0px;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Summary&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Shortened URLs are URLs that can be used in place of the original longer ones to minimize their length. There are many services we can use to create a shortened URL, goo.gl being one of them. We can either visit goo.gl's home page to create shortened URLs on the fly or use the goo.gl API to create JSON requests and get responses containing the info we want.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;/font&gt;&lt;/div&gt;  &lt;p&gt;Reference&lt;/p&gt;  &lt;p&gt;&lt;a href="http://dotnethints.com/blogs/shorten-your-urls-using-goo-gl"&gt;DotNetHints&lt;/a&gt;&lt;/p&gt;&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=77658" width="1" height="1"&gt;</content><author><name>k badas</name><uri>https://www.dotnetzone.gr:443/cs/members/k+badas.aspx</uri></author></entry><entry><title>Shallow and deep copying objects</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2016/02/28/shallow-and-deep-copying-objects.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2016/02/28/shallow-and-deep-copying-objects.aspx</id><published>2016-02-28T19:38:26Z</published><updated>2016-02-28T19:38:26Z</updated><content type="html">&lt;p&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Working as a developer I have created quite a lot of objects. Most of them were unique. There were some of them, however, that were created by copying already existing objects. C# provides us with a few techniques to accomplish this, keeping in mind whether we want to create a copy that keeps all data the prototype had, or how to deal with the referenced types contained within that object. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;h2 style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;padding-bottom:0px;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Shallow and deep copies&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;A way to understand things better is to create a class called Book. What we're going to do, is try to copy Book objects. Here's the class.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;public class&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#008080"&gt;Book&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public string&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;Name {&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;get&lt;/font&gt;&lt;/span&gt;;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;set&lt;/font&gt;&lt;/span&gt;; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;public double&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;Price { &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;get&lt;/font&gt;&lt;/span&gt;; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;set&lt;/font&gt;&lt;/span&gt;; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Writer&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;Author { &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;get&lt;/font&gt;&lt;/span&gt;; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;set&lt;/font&gt;&lt;/span&gt;; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;public&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Book&lt;/font&gt;&lt;/span&gt;(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;/font&gt;&lt;/span&gt; name, &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;double&lt;/font&gt;&lt;/span&gt; price, &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Writer &lt;/font&gt;&lt;/span&gt;author)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Name = name;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Price = price;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Author = author;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;public class&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#008080"&gt;Writer&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public string&lt;/font&gt;&lt;/span&gt; Name { &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;get&lt;/font&gt;&lt;/span&gt;; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;set&lt;/font&gt;&lt;/span&gt;; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Book class contains three parameters: Name, Price&amp;#160; and Author. Author is a Writer; a class that contains only one parameter; string Name.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;Book &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;book =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Book&lt;/font&gt;&lt;/span&gt;(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;The Gods Themselves&amp;quot;&lt;/font&gt;&lt;/span&gt;, 7.5, &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Writer&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;{ Name =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Isaac Asimov&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;});&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We have just created a Book object. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The most straightforward way to create a copy is a new constructor that gets the old object and creates the copy.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;public &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Book&lt;/font&gt;&lt;/span&gt;(&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Book&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;book)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Name = book.Name;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Price = book.Price;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Author = book.Author;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;Book &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;bookCopy =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Book&lt;/font&gt;&lt;/span&gt;(book);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;And this is our brand new copy. Let's change something shall we?&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;bookCopy.Name =&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot;Out Of The Silent Planet&lt;/font&gt;&lt;/span&gt;&amp;quot;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;After that command, book's name is The Gods Themselves and bookCopy's name is Out Of The Silent Planet. However since Out Of The Silent Planet is written by C.S.Lewis we should also change the author name. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;bookCopy.Author.Name =&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot;C. S. Lewis&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Done. So, right now we got two books. Asimov's The Gods Themselves and Lewis' Out Of The Silent Planet. Actually... no we don't. At the moment both books seem to be written by Lewis. Why is that? That is because when we created our copy, we created a fresh copy of Name, Price and the reference to Asimov. Not the Writer itself. As a result changing the referenced Writer from our copy, we change the value the original object is pointing to as well. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;A copy that works this way is called a shallow copy. Could we change the constructor somehow so it creates a copy of the author instead of a copy to the reference? Yes, we can. All we need to do is:&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;public&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Book&lt;/font&gt;&lt;/span&gt;(&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Book&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;book)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Name = book.Name;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Price = book.Price;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Deep copy&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Author =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Writer&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;{ Name = book.Name};&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Now, if we run the same code as above, Asimov will stand right where we put him and both books will have their respective authors. A copy where all values are copied from the scratch is called a deep copy.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:150px;width:150px;" alt="Asimov - copying objects" src="http://dotnethints.com/admin/gallery/asimov.jpeg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Now that we have come in terms with what a shallow and a deep copy is, let's focus on methods we can use to create them.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;h2 style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;padding-bottom:0px;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Using MemberwiseClone&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Using a constructor we can create a copy of an object whether this is a shallow or a deep one or something in between. We can also add extra features to it the way we like. Of course changing the values compared to the ones the original object had will not create an exact copy but, anyway, the point is that using a constructor you are free to do whatever you want.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;MemberwiseClone is .NET's way of creating a shallow copy. It will copy all non reference values and copy the reference of the reference types. Let's create the Copy method for our Book class. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;public&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Book&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;Copy()&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160; //Shallow copy&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;(&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Book&lt;/font&gt;&lt;/span&gt;)&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;this&lt;/font&gt;&lt;/span&gt;.MemberwiseClone();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;MemberwiseClone will create a shallow copy. We can add extra code to create a deep copy.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;public&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Book&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;DeepCopy()&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Deep copy &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Book &lt;/font&gt;&lt;/span&gt;copy =&amp;#160; (&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Book&lt;/font&gt;&lt;/span&gt;)&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;this&lt;/font&gt;&lt;/span&gt;.MemberwiseClone();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; copy.Author =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Writer&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;{ Name =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;this&lt;/font&gt;&lt;/span&gt;.Author.Name };&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;copy;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;h2 style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;padding-bottom:0px;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The IClonable interface&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;IClonable is an interface created in order to be implemented on classes that are expected to copy themselves. It requires the Clone method. Here's how the Book class would look like using the IClonable interface.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;public class&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;BookClone&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;:&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#8b4513"&gt;ICloneable&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public string&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;Name { &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;get&lt;/font&gt;&lt;/span&gt;; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;set&lt;/font&gt;&lt;/span&gt;; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public double&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;Price { &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;get&lt;/font&gt;&lt;/span&gt;; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;set&lt;/font&gt;&lt;/span&gt;; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Writer&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;Author { &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;get&lt;/font&gt;&lt;/span&gt;; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;set&lt;/font&gt;&lt;/span&gt;; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;BookClone&lt;/font&gt;&lt;/span&gt;(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;/font&gt;&lt;/span&gt; name, &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;double&lt;/font&gt;&lt;/span&gt; price, &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Writer &lt;/font&gt;&lt;/span&gt;author)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Name = name;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Price = price;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Author = author;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public object&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;Clone()&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return this&lt;/font&gt;&lt;/span&gt;.MemberwiseClone();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This is an example of how we can use the IClonable interface&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;BookClone &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;book =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;BookClone&lt;/font&gt;&lt;/span&gt;(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;The Gods Themselves&amp;quot;&lt;/font&gt;&lt;/span&gt;, 7.5,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Writer&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;{ Name =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Isaac Asimov&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;});&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;BookClone &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;bookCopy = (&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;BookClone&lt;/font&gt;&lt;/span&gt;)book.Clone();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So, if a class implements the IClonable interface then we may presume that it supports objects copying.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Since ICloneable is nothing but an interface, all that it says is that you have to implement the Clone method. However it does not tell you what the Clone method does. Clone could be implemented to create a shallow copy or a deep copy for example. People argue that the IClonable and the Clone method are more of a trouble than help as a developer will have to check what the Clone implementation actually does before using it. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;In other words a person might prefer creating his own e.g. ICopyable interface which contains the CopyShallow and CopyDeep methods and make things clearer for everyone using that code.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:169px;width:300px;" alt="simpsong icloneable" src="http://dotnethints.com/admin/gallery/simpsons-clone.png" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&amp;#160;&lt;/div&gt;  &lt;h2 style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;padding-bottom:0px;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Serialization&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Searialization is the process of converting an object into a stream of bytes. You may want to do that in order to store that info in memory or in a file or for any other reason you like. Deserialization is the reverse procedure; getting a stream of bytes and turning it back into an object.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;By serializing and deserializing an object we can easily create a deep copy. Check out the following method.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;public&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Book&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;DeepCopyUsingSerialization()&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;using&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;(&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;MemoryStream&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;memoryStream =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;MemoryStream&lt;/font&gt;&lt;/span&gt;())&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#daa520"&gt;IFormatter&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;formatter = &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#40e0d0"&gt;BinaryFormatter&lt;/font&gt;&lt;/span&gt;();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; formatter.Serialize(memoryStream, this);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; memoryStream.Seek(0,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#daa520"&gt;SeekOrigin&lt;/font&gt;&lt;/span&gt;.Begin);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;formatter.Deserialize(memoryStream)&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;as &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Book&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;To make that code build, you may want to use the following libraries.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;using&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;System.IO;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;using &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;System.Runtime.Serialization;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;using &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;System.Runtime.Serialization.Formatters.Binary;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Oh, and don't forget to declare your classes as [&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Serializable&lt;/font&gt;&lt;/span&gt;].&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;All we are doing is what we described earlier. We serialize the object and then create a new object by deserializing the stream created. There are many ways to accomplish object serialization in .NET. The example I've written is just one of them. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Keep in mind that using serialization might be a slower method to choose than the ones mentioned before.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Apart from the methods described, you may also use reflection to copy objects. I am planning on writing an article concerning reflection later on, so apart from mentioning it, I am not going to write more about it.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;There is no perfect way to copy an object. The ones we talked about are the most commonly used. You may choose the best one, depending on your case or create your own custom method.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:235px;width:200px;" alt="c s lewis - copying objects" src="http://dotnethints.com/admin/gallery/C.S._Lewis.jpg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;h2 style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;padding-bottom:0px;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Summary&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;When it comes to copying objects, there are two categories; shallow and deep copies. Shallow copies will hold the same references to referenced individual objects and copy all other values, while deep copies will create new instances for these objects as well. There are many ways to copy an object either shallow, or deep. Using constructors, the MemberwiseClone method, serialization and reflection being among them.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font style="face:'Segoe;"&gt;&lt;font style="font-size:9.8pt;"&gt;Reference&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font style="face:'Segoe;"&gt;&lt;font style="font-size:9.8pt;"&gt;&lt;a href="http://dotnethints.com/blogs/shallow-and-deep-copying-objects"&gt;DotNetHints&lt;/a&gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=77610" width="1" height="1"&gt;</content><author><name>k badas</name><uri>https://www.dotnetzone.gr:443/cs/members/k+badas.aspx</uri></author></entry><entry><title>Choosing between fields, properties and methods</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2016/02/08/choosing-between-fields-properties-and-methods.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2016/02/08/choosing-between-fields-properties-and-methods.aspx</id><published>2016-02-09T04:06:04Z</published><updated>2016-02-09T04:06:04Z</updated><content type="html">&lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;I once told a friend of mine that programming is much like chess. In some cases it is; for example when you know where you want to get but there are so many paths to follow. Choosing between fields, properties and methods when you want to store a value temporarily or retrieve it, can be described as some of these scenarios. There was a time I created a class and wanted to store some data, but I was not sure which was the best way to do it. Should I create a simple private variable where I would store the value, use a property and some extra auxiliary variable, or instead avoid getters and setters and use nothing more than a method? Since there may be some developers out there sometimes confused with such questions, I thought of writing an article about it.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;h2 style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;padding-bottom:0px;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Is there a problem at all?&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;To get started, let's create a class called MartialArtist which holds a single important piece of information: the martial artist's name. Here's the code.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;public class&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#008080"&gt;MartialArtist&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160; //This is a field&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public string&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;Name;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160; //This is an automatic property&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public string&lt;/font&gt;&lt;/span&gt; NameProp {&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;get&lt;/font&gt;&lt;/span&gt;;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;set&lt;/font&gt;&lt;/span&gt;; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; /&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;/This is a simple method &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public string&lt;/font&gt;&lt;/span&gt; GetName()&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;/font&gt;&lt;/span&gt; name;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Compute name&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;name;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Ok, that's what we've been talking about. However things still don't seem to be complicated. There's a field, a property and a method and they all seem to work in their own way. So, let's make things a bit more complicated.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;public class&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#008080"&gt;MartialArtist&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;   &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160; //This is a field&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public string&lt;/font&gt;&lt;/span&gt; Name;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt; &lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public string&lt;/font&gt;&lt;/span&gt; _nameProp;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160; //This is a property&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public string&lt;/font&gt;&lt;/span&gt; NameProp &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; { &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; get&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;_nameProp;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; set&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _nameProp =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;value&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160; //This is a simple method &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public string&lt;/font&gt;&lt;/span&gt; GetName()&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;_nameProp;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Now, differences between them seem to get unclear. Why is a public field different from a public property using a private field? And what is the difference between a public property using a private field and a public method using a private field? Let's try to clear things out.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:172px;width:136px;" alt="martial artist property" src="http://dotnethints.com/admin/gallery/martial-artist-property.jpg" /&gt;&lt;/div&gt;  &lt;h2 style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;padding-bottom:0px;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Fields vs Properties&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Here's how we use the field.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;MartialArtist &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;BruceLee =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;MartialArtist&lt;/font&gt;&lt;/span&gt;();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;BruceLee.Name =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#a52a2a"&gt;&amp;quot;Bruce Lee&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;martialArtistName = BruceLee.Name;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;And how about the property?&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;BruceLee.NameProp = &lt;span style="color:;"&gt;&lt;font color="#a52a2a"&gt;&amp;quot;Bruce Lee&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;string &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;martialArtistName = BruceLee.NameProp;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;There seems to be no difference between how we use a field or a property. So let's focus on what is a field and what makes a property.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;A field is nothing more than a part of the class info. A position in the memory for a string variable to be placed. If we wish to store some value on Name, that's exactly where it will be stored. And if later on we wish to get it back that's where we'll get it from. That's as simple as it can get.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Properties are a bit more complicated. An automatic Name property looks like this&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;public string&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt; NameProp {&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;get&lt;/font&gt;&lt;/span&gt;;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;set&lt;/font&gt;&lt;/span&gt;; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This looks simple as well, however it is not. When we write this line, unaware to us, two methods and a field will automatically be created. These methods consist of the getter and the setter, and the variable represents the place where the data will be stored. In a few words, creating an automatic property will look like creating a non automatic property&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;private string&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;_name;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;public string&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;Name&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{ &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;#160;&amp;#160;&amp;#160; get&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;_name;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; set&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _name =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;value&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;True, an automatic property is nothing more than an actual property and the ability to create one was granted to us developers in order to save us the trouble of writing extra code than necessary. So, now that a few things concerning fields and properties are clearer, let's try and answer the base question. Should we prefer fields over properties?&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Fields are, well, fields. Properties are methods that use fields. So properties are expected to be far slower in accessing stored values. However this is not what happens. You see, when creating properties with methods that keep it simple, these properties will be inlined by JIT compiler, so that they will be optimized and become faster; much faster. Even faster than a single field. So even if you guessed that you should choose a field over an automatic property, just because the field will execute faster, you should think about it twice.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Apart from being faster, using properties has more advantages. Properties may include extra code within their getter and setter methods and they may even include exception handling. They may also have no getter or setter method, this way averting the user from setting or getting the property's value directly. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Furthermore, you may not use a field as datasource for controls. You can instead use a property. Properties support encapsulation. Accessor methods can be overridden by classes inheriting this one. Also keep in mind that you may use properties on interfaces but you may not use fields.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;One last thing to mention is you may think that you can create a field and, when needed, turn it into a property. Keep in mind in that case you will have to recompile all code that uses this field since a field is much different than a property, even though they use the same syntax when called. This may cause trouble to large projects.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;True; there are not many good reasons to use a field over a parameter. There are some things, for example you may not use a parameter as a ref or out property when you call a method (but you may use a field for that reason) and you may not have a readonly parameter. However there are workarounds. You will not be forced to use fields, because of these things. Microsoft is little by little moving on to parameters and the basic reason fields are still being useful is because there are tons of code using them, as well as a lot of developers who are used to handling them.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Still, if you enjoy it, you are free to go on using fields the way like, as long as you keep in mind the things said.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:113px;width:150px;" alt="Bruce lee property" src="http://dotnethints.com/admin/gallery/bruce-lee-property.jpg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;h2 style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;padding-bottom:0px;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Properties vs Methods&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Let's move on to the methods. Again, what was that trouble we had?&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;public class&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#008080"&gt;MartialArtist&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;public string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;Name {&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;get&lt;/font&gt;&lt;/span&gt;;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;set&lt;/font&gt;&lt;/span&gt;;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;private string&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;_name;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;GetName()&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;_name;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Well, we were not sure when to use a property or a method. So far, we mentioned that some properties can get inlined, making them faster than using a method. However, this not the main difference.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Properties represent some info or attribute, while methods represent some action. For example Name is well suited to be a property since it represents a MartialArtist's value. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Since a property represents some object value, it is fairly expected that this value is easy to compute. It is a part of the object info after all. So a property is supposed to be fast. A method on the other hand could be expected to take a lot of time to complete.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;int&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;counterProperty = MartialArtists.Where(ma =&amp;gt; ma.Origin == &amp;quot;Hong Kong&amp;quot;).Count();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;int&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;counterMethod = MartialArtists.Where(ma =&amp;gt; ma.GetOrigin() == &amp;quot;Hong Kong&amp;quot;).Count();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Look at these expressions. Which one seems to be faster to you? The first one I guess. That's because you are expecting a property to work faster than a method. Actually, if you are not the person who has written the class code (most likely) you may not even realize if Origin is a property or a field. Anyway, in case a property takes a lot of time to compute every time it is called, you'd better go for the method.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Property values are expected to remain intact no matter how many times they are used. That's unless of course you change its value on purpose.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;MartialArtist &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;BruceLee = new &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;MartialArtist&lt;/font&gt;&lt;/span&gt;();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;name1 = BruceLee.Name;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;string &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;name2 = BruceLee.Name;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;name1 and name2 are expected to hold the same value. It's nothing more than a property of the object after all.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;MartialArtist &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;BruceLee = new &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;MartialArtist&lt;/font&gt;&lt;/span&gt;();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;string &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;name1 = BruceLee.GetName();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;string &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;name2 = BruceLee.GetName();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;In that case however name1 and name2 are far less obvious to hold the same value. Calling GetName once may have changed a lot of things, which will change what GetName will return the next time it is called.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Furthermore, properties should not have significant side effects. If for example, getting Name, will cause the NamePerSessionCounter to increase (which is a &amp;quot;significant&amp;quot; value supposed to increase only once per session), we might consider using a method instead to avoid confusion. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So, choosing between a property and a method depends on how you are planning to use it. Keep it simple so everyone is happy.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Getting close to the end of this article, let's talk about some well known property, DateTime.Now. This property behaves in the following way&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;public static&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;DateTime&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;Now {&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;get&lt;/font&gt;&lt;/span&gt;; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;It does represent some info and no action, it is fast to get results and affects nothing more. So it's fair to be a property. What's strange about it, though, is that DateTime may not return the same value if called more than once (if it takes some time between the first and the second time for example), violating one of the things we told. So, if DateTime.Now returns different DateTime values each time it's called, should it be a property? This is the reason many people argue that DateTime.Now should have been turned into a static method instead.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:175px;width:175px;" alt="ying yang methods properties" src="http://dotnethints.com/admin/gallery/ying-yang-field.png" /&gt;&lt;/div&gt;  &lt;h2 style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;padding-bottom:0px;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Summary&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;You may use fields, properties and methods to get and set values within your code. Fields are not much better than properties. When comparing properties to methods, however, you should pay attention to what they are made for doing and how they affect the rest of your source code.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;Reference&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;a href="http://dotnethints.com/blogs/fields-properties-and-methods"&gt;DotNetHints&lt;/a&gt;&lt;/font&gt;&lt;/div&gt;&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=77593" width="1" height="1"&gt;</content><author><name>k badas</name><uri>https://www.dotnetzone.gr:443/cs/members/k+badas.aspx</uri></author></entry><entry><title>Deferred execution on LINQ to Entities</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2015/11/07/deferred-execution-on-linq-to-entities.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2015/11/07/deferred-execution-on-linq-to-entities.aspx</id><published>2015-11-08T02:28:49Z</published><updated>2015-11-08T02:28:49Z</updated><content type="html">&lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Many people use entity framework but are not aware of what deferred execution is and how it may affect their projects. In this article, we are going to have a little talk about it and see how things work.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;h2 style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;padding-bottom:0px;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;LINQ to entities and deferred execution&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We take into account that we all have some understanding of entity and LINQ or lambda expressions. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;To go through this post we created a table called Videogames containing four columns (ID, Name, MainCharacterName and Publisher) and filled it with some popular vintage videogames. Let's start with the following piece of code.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;videogameNames =&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;var&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;MarioVideogames = db.Videogames.Where(v =&amp;gt; v.MainCharacterName ==&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Mario&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;foreach&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;var&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;videogame&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;in&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;MarioVideogames)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160; videogameNames += videogame.Name +&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot;&amp;lt;br/&amp;gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Let's say our table contained only two Videogames having Mario MainCharacterName:&amp;#160; Super Mario Bros and Super Mario Bros 2. The resulting string would be&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Super Mario Bros&amp;lt;br/&amp;gt;Super Mario Bros 2&amp;lt;br/&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;(There's nothing wrong in using lambda expressions when talking about LINQ to entities. It's all the same in the end and I personally think that it is much easier to read. If you preferred LINQ queries you could have written &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;var&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;MarioVideogames =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;from&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;videogame&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;in&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;db.Videogames&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;where&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;videogame.MainCharacterName ==&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Mario&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;select&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;videogame&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;instead )&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Nothing strange so far. What is interesting about it is the deferred execution we talked about. In other words, the MarioVideogames variable will not be filled with data the moment it is declared but rather the moment it is used. To be exact, the moment it is iterated.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The IEnumerable interface requires the implementation of the GetEnumerator() method, which returns an enumerator to iterate through a collection, regardless of whether that collection is an IEnumerable, an IQuerable, or even a List.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So whenever we have a variable based on IEnumerable and we want to do something with that (that could be using foreach, First, Average etc) we need to iterate through that variable and as a result ask the query to be executed.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:224px;width:256px;" alt="Linq to enitites Mario" src="http://dotnethints.com/admin/gallery/linq2.jpg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;h2 style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;padding-bottom:0px;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Why do we need deferred execution?&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;All right, since we know the query is not executed instantly, what would happen in the following case?&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;var&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;MarioVideogames = db.Videogames.Where(v =&amp;gt; v.MainCharacterName ==&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Mario&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;firstVideogameName = MarioVideogames.First().Name;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;lastVideogameName = MarioVideogames.Reverse().First().Name;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Sure, firstVideogameName would be &amp;quot;Super Mario Bros&amp;quot; and lastVideogameName would be &amp;quot;Super Mario Bros 2&amp;quot;. Yet, what's interesting is that we requested the database twice. First, is when we executed MarioVideogames' query to get firstVideogameName value, second in the case of lastVideogameName.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Was that a good thing? Typically, yes it is. There's no reason in requesting data before we need it. Take a look at this.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;var &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;MarioVideogames = db.Videogames.Where(v =&amp;gt; v.Name.Contains(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Mario&amp;quot;&lt;/font&gt;&lt;/span&gt;));&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(type == 1)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; MarioVideogames = MarioVideogames.Where(v =&amp;gt; v.MainCharacterName ==&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Mario&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;else if&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(type == 2)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; MarioVideogames = MarioVideogames.Where(v =&amp;gt; v.MainCharacterName ==&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Wario&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;In this case, MarioVideogames contains different data, depending on the type. Let's say, by default MarioVideogames would return 50 rows of videogames, where in case of type == 1 or type == 2, would return way less videogames. If things did not work that way, we would ask the database for these 50 rows, and after we got all of them, then we would filter out the ones who got the MainCharacterName we want. On the contrary, what happens now is we ask the database for videogames containing Mario in their Name and having specific MainCharacterName at the same time. The records we get will be the ones we actually want.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;If for any reason we did want to execute the query at a given moment and get the data into memory we may use something like ToList or ToArray method. This way, instead of a simple IEnumerable, we can create a list that is stored in memory and has no longer anything to do with the database.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;   &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;var &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;MarioVideogames = db.Videogames.Where(v =&amp;gt; v.Name.Contains(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Mario&amp;quot;&lt;/font&gt;&lt;/span&gt;)).ToList();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(type == 1)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; MarioVideogames = MarioVideogames.Where(v =&amp;gt; v.MainCharacterName == &lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Mario&amp;quot;&lt;/font&gt;&lt;/span&gt;).ToList();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;else if&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(type == 2)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; MarioVideogames = MarioVideogames.Where(v =&amp;gt; v.MainCharacterName == &lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Wario&amp;quot;&lt;/font&gt;&lt;/span&gt;).ToList();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt; &lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This time MarioVideogames will return the 50 videogames at once, and then filter out the ones we don't need.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:226px;width:260px;" alt="Linq to entities Wario" src="http://dotnethints.com/admin/gallery/linq.jpg" /&gt;&lt;/div&gt;  &lt;h2 style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;padding-bottom:0px;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;  &lt;h2 style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;padding-bottom:0px;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Does it always work?&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Now, you may wonder, why would we want to &amp;quot;deactivate&amp;quot; deferred execution? It seems to work just fine even in the following case.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;var&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;videogames = db.Videogames.Where(v =&amp;gt; v.MainCharacterName ==&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Mario&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font color="#006400"&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;"&gt;//Someone changes Super Mario Bros into Super Mario Bros 3 &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;"&gt;at this point&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;firstVideogameName = videogames.First().Name;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;lastVideogameName = videogames.Reverse().First().Name;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;If the query had already been executed before we needed it to, then firstVideogameName would be &amp;quot;Super Mario Bros&amp;quot;, which would by now be outdated. So, as you can see deferred execution works and by default we get no such problems. Unless of course you do not wish to have updated data from the moment your program starts executing.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Anyway, now here's something interesting.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;Videogame&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;firstMarioVideoGame =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;null&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;var&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;MarioVideogames = db.Videogames.Where(v =&amp;gt; v.MainCharacterName ==&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Mario&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(MarioVideogames.Any())&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font color="#006400"&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Someone removed all Mario games from the database &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;"&gt;at this point&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; firstMarioVideoGame = MarioVideogames.First();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This one would end up in a NullReferenceException and what's really bad about it, is there is no easy way of having both deferred execution and ensure that such a case will not occur at the same time.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Sure, you can handle such exceptions if you like, but the thing is you can’t always avoid inconsistency issues. For example&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;var&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;MarioVideogames = db.Videogames.Where(v =&amp;gt; v.MainCharacterName ==&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Mario&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;int&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;MarioVideogamesCounter = MarioVideogames.Count();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;//Someone removes Super Mario Bros from the database at this point&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;foreach&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;var&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;videogame&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;in&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;MarioVideogames)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160; videogameNames += videogame.Name +&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;lt;br/&amp;gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Now, the counter says we have two videogames but we see only one videogame name.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Here's another example where deferred execution is no good.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:200px;width:200px;" alt="deferred execution nintendo" src="http://dotnethints.com/admin/gallery/entity.gif" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;List&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;/font&gt;&lt;/span&gt;&amp;gt; videogameNamesList = GetVideogameNamesList();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;//videogameNamesList is a list containing videogame names&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;var&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;NintendoVideogames = db.Videogames.Where(v =&amp;gt; v.Publisher ==&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot;Nintendo&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;foreach&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;name&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;in&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;videogameNamesList)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; var&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;selectedNintendoVideogames = NintendoVideogames.Where(nv =&amp;gt; nv.Name == name);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160; //.........&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This time we request data as many times as videogameNamesList's contents are. If it consisted of one thousand strings, we would request data one thousand times.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Enumerating the query using ToList would do some good in such cases. Still, handling 50 Nintendo videogames is fine. What would you do if your database had tens of thousands of Nintendo videogames? Things would go really slow if you had to fetch fifty thousand records in order to get no more than five of them in the end.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Caching could be used to get us out of such trouble, even though there is no easy way out of this. It all depends on what you want to do, what problems may arise and how you expect your project to work.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;h2 style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;padding-bottom:0px;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Summary&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Creating a LINQ query on entity framework does not instantly get us data from the database. Instead, that will happen the moment we need them. This is called deferred execution and it helps us avoid unnecessary database requests. However this may also turn out to be more of a trouble than help so we should always keep an eye on how our queries are executed.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;Reference &lt;a href="http://dotnethints.com/blogs/deferred-execution-on-linq-to-entities"&gt;DotNetHints&lt;/a&gt;&lt;/div&gt;&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=77459" width="1" height="1"&gt;</content><author><name>k badas</name><uri>https://www.dotnetzone.gr:443/cs/members/k+badas.aspx</uri></author></entry><entry><title>Create a secure socket layer WCF service</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2015/09/27/create-a-secure-socket-layer-wcf-service.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2015/09/27/create-a-secure-socket-layer-wcf-service.aspx</id><published>2015-09-27T19:26:23Z</published><updated>2015-09-27T19:26:23Z</updated><content type="html">&lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We have already seen how to create a WCF service. This time we are going to see how to combine a WCF service with SSL security, which will be a trickier thing to do.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;To reach our goal, we need to take three steps. Step one is to create a WCF Service. Step two is to install a certificate for authentication. Step three is to bring the two first steps together. Since creating a secure socket layer for a website takes more than just a few words. I am planning on writing some future article about that. In order to apply the following methods, a reader should either already have a secure website or, if unable to wait, find a proper article since there are quite a lot out there.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Concerning WCF services&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;a style="text-decoration:;color:;" href="http://dotnethints.com/blogs/creating-an-asynchronous-select-control"&gt;&lt;font color="#67217a"&gt;&lt;font style="text-decoration:none;" face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This is the article&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;where we created a WCF service. However since this task is more complex, we will start by repeating a few things.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;To create a WCF service, we create a service (svc) file. This is where we place the code to execute when the service is requested.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The svc file may look like that&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;%@&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;ServiceHost&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Language&lt;/font&gt;&lt;/span&gt;=&amp;quot;C#&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Factory&lt;/font&gt;&lt;/span&gt;=&amp;quot;System.Data.Services.DataServiceHostFactory, Microsoft.Data.Services, Culture=neutral, PublicKeyToken=31bf3856ad364e31&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Service&lt;/font&gt;&lt;/span&gt;=&amp;quot;IceCream&amp;quot; %&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;while the code behind file contains the following source code&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;[&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;ServiceContract&lt;/font&gt;&lt;/span&gt;(Namespace =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;)]&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;[&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;AspNetCompatibilityRequirements&lt;/font&gt;&lt;/span&gt;(RequirementsMode =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;AspNetCompatibilityRequirementsMode&lt;/font&gt;&lt;/span&gt;.Allowed)]&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;public class&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#008080"&gt;IceCream&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; [&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;WebInvoke&lt;/font&gt;&lt;/span&gt;(Method =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;GET&amp;quot;&lt;/font&gt;&lt;/span&gt;, RequestFormat =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;WebMessageFormat&lt;/font&gt;&lt;/span&gt;.Json, ResponseFormat =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;WebMessageFormat&lt;/font&gt;&lt;/span&gt;.Json)]&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; [&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;OperationContract&lt;/font&gt;&lt;/span&gt;]&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public string&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;GetIceCreamFlavours()&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;This service is actually working!&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;If the service works fine, you will get the success message when requesting MyPath/IceCream.svc/GetIceCreamFlavours. If not, you will get 404 or 500 errors trying to tell you what you should fix.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Now, we need to set up our project so that the code reaches the service when it is requested. Let's edit our web.config file properly. The following code is the minimum code required for a service to work.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;system.serviceModel&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;serviceHostingEnvironment&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;aspNetCompatibilityEnabled&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;true&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;multipleSiteBindingsEnabled&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;true&amp;quot; /&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;behaviors&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;endpointBehaviors&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;behavior&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;name&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;DotNetHints.IceCream&amp;quot;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;enableWebScript&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;/&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;behavior&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;endpointBehaviors&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;behaviors&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;services&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;service&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;name&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;IceCream&amp;quot;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;endpoint&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;address&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;behaviorConfiguration&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;DotNetHints.IceCream&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;binding&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;webHttpBinding&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;contract&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;IceCream&amp;quot; /&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;service&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;services&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;system.serviceModel&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;OK, here's what we have here.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We created the system.serviceModel node and placed three extra nodes inside: serviceHostingEnvironment, behaviors and services. Let's take a look at them.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;serviceHostingEnvironment does not have much to do with where we want to get. It contains elements like aspNetCompatibilityEnabled, which control whether ASP.NET HTTP pipeline is used and non-HTTP protocols are prohibited, and multipleSiteBindingsEnabled which allows multiple IIS bindings per site.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Our key part, is the services tag. You can see in the following image how service connects all parts. However since sevices require a behavior, let's take a break and build one first. So, we create a behavior named DotNetHints.IceCream which we declare as an EndpointBehavior and place it inside the proper tag.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:440px;width:711px;" alt="HTTP service diagram" src="http://dotnethints.com/admin/gallery/WCF2.png" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Then we create our service named IceCream. Services require endpoints. Consider an endpoint as the access point for that service. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The address attribure points to the URL the service will use. Since the endpoint we created contains an empty address, requesting MyPath/IceCream.svc/GetIceCreamFlavours will cause the service to show up. Binding contains &amp;quot;webHttpBinding&amp;quot; value. This is the standard WCF method to handle HTTP requests. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The contract attribute stands for our service name on the WCF file. We can easily guess that more than one endpoint may use the same sevice.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;To connect the behavior we created with the service endpoint we use the behaviorConfiguration attribute.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;That's all we need to implement a simple WCF service. Now let's go for the secure part.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Creating a secure socket WCF service&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;img style="height:200px;width:200px;" alt="https security" src="http://dotnethints.com/admin/gallery/security.jpg" /&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We are now moving forward to step 3, which requires a secure website in order to work. To use https settings, in addition to the parts we placed on our web.config file, we have to create a custom binding. Let's create one and call it HttpsBinding&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;bindings&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;webHttpBinding&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;binding&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;name&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;HttpsBinding&amp;quot;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;security&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;mode&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;Transport&amp;quot;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;transport&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;clientCredentialType&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;None&amp;quot;/&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;security&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;binding&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;webHttpBinding&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;bindings&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;By setting security mode to Transport we enable transport security. clientCredentialType determines the messages authentication type. &amp;quot;None&amp;quot; is the simplest type and uses no authentication at all.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;A few minutes ago we created an endpoint behavior. Behaviors can be classified as endpoint or service behaviours depending on where we call them. This one being set as an endpoint attribute was classified as an endpoint behavior.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;endpoint &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;address&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;&amp;quot; &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;behaviorConfiguration&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;DotNetHints.IceCream&amp;quot; &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;binding&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;webHttpBinding&amp;quot; &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;contract&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;IceCream&amp;quot; /&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The behavior we are creating now is a service behavior.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;behaviors&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;serviceBehaviors&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;behavior&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;name&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;DotNetHints.IceCream&amp;quot;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;behavior&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;serviceBehaviors&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;behaviors&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;It’s quite similar to the one we already created. All there is left is to create the service and bring everything together. We will create the IceCream service the way we did earlier and add an extra endpoint. This endpoint's bindingConfiguration will be set to our new binding. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;services&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;service&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;name&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;IceCream&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;behaviorConfiguration&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;DotNetHints.IceCream&amp;quot;&amp;gt; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;endpoint&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;address&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;&amp;quot; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;binding&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;webHttpBinding&amp;quot; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;bindingConfiguration&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;HttpsBinding&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;contract&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;IceCream&amp;quot; /&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;endpoint&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;address&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;binding&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;webHttpBinding&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;contract&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;IceCream&amp;quot; /&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;service&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;services&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:440px;width:727px;" alt="" src="http://dotnethints.com/admin/gallery/WCF3.png" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We are ready to go. Our service supports both secure and non-secure requests. We can request MyPath/IceCream.svc/GetIceCreamFlavours using http and https supposing that our service is set correctly (and https protocol is enabled for our website). Enjoy!&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Summary&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We followed the implementation of a WCF service all the way from the beginning to the end. First we created an svc file which consists of the actual service. Then we started editing the web.config file in order to create a behavior, a binding and finally the service that will put them all together. We managed to create a service that supports both http and https requests.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;Reference &lt;a href="http://dotnethints.com/blogs/create-a-secure-socket-layer-wcf-service"&gt;DotNetHints&lt;/a&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=77273" width="1" height="1"&gt;</content><author><name>k badas</name><uri>https://www.dotnetzone.gr:443/cs/members/k+badas.aspx</uri></author></entry><entry><title>Let's talk about GUIDs</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2015/07/17/let-s-talk-about-guids.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2015/07/17/let-s-talk-about-guids.aspx</id><published>2015-07-18T06:43:07Z</published><updated>2015-07-18T06:43:07Z</updated><content type="html">&lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;I've been using GUIDs for a long time, even though I had no actual clue of what they were. Well, I did know what they were; they looked like 32 hex digit strings separated by hyphens that looked like that A1F5B524-B197-4787-A6FF-38BC0C8D2B01. And they were unique, so I knew that if I had lots of them within my database tables and inserted yet another one, that would be different from all the rest. Then, one day it came to me that it might be interesting to find out what GUIDs actually are, so I did some search.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;What is a GUID?&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;GUIDs are stored as 128-bit values but are usually displayed as 32 hexadecimal digits separated by hyphens, so they can be easier for a human to read, for example A1F5B524-B197-4787-A6FF-38BC0C8D2B01. These groups, containing 8, 4, 4, 4 and 12 hex digits respectively.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;GUIDs (that stand for Globally Unique Identifiers) are also called UUIDs (Universally Unique Identifiers). Actually UUID was the first term to show up. When Microsoft decided to use UUIDs they preferred to create the name GUID.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:170px;width:170px;" alt="guids" src="http://dotnethints.com/admin/gallery/guid1.jpg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Now, the interesting thing about GUIDs is that the value they represent is quite a large one and can take a lot of different values. Actually it may contain up to 2^128 different values and this is quite a number. It is close to 1.000.000.000... where we get 13 zero triplets. This number, being that large that makes it hard for a person even to conceive, makes it extremely hard for two random numbers to be equal. You may be creating GUIDs all the time and fail to get a single match. Practically the number of possible GUIDs is less than the one described above, since some of the 128 bits are reserved, but we'll get to that later on.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;In the meanwhile, let's take a look at a few history points.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;GUID versions&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The reason for creating GUIDs is getting an identifier that will be completely different from all the rest. You can easily tell that if I got two database tables using increasing integer numbers as primary keys and wished to concatenate them, I wouldn't be able to retain both tables' IDs. However if I had used GUIDs as primary keys I would have had no trouble at all since GUIDs in both tables are practically different. GUIDs can be found in more places than databases, including COM objects and hard drive partitioning.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;In a few words GUIDs are used so that distributed systems may possess unique identity information even if no central coordination system is present.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;GUIDs, as mentioned, stand for unique identifiers. What's bad about that, is that even if it's extremely improbable that two GUIDs are similar, you can never be completely sure about that. To ensure that, version one GUIDs were created based on two different aspects. First is the time the GUID was created, second is the MAC address of the computer that created it.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Now, that seems to work fine. You see, different computers cannot produce similar GUIDs and a single computer cannot produce similar GUIDs, so all GUIDs are bound to be different. That system might have worked fine, if it weren't for some problems in both time and space parts.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Considering time, suppose I create a GUID and then turn the machine clock back. Or suppose I had a multi-processing computer which could create GUIDs using more than one processor at the same time.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;MAC address problems also arose, such as what would happen if a person set manually the computer's MAC address or in case of a computer that had no MAC address at all. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;To avoid such problems. version one GUIDs contain extra bits (apart from the space and time created ones) that try to make things up. Still uniqueness cannot be guaranteed.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Furthermore, such GUIDs can be examined so that MAC address and time info can be extracted. And that makes people creating GUIDs no happier.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;To avoid such problems more GUID versions were created. Microsoft switched to version 4 GUIDs by default on Windows 2000 operating system and has stuck with it since then.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Version 4 GUIDs, in contrast to other versions, are created pseudo-randomly. Well, apart from some reserved bits. Let's take a look at the way GUID versions look like. This is the default GUID format:&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;On version 1 GUIDs the 13th position hex is always 1&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;xxxxxxxx-xxxx-1xxx-xxxx-xxxxxxxxxxxx&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Similarly, version 4 GUIDs, contain 4 at the same position&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;In addition, the 17th hex (represented as y) is allowed to be either 8, 9, A, or B.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;By the looks of it, the GUID we saw earlier, A1F5B524-B197-4787-A6FF-38BC0C8D2B01, is a version 4 GUID.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Earlier we mentioned that version 4 GUIDs are created pseudo-randomly. This method is used to ensure GUID uniqueness. However since the GUID sequence is pseudo-random, a person aware of generator internal state may be able to obtain previous and future GUID values.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;GUIDs and .NET&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;To create a new GUID we may use the NewGuid static method.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Guid g = Guid.NewGuid();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;NewGuid uses the Windows CoCreateGuid function. CoCreateGuid function in return calls the RPC function UuidCreate which returns a UUID (or GUID if you prefer that name). As told earlier this will be a version 4 GUID which is more or less random. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;In addition to UuidCreate there is an extra function called UuidCreateSequential. This function is used instead of UuidCreate, if you want to make sure that GUIDs created from a single machine are unique. To accomplish this, UuidCreateSequential creates version 1 GUIDs as described earlier. Since version 1 GUIDs contain the computer's MAC address info and a timestamp every GUID created is bound to be unique, compared to all other GUIDs created by that machine. And since the timestamp is set on the GUID and time always marches on every GUID created that way holds a value greater than all previous ones. This is what the term sequential on UuidCreateSequential stands for.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;By default .NET uses UuidCreate. You can use UuidCreateSequential if you'd like, but it's not as easy as the one line call to UuidCreate. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;You can also use your SQL Server to create GUIDs. In that case GUIDs are called uniqueidentifiers.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;NEWID() creates a version 4 GUID using UuuidCreate.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;NEWSEQUENTIALID creates a version 1 GUID using UuidCreateSequential.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:135px;width:180px;" alt="guid" src="http://dotnethints.com/admin/gallery/guid2.jpg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;There's one more thing to talk about. Should database tables use GUIDs as primary keys or stick to the traditional integer values? The answer is, it depends. GUIDs require four times the amount of space integers do. Indexing and fragmentation as well as joins and sorting operation are less efficient (using sequential GUIDs will make such things slightly better). They are also far from being user friendly and may make things harder for manual debugging. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Still, a person may choose GUIDs since they are overall unique and can make table or database concatenation much easier. They can also be created apart from the database thus separating project parts from each other.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;People find it hard to agree which method is better. Some say GUIDs are way cool, others think they should never be used as primary keys. Choosing your primary key style depends on what your specs are.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Summary&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;GUIDs are 128-bit values which are used to ensure unique values among distributed systems. Since there are far more than a lot possible GUIDs, each newly created GUID may be supposed to be unique. There are two GUID versions currently used by Microsoft, 1 and 4. Version 1 uses the computer MAC address and timestamp to create a GUID while use 4 uses pseudo-random algorithms.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;Reference &lt;a href="http://dotnethints.com/blogs/let-s-talk-about-guids"&gt;DotNetHints&lt;/a&gt;&lt;/div&gt;&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=77139" width="1" height="1"&gt;</content><author><name>k badas</name><uri>https://www.dotnetzone.gr:443/cs/members/k+badas.aspx</uri></author></entry><entry><title>Use your routing system to create a multilingual web forms project</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2015/05/13/use-your-routing-system-to-create-a-multilingual-web-forms-project.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2015/05/13/use-your-routing-system-to-create-a-multilingual-web-forms-project.aspx</id><published>2015-05-13T07:18:31Z</published><updated>2015-05-13T07:18:31Z</updated><content type="html">&lt;div class="print" style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;float:right;color:;margin:0px 10px;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;/div&gt;  &lt;div class="sendToAFriend" style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;float:right;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;   &lt;div id="accordion" class="ui-accordion ui-widget ui-helper-reset" style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;/div&gt; &lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;   &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;In a&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;u&gt;&lt;a style="text-decoration:;color:;" href="http://dotnethints.com/blogs/multiple-language-website"&gt;&lt;font color="#67217a"&gt;&lt;font style="text-decoration:none;"&gt;previous article&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/u&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;we talked about multilingual sites. This time we are going to see how we can place that info in the page URL, using ASP.NET's routing system, and create this way an entirely different version of a website, depending on the language selected.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Why, you may ask, would I choose Web Forms to do this instead of using MVC's way better routing system? Well, no matter how deprecated Web Forms may become, websites based on that will still remain out there for a long time, so it may still be useful to some. And, after all, no matter what they look like right now, who doesn't like reading stuff concerning Web Forms?&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;h2 style="padding-bottom:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Why messing with the URL?&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;To begin with, what we're talking about is not storing the info in the query string; instead we’ll try out the actual URL body. Actually, language info could as well be stored using cookies or other means. What do we get by using this&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;MyWebsite/en/contact.aspx&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;instead of &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;MyWebsite/contact.aspx?lang=en&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;or simply store language on some cookie and use&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;MyWebsite/contact.aspx&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The main reason for doing so, is SEO. Cookies have nothing to do with SEO, so using them is not a good choice. Storing parameters (language or anything else) in the query string is better than cookies but still not as good as storing info right inside the URL file path. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;You may of course use different hosts to achieve that (eg MyWebsite.en or en.MyWebsite) which is ok as well. However this is a whole new story which is totally up to you to choose. What we’re talking about here requires nothing more than a single host.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;You may also read for yourself Google's point of view concerning multilingual sites&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;u&gt;&lt;a style="text-decoration:;color:;" href="https://support.google.com/webmasters/bin/answer.py?hl=en&amp;amp;answer=182192#1"&gt;&lt;font color="#67217a"&gt;&lt;font style="text-decoration:none;"&gt;here&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/u&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;img style="height:174px;width:174px;" alt="multi-language site" src="http://dotnethints.com/admin/gallery/multi-language.jpg" /&gt;&lt;/div&gt;    &lt;h2 style="padding-bottom:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Creating routes&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Before moving on to the main part of the article we are going to take a look at the basics of the web forms routing system. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;By default, Web Forms use file system request handling. The MyWebsite/contact.aspx request searches for the contact.aspx file located under the root menu. MyWebsite/superheroes/superheroes.aspx should look for the superheroes.aspx file located inside the superheroes file under the root menu.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Using the global.asax file we may add our own handling. All we need is to call a method, having a RouteCollection parameter, from within the Application_Start method. So let's create a method called RegisterRoutes and place it within a new file called MyRouteConfig.cs.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;private void&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;Application_Start(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;object&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;sender,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;EventArgs&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;e) &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;MyRouteConfig&lt;/font&gt;&lt;/span&gt;.RegisterRoutes(&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;RouteTable&lt;/font&gt;&lt;/span&gt;.Routes);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;     &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;public static class&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#008080"&gt;MyRouteConfig&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;      &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;   &lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font color="#0000cd"&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;public static &lt;/span&gt;&lt;span style="color:;"&gt;void &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size:10.5pt;"&gt;RegisterRoutes(&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;RouteCollection&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;routes)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Things that change the way routing system works should be placed here. For example, in order to use friendly urls (getting the same result as MyWebsite/contact.aspx when you request MyWebsite/contact) your RegisterRoutes method should look like&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;private void &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;RegisterRoutes(&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;RouteCollection &lt;/font&gt;&lt;/span&gt;routes)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; routes.EnableFriendlyUrls();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;} &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;To make it work, add references to Microsoft.AspNet.FriendlyUrls and System.Web.Routing. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Now let's check out one more thing. Let's say, you had a page called superheroes.aspx where the superhero id was placed inside the query string superhoeroes.aspx?id=2 and then you got it's value from within your page using Request.QueryString[&amp;quot;id&amp;quot;].&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Instead we could use a friendlier method and replace superhoeroes.aspx?id=2 with superhero/ironman or superhero/hulk.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;By default this would search for the ironman folder under the superhero folder&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;However we could add the following line in our RegisterRoutes method&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;routes.MapPageRoute(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;superheroes&amp;quot;&lt;/font&gt;&lt;/span&gt;, &lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;superhero/{SuperheroName}&amp;quot;&lt;/font&gt;&lt;/span&gt;,&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt; &amp;quot;~/superheroes.aspx&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The simplest instance of MapPageRoute requires three arguments.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;1) A string as the route's name.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;2) The URL the route will handle.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;3) The physical file the route will point to.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Using the route we created, if we get a superhero/hulk request, this will redirect to the superheroes.aspx file.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Within the page code we may get the superhero name using Page.RouteData.Values[&amp;quot;SuperheroName&amp;quot;]).&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;img style="height:141px;width:170px;" alt="hulk-homer-avengers" src="http://dotnethints.com/admin/gallery/Hulk_Homer.PNG" /&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;In case of superhero/hulk, Page.RouteData.Values[&amp;quot;SuperheroName&amp;quot;] would result in &amp;quot;hulk&amp;quot;. Always pay attention to null values.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Now, let's move on and see how the concept described can be applied to more than one language. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;h2 style="padding-bottom:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Adding the language&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;To add a language identifier we need an extra route that will point us to a new handler we will create.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;routes.Add(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;System.Web.Routing.Route(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;{language}/{*page}&amp;quot;&lt;/font&gt;&lt;/span&gt;,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;LanguageRouteHandler&lt;/font&gt;&lt;/span&gt;()));&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This is the route we need. Now let's take care of the handler. We are going to create the LanguageRouteHandler class implementing the IRouteHandler interface. This requires creating a GetHttpHandler method that returns an IHttpHandler object. Here's what we have so far.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;public class&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;LanguageRouteHandler&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;:&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#008080"&gt;IRouteHandler&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;IHttpHandler&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;GetHttpHandler(&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;RequestContext&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;requestContext)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;page = CheckForNullValue(requestContext.RouteData.Values[&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;page&amp;quot;&lt;/font&gt;&lt;/span&gt;]);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;virtualPath =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;~/&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;+ page;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; try&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;BuildManager&lt;/font&gt;&lt;/span&gt;.CreateInstanceFromVirtualPath(virtualPath,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;typeof&lt;/font&gt;&lt;/span&gt;(&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Page&lt;/font&gt;&lt;/span&gt;)) as&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;IHttpHandler&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; catch&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return null&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Seems nice. So, how does it work?&amp;#160; Let's say we request the contact page. English is our default language. So requesting MyWebsite/contact would request the contact page (based on the previous part routing system) as if we had never created our handler.&amp;#160; That is because our handler searches for {language}/{*page} and&amp;#160; &amp;quot;contact&amp;quot; does not match this. We could have used MyWebsite/en/contact as well, and treat English as any other language; however default language usually needs no language identifier.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Don't forget to add references to System.Web, System.Web.UI, and System.Web.Compilation.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Now it's time to activate our handler. Request MyWebsite/el/contact.aspx. This request matches the route we created and will use the GetHttpHandler of our new class. Our page variable will be equal to &amp;quot;contact.aspx&amp;quot;. However we should add a tilde (~) to it as CreateInstanceFromVirtualPath needs absolute paths to work properly. CreateInstanceFromVirtualPath will return an IHttpHandler object and things will work just fine.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;CheckForNullValue is a simple custom method that returns a string, taking care of null values instances.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Whenever we need to get that language info, we may use Page.RouteData.Values[&amp;quot;language&amp;quot;]), the same way we did earlier.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;quot;el&amp;quot; refers to the Greek language. As a matter of fact I could have used any possible name eg MyWebsite/DotNetHintsRocks/contact.aspx as long as the &amp;quot;DotNetHintsRocks&amp;quot; string is a reference to a language, according to my personal language dictionary. Search engines however, would prefer spotting &amp;quot;en&amp;quot; or &amp;quot;el&amp;quot; on my URL instead of &amp;quot;DotNetHintsRocks&amp;quot;.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;That's the basic part. We have easily created a multilingual site. However there are still a few more things to do before it is completed.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;For example MyWebsite/contact will route to MyWebsite/contact.aspx. Still, LanguageRouteHandler will not be able to redirect LanguageRouteHandler MyWebsite/el/contact. It will do its best using CreateInstanceFromVirtualPath but inevitably will get an HttpException stating &amp;quot;The file '/contact' does not exist.&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;To avoid this we could add some extra code to handle such requests, for example&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;if&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(!virtualPath.Contains(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;.aspx&amp;quot;&lt;/font&gt;&lt;/span&gt;))&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; virtualPath +=&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;.aspx&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Using that code, virtual path will be turned into &amp;quot;contact.aspx&amp;quot;, a file name which does exists. This is a custom solution that may prove nice depending on your case.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Let's see a few more custom solutions.&amp;#160; Supposing MyWebsite/ shows home.aspx content. What would MyWebsite/el do? VirtualPath is going to become &amp;quot;~/.aspx&amp;quot; and since there is no such file we will get another exception.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;There are two ways to avoid this. Either you redirect to your actual page, or you route to that page.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;if&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;/font&gt;&lt;/span&gt;.IsNullOrEmpty(page))&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string &lt;/font&gt;&lt;/span&gt;language= CheckForNullValue(requestContext.RouteData.Values[&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;language&amp;quot;&lt;/font&gt;&lt;/span&gt;]);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;newPage =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;/home&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;if&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;(!&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;/font&gt;&lt;/span&gt;.IsNullOrEmpty(language))&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; newPage =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;/&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;+ language + newPage;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;HttpContext&lt;/font&gt;&lt;/span&gt;.Current.Response.Redirect(newPage,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;false&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;HttpContext&lt;/font&gt;&lt;/span&gt;.Current.Response.StatusCode = 301;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;HttpContext&lt;/font&gt;&lt;/span&gt;.Current.Response.End();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Otherwise, we simply route to home&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //page = &amp;quot;home&amp;quot;;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Finally, remember that superhero/hulk route we have created? We used&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;routes.MapPageRoute(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;superheroes&amp;quot;&lt;/font&gt;&lt;/span&gt;, &lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;superhero/{SuperheroName}&amp;quot;&lt;/font&gt;&lt;/span&gt;,&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt; &amp;quot;~/superheroes.aspx&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;to make it work. In order to add the language info we should put some extra route underneath. That would be&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;routes.MapPageRoute(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;languageSuperheroes&amp;quot;&lt;/font&gt;&lt;/span&gt;,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;{language}/superhero/{SuperheroName}&amp;quot;&lt;/font&gt;&lt;/span&gt;,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;~/superheroes.aspx&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;img style="height:133px;width:200px;" alt="languages-website" src="http://dotnethints.com/admin/gallery/world-languages.jpg" /&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;In case you'd like to see the whole picture, here's what the complete source code would look like. First the global.asax file:&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;     &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;       &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;%&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;@&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span style="color:;"&gt;&lt;font color="#a52a2a"&gt;Application &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;Language&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;C#&amp;quot;&lt;/font&gt;&lt;/span&gt; %&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#a52a2a"&gt;script &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;runat&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;server&amp;quot;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;         &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; private void &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;Application_Start(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;object &lt;/font&gt;&lt;/span&gt;sender, &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;EventArgs &lt;/font&gt;&lt;/span&gt;e) &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;          &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;          &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;MyRouteConfig&lt;/font&gt;&lt;/span&gt;.RegisterRoutes(&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;RouteTable&lt;/font&gt;&lt;/span&gt;.Routes);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;          &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;          &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;       &lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#a52a2a"&gt;script&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;     &lt;/div&gt;      &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;      &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;       &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Then the MyRouteConfig.cs file&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;     &lt;/div&gt;      &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;      &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;       &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;using&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;System;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;using &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;Microsoft.AspNet.FriendlyUrls;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;using &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;System.Web.Routing;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;using &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;System.Web;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;using &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;System.Web.UI;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;using &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;System.Web.Compilation;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;public static class&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#008080"&gt;MyRouteConfig&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;     &lt;/div&gt;      &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;       &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font color="#0000cd"&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;public static &lt;/span&gt;&lt;span style="color:;"&gt;void &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size:10.5pt;"&gt;RegisterRoutes(&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;RouteCollection &lt;/font&gt;&lt;/span&gt;routes)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; routes.EnableFriendlyUrls();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; routes.MapPageRoute(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;superheroes&amp;quot;&lt;/font&gt;&lt;/span&gt;, &lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;superhero/{SuperheroName}&amp;quot;&lt;/font&gt;&lt;/span&gt;,&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt; &amp;quot;~/superheroes.aspx&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; routes.MapPageRoute(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;languageSuperheroes&amp;quot;&lt;/font&gt;&lt;/span&gt;, &lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;{language}/superhero/{SuperheroName}&amp;quot;&lt;/font&gt;&lt;/span&gt;, &lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;~/superheroes.aspx&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; routes.Add(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;System.Web.Routing.Route(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;{language}/{*page}&amp;quot;&lt;/font&gt;&lt;/span&gt;, &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;LanguageRouteHandler&lt;/font&gt;&lt;/span&gt;()));&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160; } &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;     &lt;/div&gt;      &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;      &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;      &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;      &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;       &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; public class&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;LanguageRouteHandler &lt;/font&gt;&lt;/span&gt;: &lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#008080"&gt;IRouteHandler&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;IHttpHandler &lt;/font&gt;&lt;/span&gt;GetHttpHandler(&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;RequestContext &lt;/font&gt;&lt;/span&gt;requestContext)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string &lt;/font&gt;&lt;/span&gt;page = CheckForNullValue(requestContext.RouteData.Values[&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;page&amp;quot;&lt;/font&gt;&lt;/span&gt;]);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string &lt;/font&gt;&lt;/span&gt;virtualPath = &lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;~/&amp;quot;&lt;/font&gt;&lt;/span&gt; + page;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;if &lt;/font&gt;&lt;/span&gt;(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;/font&gt;&lt;/span&gt;.IsNullOrEmpty(page))&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string &lt;/font&gt;&lt;/span&gt;language= CheckForNullValue(requestContext.RouteData.Values[&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;language&amp;quot;&lt;/font&gt;&lt;/span&gt;]);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string &lt;/font&gt;&lt;/span&gt;newPage = &lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;/home&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;if &lt;/font&gt;&lt;/span&gt;(!&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;/font&gt;&lt;/span&gt;.IsNullOrEmpty(language))&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; newPage = &lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;/&amp;quot; &lt;/font&gt;&lt;/span&gt;+ language + newPage;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;HttpContext&lt;/font&gt;&lt;/span&gt;.Current.Response.Redirect(newPage, &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;false&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;HttpContext&lt;/font&gt;&lt;/span&gt;.Current.Response.StatusCode = 301;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;HttpContext&lt;/font&gt;&lt;/span&gt;.Current.Response.End();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Otherwise, route to home&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //page = &amp;quot;home&amp;quot;;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;         &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(!virtualPath.Contains(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;.aspx&amp;quot;&lt;/font&gt;&lt;/span&gt;))&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;          &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; virtualPath += &lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;.aspx&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;       &lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; try&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;BuildManager&lt;/font&gt;&lt;/span&gt;.CreateInstanceFromVirtualPath(virtualPath, &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;typeof&lt;/font&gt;&lt;/span&gt;(&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Page&lt;/font&gt;&lt;/span&gt;)) as &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;IHttpHandler&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; catch&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return null&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;        &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;     &lt;/div&gt;      &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;      &lt;h2 style="padding-bottom:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Pay attention&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;      &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;      &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Keep in mind that there may be more things that could be irritating in your website's case. For example, our new handler might receive more requests than expected. A request for images/superheroes/hulk.jpg may enter our handler using &amp;quot;images&amp;quot; as our language and &amp;quot;superheroes/hulk.jpg&amp;quot; as page. In fact you should pay extra attention when turning a website from one to many languages support. There may be more routes that need to be specified or source code to be written in order to handle uncommon situations.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;      &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;      &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;A few things that you should watch out are the literals or the URLs that will be created. Apart from that, ensure that you get no SEO issues which is quite common to show up.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;      &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;      &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Needless to say, that techniques described above can be applied to situations totally different than the language issue we've been talking about.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;      &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;      &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;      &lt;h2 style="padding-bottom:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Summary&lt;/font&gt;&lt;/font&gt;&lt;/h2&gt;      &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Placing the website's language info inside your URL is a good thing to do. In order to get to this, we said a few things concerning ASP.NET's routing system and how we can use it to create &amp;quot;better&amp;quot; URLs. Then we described how to create a custom handler that can use the language info and create a multilingual website.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;      &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&amp;#160;&lt;/div&gt;   &lt;/div&gt; &lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;Reference &lt;a href="http://dotnethints.com/blogs/localization-using-routing-system-on-a-web-forms-project-"&gt;DotNetHints&lt;/a&gt;&lt;/div&gt;&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=77063" width="1" height="1"&gt;</content><author><name>k badas</name><uri>https://www.dotnetzone.gr:443/cs/members/k+badas.aspx</uri></author></entry><entry><title>5+1 questions concerning strings you never had the time to answer</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2015/03/29/5-1-questions-concerning-strings-you-never-had-the-time-to-answer.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2015/03/29/5-1-questions-concerning-strings-you-never-had-the-time-to-answer.aspx</id><published>2015-03-29T18:57:01Z</published><updated>2015-03-29T18:57:01Z</updated><content type="html">&lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Many times I've found myself working on a project while questions concerning code efficiency or why some things were made this way, pop up all around. Since project deadlines are usually more important than my questions, I always end up forgetting the questions I had. To end this, I decided to mark them down, so I can check them out later on. As a result I wrote this article about strings concerning six interesting topics which I think many others might find interesting as well.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;String.Empty VS empty string&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This issue is quite common to be found even in code created by the same group. For example, there probably is a place around the source code where str = &amp;quot;&amp;quot; shows up and another one (probably not written by the same person) where str = String.Empty shows up. My remark concerning the person who wrote those lines was meant, as each developer seems to like either the first or the second way best. If so, is there any difference between these two methods?&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;To begin with String.Empty returns an empty string. You get &amp;quot;&amp;quot;; the same value as that of the empty string. Nothing more, nothing less. String.Empty contains no secrets.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Empty is a static field located on the String class. All it does is return a zero-length (empty) string. On the other hand using empty string (&amp;quot;&amp;quot;) will create a new string object. So this is pretty much all there is about that. They are both about the same speed; however empty string creates a new object. So, how bad could this be?&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Actually not that bad at all since .NET supports string interning. In case you haven't heard of string interning before, the CLR creates a table, called the intern pool. Each unique string that is declared or created, places a reference to that table. So, when a new string variable, containing an already created value, is created it gets the reference from the intern pool. And since &amp;quot;&amp;quot; is quite a common string it's really no big deal.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So there is no actual resource issue whether you use String.Empty or empty string. It's up to you to pick the one you like. People have claimed that &amp;quot;&amp;quot; can get easily confused with &amp;quot; &amp;quot; or that String.Empty does not look like a string value at first sight, when you are searching all over your source code. Personally I'd choose the empty string, but that's because this is what I am used to and nothing more. So, it's all up to you.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:181px;width:200px;" alt="string questions" src="http://dotnethints.com/admin/gallery/question.jpg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;String.IsNullOrEmpty&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;IsNUllOrEmpty is a widely used static method located in the System.String library. Everyone knows what this method does. It returns true if the given string is null or its value is Empty, otherwise it returns false. String.IsNullOrEmpty is a great choice to let you know if a string contains a value and can be of use to your algorithm. Over the years I've heard of people claiming that String.IsNullOrEmpty is optimized and produces much faster results than custom created code and others claiming that there is no difference between using that or (str == null || str == &amp;quot;&amp;quot;). So, let's see what's really going on.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;String.IsNullOrEmpty(str) is actually the same as&amp;#160; (str == null || str.Length == 0).&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;First thing to notice is that str.Length == 0 is faster than str == &amp;quot;&amp;quot;. That is because Length == 0 simply gets the Length property of the string and compares it to 0, in contrast to == which uses the Equals method and therefore significant more instructions than those (actually more instructions than the whole of String.IsNullOrEmpty method). So String.IsNullOrEmpty(str) is faster than (str == null || str == &amp;quot;&amp;quot;).&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;OK, comparison&amp;#160; to empty string is out of the question. Now what about comparing to null or checking only the Length property? As mentioned, String.IsNullOrEmpty performs both null comparison and zero length comparison. As a result null comparison or zero length comparison alone, are indeed faster than String.IsNullOrEmpty. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So, what about next time a friend of yours tells you to use str == null for the reason of checking against null only, instead of String.IsNullOrEmpty(str) as this will be faster? Well, he is right. It takes less time. Actually slightly less time. The amount of time it takes for the or operator to take effect. In other words, it's as if comparing&amp;#160; str == null to str == null || str.Length == 0.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The same thing applies if you want to test against empty string only. str.Length is faster, but it will be of no help against a string that is null and will throw NullReferenceException.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;To sum up with, if you want to check for null, or check for empty string alone you may use your own conditions. The same applies if you want to use both for null and empty as the result will be the same, but in that case, why not using the default method? Anyway it is up to you if you want use str == null, str.Length == 0 or String.IsNullOrEmpty(str). There are many people who think it is better to use the same method all around, others who trust String.IsNullOrEmpty is an easier way for a human being to understnd what is going on just a glimpse and others who think&amp;#160; String.IsNullOrEmpty will save you from random exceptions when some unexpected null string will appear. So, it's all up to you to decide.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;string VS String&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;In order to create a string we can use&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;s = &amp;quot;&amp;quot; or&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;String&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;s = &amp;quot;&amp;quot;. Even though both will end up in creating the same string, is there some actual reason to pick one of them?&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;String is a class located on the System library. system is an alias for that keyword, meaning that either way you choose to write your code the compiled code will return System.String in the end.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So, if string is the same as String, why do both of them exist? Well, except for string, C# includes a few more aliases such as int to Int32 and bool to Boolean. Such aliases have been created in order to give C# its own style but people have argued whether it is good thing. Some said that C# should only allow developers use aliases and not primitive types in order to avoid mixing them up, others that they simply get confused by them eg not sure if int refers to Int32 or Int64 types. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Anyway, aliases do exist and the typical way to use them is to use the alias when referring to an object of that type and the actual class when using an attribute of the class. For example we use&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;s =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;String&lt;/font&gt;&lt;/span&gt;.Format(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;string vs {0}&amp;quot;&lt;/font&gt;&lt;/span&gt;,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;String&amp;quot;&lt;/font&gt;&lt;/span&gt;). &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Strings are reference types&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Strings are indeed reference types, yet there's something strange about that as they look alike a value type more than a reference type. (If you would like to know more concerning value and reference types before moving on you may refer to an&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;a style="text-decoration:;color:;" href="http://dotnethints.com/blog?id=17"&gt;&lt;font color="#67217a"&gt;&lt;font face="Segoe UI"&gt;&lt;span class="Apple-converted-space"&gt;&lt;font style="text-decoration:none;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;font style="text-decoration:none;"&gt;older article&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/font&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;.)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;For example&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;bool&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;IntsAreEqual(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;a,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;b)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(a == b)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return true&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; else &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#0000cd"&gt;&lt;span style="color:;"&gt;return &lt;/span&gt;&lt;span style="color:;"&gt;false&lt;/span&gt;&lt;/font&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This methods returns true if a = 5 and b = 5. However&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;bool&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;ClassesAreEqual(&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;RandomClass&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;a,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;RandomClass&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;b)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;   &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(a == b)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return true&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; else &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;    &lt;div style="border-top:red 0px solid;border-right:red 0px solid;border-bottom:red 0px solid;border-left:red 0px solid;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#0000cd"&gt;&lt;span style="color:;"&gt;return &lt;/span&gt;&lt;span style="color:;"&gt;false&lt;/span&gt;&lt;/font&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt; &lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This method returns true if a and b refer to the same place on the heap no matter what the values contained look like.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Since string comparison&amp;#160; str1 == str2 looks like the first method, string seems to look like a value type.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Similar, when initializing a new string using an already existing one eg&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;string str1 = str2; &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;str1 does not get a reference to the str2 memory space on the heap. On the contrary it creates its own partition on the heap, much like a value type would do.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Actually string is a unique type that should have been a value type since we do wish to have value type features. However, on the contrary to other value types, string is not a standard size type. Int32 requires four bytes to be stored. The string &amp;quot;Answer to life the universe and everything&amp;quot; requires far greater memory size than &amp;quot;42&amp;quot; (even though they may refer to the same thing). A string size may be enormous, thus not only causing trouble to the stack proper functioning, it may even not be able to fit in at all.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So, strings had to be placed on the stack. However they also had to maintain some of their fellow value types' characteristics. Developers would not be happy if they had to use some value comparing method in order to get simple string comparison. So what .NET architects did was to overload basic operators, for example == and != so that they work alike value types in case of strings.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;In the same way, special rules apply when a new string, based on a previous one, is created. This will not create a reference to the old string's heap position, but as described earlier create a brand new reference type.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;At the end of the day, a developer may actually state that strings are reference types having value type features, because that's what they were created for.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Strings are immutable&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Well, most people know that. Strings are immutable, meaning that when a string value is created on the heap, this value is never supposed to change.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So what actually happens when we write &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;str =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot; valar morghulis -&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;str +=&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot; All men must die.&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Creating the string str, we create the reference on the stack and store the value on the heap. Adding another string to the one we have already created does not change the stored value. Instead, it gets the stored value, adds the new value and stores it on a new block on the heap where the previous stack reference now points. The previous block on the heap remains intact, waiting for the garbage collector to remove it.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:161px;width:313px;" alt="got" src="http://dotnethints.com/admin/gallery/got.jpg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So, strings are reference types that are immutable. The question is, why is that? Why is being immutable a good thing, and, if so, why do other reference types are mutable?&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;One part of the answer lies on the essence of string type. Strings on .NET are supposed to hold their values. Developers who wish to have easily mutable strings may use the StringBuilder class instead. As an example, if I create the string &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;string &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;myName =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Kostas&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;then well, that's my name&amp;#160; and there's no point in changing that. Of course you may object saying that you've written thousands of source code lines containing strings that change all the time so that can't be so. And you may be right; I'm not saying that every string created which is bound to value changes should be replaced by StringBuilders. Choosing between string and StringBuilder we will talk about later on. Just keep in mind that if strings were mutable then there would be no need for StringBuilders. Strings are meant to be mostly readable; not editable.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Considering that, suppose you have &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;myName = MyName;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;myName now holds the value of MyName but not it's reference. If strings were not immutable and while using myName an external action changed MyName's value, then that should change myName's value as well. Not a good thing as myName might have already gone half the method's way before changed. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;A string could also be set as an argument to a method call. If it were a standard reference type, the method could be able to change the argument string's value. We would probably want to keep that string's value as it was before calling the method (since as we mentioned strings are mostly readable) so such an edit would be no good. Of course we could use the ref keyword if we did wish to change the string's value from within the method.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We have already mentioned string interning. Using techniques like that helps so string immutability is by far faster, when creating new strings, than expected at first. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;There is another yet important reason for that. Strings are not standard size variables, When a string is created it reserves memory space on the heap equal to its initial size. Supposing that before modifying the string value, more variables are created and extra heap space has been reserved, what would happen if we wanted to increase the string size? Would we rearrange everything on the heap just to update the string value? Actually no, it would have been easier to create a new value on top.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Of course there are ways to change all those immutable strings' values. That would be using reflection or pointers. The thing is not that you cannot change an already created string value, rather than since this is not the proper way to deal with strings, this is also not the straight forward way to change one.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Since string's immutable aspect is much based on personal opinions, those who are interested in learning more stuff will find a great deal of info online.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;String concatenation&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Since strings are immutable, creating a new string by adding two existing ones would not seem to be the most effective way. Some people use String.Concat instead. Others use the StringBuilder class. Let's take a look at them all and find out which one actually works best.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Adding strings will end up, behind the scenes, on using String.Concat.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;string &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;str1 =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Never send a human &amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;string &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;str2 =&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot; to do a machine's job&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;string &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;str = str1 + str2;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;is the same as &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;str =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;String&lt;/font&gt;&lt;/span&gt;.Concat(str1, str2);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So, there is no point on which one you choose. However when you add non-variable strings eg&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;string &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;str =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Never send a human &amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;+&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot; to do a machine's job&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;compiler will automatically replace it with &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;string &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;str = &lt;font color="#b22222"&gt;&lt;span style="color:;"&gt;&amp;quot;Never send a human&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:;"&gt;to do a machine's job&amp;quot;&lt;/span&gt;&lt;/font&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;which is faster than using String.Concat&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So, using the add operator is faster when adding non variable strings, but it's quite the same in all other cases. As a result using the + operator VS String.Concat can be of your personal choice, as Concat method seems to have no actual good points apart from being supported by a great deal of programming languages.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:200px;width:168px;" alt="" src="http://dotnethints.com/admin/gallery/Matrix.jpg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Moving on to StringBuilder. StringBuilder is supposed to optimize string modification. However should we always use the StringBuilder instead of concatenating strings? To answer that we should first find out how StringBuilders work.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;When a string is created, it takes up memory space on the heap equal to its size. On the other hand when a StringBuilder object is created, it reserves extra space so it can support possible string modifications. Now, suppose we add extra characters to the StringBuilder. Should the new StringBuilder not surpass the current memory size, the new value is simply stored where the previous one was. However, if it does, new heap memory is allocated and the StringBuilder's capacity is doubled. Capacity is the property which returns the number of characters current StringBuilder can take. Default value is 16; however if you know the size will get much larger, you can set your own value on initialization or later on.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So, StringBuilder is indeed built to avoid creating new strings all the time. In that case should we always use StringBuilder when we know our strings are bound to changes?&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Well, the answer is no. You see even though StringBuilder seems much more flexible, creating a StringBuilder object takes more time and resources than creating a simple string. So, in order to accomplish a few string concatenations, String.Concat() or the + operator will do much better. As&amp;#160; a result when you know your code contains fixed or small number of string modifications, stick to the string path, otherwise go for StringBuilder.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;An extra reason to choose string instead of StringBuilder is the fact that String contains a few extra methods (eg IndexOf, StartsWith etc) which are absent from StringBuider. In that case you may chose to drop the performance boost you would otherwise get. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;Reference &lt;a href="http://dotnethints.com/blog?id=56"&gt;DotNetHints&lt;/a&gt;&lt;/div&gt;&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=76849" width="1" height="1"&gt;</content><author><name>k badas</name><uri>https://www.dotnetzone.gr:443/cs/members/k+badas.aspx</uri></author></entry><entry><title>Stress test your website</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2015/02/26/stress-test-your-website.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2015/02/26/stress-test-your-website.aspx</id><published>2015-02-27T04:31:49Z</published><updated>2015-02-27T04:31:49Z</updated><content type="html">&lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Publishing a website is always a pleasant thing to do. However there may be times you guess your website works fine but things will go bad later on. That may be the time the website starts gathering a lot of visitors, much more than the few users that have been testing it before deployment. At that point a few requests on the database or less optimized source code might not look that bad but when a few hundred visitors or more roam around your website at the same time, things may start looking gloomy.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;That may be either the result of poor server hardware or slow connection between the server and the database or lousy source code or, well, pretty much anything. Things tend to go bad under pressure. To avoid unpleasant surprises a developer may create stress tests using Visual Studio so he can foresee what may happen in future and fortify the website as soon as possible. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Getting started&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So, what is a stress test? A stress test simulates a bunch of users moving around our website, the way average visitors would, and marking down its reaction to them. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;To begin with, we are taking a walk around the website and record its track. Then we create the test using the options we like, for example how many users will be simulated, how long the test will last, the browser type the visitors are using etc. After we are all set, we run the test and watch the reports created before us describing the website's behaviour.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Seems quite simple. Now let's check it out, step by step, and create a stress test of our own. Keep in mind that this article is nothing more than an introduction to stress tests. Readers who wish to become stress test professionals will find much more info around the web.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Creating a web test&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We are going to create a stress test using Visual Studio 2013 Ultimate.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Go to Files -&amp;gt; New Project and choose Web Performance and Load Test Project having selected Visual C# -&amp;gt; Test on the templates column.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Right click the project we just created and select Add -&amp;gt; Web Performance Test.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This will automatically open our Internet Explorer and the Web Test Recorder on its left column. All you have to do now is go to your website and do what you think the average visitor would do. If, for example, you think that creating an account is quite a common thing to happen by lots of people simultaneously, go for it. If not, you'd better avoid it. You can see the path you have created on the Web Test Recorder.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:325px;width:700px;" alt="load test duration" src="http://dotnethints.com/admin/gallery/loadtest12.jpg" /&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;When you feel like it, push the stop button to terminate the recording process. This will create a WebTest file on your project.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Creating a load test&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So far we have created a web test, where we have recorded what we want to test. To test it we will have to create a load test.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Right click the project and select Add -&amp;gt; Load Test. A wizard will appear which will guide you through the process. You may select the preferences you wish. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:303px;width:500px;" alt="load test wizard" src="http://dotnethints.com/admin/gallery/loadtest1.jpg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;For example, you can set the load pattern, how many users will visit your website, if they will take step load actions and what options these steps will have.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:303px;width:500px;" alt="load test pattern" src="http://dotnethints.com/admin/gallery/loadtest2.jpg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;You may also add more than one web test to the load test.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:304px;width:500px;" alt="load test more" src="http://dotnethints.com/admin/gallery/loadtest3.jpg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;There are a lot of options including warm up and actual test duration.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:302px;width:500px;" alt="load test duration" src="http://dotnethints.com/admin/gallery/loadtest4.jpg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Running the test&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;You can run the load test using your own machines but using cloud-based load testing would be easier. You will however need to have a Visual Studio online account which is really no big deal. All you have to do is visit&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;a style="text-decoration:;color:;" href="http://go.microsoft.com/fwlink/?LinkId=307137"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#67217a"&gt;&lt;font style="text-decoration:none;"&gt;this location&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;and create your account for free. Then use your account info on the visual studio and you are ready to go.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:166px;width:200px;" alt="load test duration" src="http://dotnethints.com/admin/gallery/loadtest7.jpg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;To run the test, select the load test you like and press the test icon on the top left side of the screen. It will take a few moments for visual studio to set up its resources and the test to begin. Once it starts, you can see the way your website responds right on your screen.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:193px;width:350px;" alt="load test duration" src="http://dotnethints.com/admin/gallery/loadtest5.jpg" /&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;img style="height:188px;width:350px;" alt="load test duration" src="http://dotnethints.com/admin/gallery/loadtest6.jpg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:192px;width:350px;" alt="load test duration" src="http://dotnethints.com/admin/gallery/loadtest10.jpg" /&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;img style="height:190px;width:350px;" alt="load test duration" src="http://dotnethints.com/admin/gallery/loadtest11.jpg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;When it's all over you can get some nice reports and graphs.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:269px;width:500px;" alt="load test duration" src="http://dotnethints.com/admin/gallery/loadtest8.jpg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Summary&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;To test a website under pressure, we create stress tests. That way we can simulate how the website will respond when a lot of users come around at the same time. First we mark down the typical user behaviour and then we set the test parameters. When we are ready, we run the test and watch the results created on run time. We can avoid unnecessary trouble by using cloud-based testing through visual studio account.&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;Reference &lt;a href="http://dotnethints.com/blog?id=55"&gt;DotNetHints&lt;/a&gt;&lt;/div&gt;&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=76597" width="1" height="1"&gt;</content><author><name>k badas</name><uri>https://www.dotnetzone.gr:443/cs/members/k+badas.aspx</uri></author></entry><entry><title>Creating an asynchronous select control</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2014/12/22/creating-an-asynchronous-select-control.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2014/12/22/creating-an-asynchronous-select-control.aspx</id><published>2014-12-23T04:33:09Z</published><updated>2014-12-23T04:33:09Z</updated><content type="html">&lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Everyone knows the basic select element that is the HTML equivalent to .NET's DropDownList control. Imagine an HTML select containing one hundred or more elements. This would take much time to send and much HTML text to keep your data. Let alone SEO issues that might occur. Instead, data could be filled asynchronously when user activated the control or asked for it using a WCF service leading to far better results. To accomplish that we are going to use JQuery's autocomplete widget.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Getting started&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This is a sketch of what we are going to do.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:198px;width:572px;" alt="" src="http://dotnethints.com/admin/gallery/autocomplete1.jpg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Looks better, doesn't it?&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The select element looks like this &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;select&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;option&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;value&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;1&amp;quot;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;Chocolate chip cookie&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;option&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;option &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;value&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;2&amp;quot;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;Chocolate ice cream&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;option&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;option &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;value&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;3&amp;quot;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;Cookies and Cream&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;option&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;option &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;value&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;4&amp;quot;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;Strawberry ice cream&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;option&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;option &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;value&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;5&amp;quot;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;Vanilla ice cream&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;option&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;select&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;In case you haven't noticed our data consists of ice cream flavours!&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Creating the WCF service&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Before writing the HTML and JavaScript code we are going to create the WCF service that will send the results. I am taking into account that you know the basics of WCF services. In case you don't, you could use an old fashioned web service or anything else that will return some JSON data instead.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;In order to set up our service we will need some info attached to the web.config file. This will do.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;system.serviceModel&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;behaviors&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;endpointBehaviors&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;behavior&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;name&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;DotNetHints.IceCream&amp;quot;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;enableWebScript&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;/&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;behavior&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;endpointBehaviors&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;behaviors&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;serviceHostingEnvironment&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;aspNetCompatibilityEnabled&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;true&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;multipleSiteBindingsEnabled&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;true&amp;quot; /&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;services&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;service&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;name&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;IceCream&amp;quot;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;endpoint&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;address&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;behaviorConfiguration&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;DotNetHints.IceCream&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;binding&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;webHttpBinding&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;contract&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;IceCream&amp;quot; /&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;service&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;services&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160; &amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;system.serviceModel&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Now we can create WCF services based on the IceCream class. So we create a file called Icecream.svc and place the following code inside&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;[&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;ServiceContract&lt;/font&gt;&lt;/span&gt;(Namespace =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;)]&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;[&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;AspNetCompatibilityRequirements&lt;/font&gt;&lt;/span&gt;(RequirementsMode =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;AspNetCompatibilityRequirementsMode&lt;/font&gt;&lt;/span&gt;.Allowed)]&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;public class&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#008080"&gt;IceCream&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; [&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;WebInvoke&lt;/font&gt;&lt;/span&gt;(Method =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;GET&amp;quot;&lt;/font&gt;&lt;/span&gt;, RequestFormat =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;WebMessageFormat&lt;/font&gt;&lt;/span&gt;.Json, ResponseFormat =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;WebMessageFormat&lt;/font&gt;&lt;/span&gt;.Json)]&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; [&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;OperationContract&lt;/font&gt;&lt;/span&gt;]&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public string&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;GetIceCreamFlavours()&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;If everything works fine, then by requesting MyPath/IceCream.svc/GetIceCreamFlavours on my web browser I get&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&amp;quot;d&amp;quot;:&amp;quot;&amp;quot;}&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This is a web service that returns nothing. Now, let's create a service that will actually do something useful.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We are going to use a helper class called IceCreamFlavour that contains two string values, ID and Name.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;public class&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#008080"&gt;IceCreamFlavour&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public string&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;ID {&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;get&lt;/font&gt;&lt;/span&gt;;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;set&lt;/font&gt;&lt;/span&gt;; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public string&lt;/font&gt;&lt;/span&gt; Name { &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;get&lt;/font&gt;&lt;/span&gt;; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;set&lt;/font&gt;&lt;/span&gt;;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Then we are creating the FillIceCreamFlavors that will get a list of IceCreamFlavour objects and insert the select elements we have created in the beginning. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;public void&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;FillIceCreamFlavors(&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;List&lt;/font&gt;&lt;/span&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;IceCreamFlavour&lt;/font&gt;&lt;/span&gt;&amp;gt; searchResults)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;searchResults.Add(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;IceCreamFlavour&lt;/font&gt;&lt;/span&gt;() { ID =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;1&amp;quot;&lt;/font&gt;&lt;/span&gt;, Name =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Chocolate chip cookie&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;});&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;searchResults.Add(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;IceCreamFlavour&lt;/font&gt;&lt;/span&gt;() { ID =&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot;2&amp;quot;&lt;/font&gt;&lt;/span&gt;, Name =&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot;Chocolate ice cream&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;});&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;searchResults.Add(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;IceCreamFlavour&lt;/font&gt;&lt;/span&gt;() { ID =&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot;3&amp;quot;&lt;/font&gt;&lt;/span&gt;, Name =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Cookies and Cream&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;});&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;searchResults.Add(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;IceCreamFlavour&lt;/font&gt;&lt;/span&gt;() { ID =&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot;4&amp;quot;&lt;/font&gt;&lt;/span&gt;, Name =&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot;Strawberry ice cream&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;});&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;searchResults.Add(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;IceCreamFlavour&lt;/font&gt;&lt;/span&gt;() { ID =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;5&amp;quot;&lt;/font&gt;&lt;/span&gt;, Name =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Vanilla ice cream&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;});&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Finally let's do our GetIceCreamFlavours service&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;public string&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;GetIceCreamFlavours()&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;List&lt;/font&gt;&lt;/span&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;IceCreamFlavour&lt;/font&gt;&lt;/span&gt;&amp;gt; searchResults =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;List&lt;/font&gt;&lt;/span&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;IceCreamFlavour&lt;/font&gt;&lt;/span&gt;&amp;gt;();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; FillIceCreamFlavours(searchResults);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Create a jsonSerializer object&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;var&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;jsonSerializer = new System.Web.Script.Serialization.&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;JavaScriptSerializer&lt;/font&gt;&lt;/span&gt;();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; jsonSerializer.MaxJsonLength = 2147483647;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Return serialized json data&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;jsonSerializer.Serialize(searchResults);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Now if I request the same URL as I did earlier I get&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&amp;quot;d&amp;quot;:&amp;quot;[{\&amp;quot;ID\&amp;quot;:\&amp;quot;1\&amp;quot;,\&amp;quot;Name\&amp;quot;:\&amp;quot;Chocolate chip cookie\&amp;quot;},{\&amp;quot;ID\&amp;quot;:\&amp;quot;2\&amp;quot;,\&amp;quot;Name\&amp;quot;:\&amp;quot;Chocolate ice cream\&amp;quot;},{\&amp;quot;ID\&amp;quot;:\&amp;quot;3\&amp;quot;,\&amp;quot;Name\&amp;quot;:\&amp;quot;Cookies and Cream\&amp;quot;},{\&amp;quot;ID\&amp;quot;:\&amp;quot;4\&amp;quot;,\&amp;quot;Name\&amp;quot;:\&amp;quot;Strawberry ice cream\&amp;quot;},{\&amp;quot;ID\&amp;quot;:\&amp;quot;5\&amp;quot;,\&amp;quot;Name\&amp;quot;:\&amp;quot;Vanilla ice cream\&amp;quot;}]&amp;quot;}&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This is our data in JSON form. Now we can take one more step and create a method that will filter out all IceCreamFlavours that do not contain the search keyword within their text.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;public string&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;GetIceCreamFlavours(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;searchKeyword)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;List&lt;/font&gt;&lt;/span&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;IceCreamFlavour&lt;/font&gt;&lt;/span&gt;&amp;gt; searchResults =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;List&lt;/font&gt;&lt;/span&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;IceCreamFlavour&lt;/font&gt;&lt;/span&gt;&amp;gt;();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; FillIceCreamFlavours(searchResults);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;(!&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;/font&gt;&lt;/span&gt;.IsNullOrEmpty(searchKeyword))&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Use ToLower so letter case will make no difference&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; searchKeyword = searchKeyword.ToLower();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Use lambda expression to filter out data&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; searchResults = searchResults.Where(sr =&amp;gt; sr.Name.ToLower().Contains(searchKeyword)).ToList();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Return no results message&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;if&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;(!searchResults.Any())&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; searchResults.Add(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;IceCreamFlavour&lt;/font&gt;&lt;/span&gt;() { ID =&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot;-1&amp;quot;&lt;/font&gt;&lt;/span&gt;, Name =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;No results :(&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;});&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Create a jsonSerializer object&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;var&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;jsonSerializer =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;System.Web.Script.Serialization.JavaScriptSerializer();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; jsonSerializer.MaxJsonLength = 2147483647;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Return serialized json data&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#006400"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;jsonSerializer.Serialize(searchResults);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Now let's try out this URL MyPath/IceCream.svc/GetIceCreamFlavours?searchKeyword=ice&lt;/font&gt;&lt;span class="Apple-tab-span" style="white-space:nowrap;"&gt;&lt;font style="font-size:10.5pt;"&gt; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The resulting data is&lt;/font&gt;&lt;span class="Apple-tab-span" style="white-space:nowrap;"&gt;&lt;font style="font-size:10.5pt;"&gt; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&amp;quot;d&amp;quot;:&amp;quot;[{\&amp;quot;ID\&amp;quot;:\&amp;quot;2\&amp;quot;,\&amp;quot;Name\&amp;quot;:\&amp;quot;Chocolate ice cream\&amp;quot;},{\&amp;quot;ID\&amp;quot;:\&amp;quot;4\&amp;quot;,\&amp;quot;Name\&amp;quot;:\&amp;quot;Strawberry ice cream\&amp;quot;},{\&amp;quot;ID\&amp;quot;:\&amp;quot;5\&amp;quot;,\&amp;quot;Name\&amp;quot;:\&amp;quot;Vanilla ice cream\&amp;quot;}]&amp;quot;}&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So far we have successfully created a WCF service that will return IceCreamFlavour data depending on the requested input. Let's move on to the HTML and JavaScript part.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Using autocomplete&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;To use that JQuery autocomplete widget we need a simple input element like that&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;input&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;id&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;AsyncSearch&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;type&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;text&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;placeholder&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;Ice Cream Flavour&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;autocomplete&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;off&amp;quot; /&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We also have to use two JQuery library files&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;script&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;src&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;//code.jquery.com/jquery-1.9.1.js&amp;quot;&amp;gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;script&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;script &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;src&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;//code.jquery.com/ui/1.10.3/jquery-ui.js&amp;quot;&amp;gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;script&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;and optionally a css file so that the results will look nice.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;link&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;rel&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;stylesheet&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;href&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css&amp;quot;&amp;gt; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;In addition to the default css I 'd like to add a line of my own to make results look smoother&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;style&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;b&lt;/font&gt;&lt;/span&gt;,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;a&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;{&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;font-size&lt;/font&gt;&lt;/span&gt;:&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;12p&lt;/font&gt;&lt;/span&gt;x;}&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;/&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;style&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We are now ready to use the autocomplete function like that&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;$(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;function&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;() {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; $(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;#AsyncSearch&amp;quot;&lt;/font&gt;&lt;/span&gt;).autocomplete({&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; source: function (request, response) {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; $(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;this&lt;/font&gt;&lt;/span&gt;.element).data(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;jqAjax&amp;quot;&lt;/font&gt;&lt;/span&gt;, $.ajax({&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; url:&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;MyPath/IceCream.svc/GetIceCreamFlavours?searchKeyword=&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;+ encodeURI(request.term),&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; dataType:&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;json&amp;quot;&lt;/font&gt;&lt;/span&gt;,&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; type:&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;GET&amp;quot;&lt;/font&gt;&lt;/span&gt;,&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; contentType:&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;application/json; charset=utf-8&amp;quot;&lt;/font&gt;&lt;/span&gt;,&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; success:&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;function&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;(data) {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;if&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;(data.hasOwnProperty(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;d&amp;quot;&lt;/font&gt;&lt;/span&gt;))&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; data = eval(data.d);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; response($.map(data,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;function&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;(item) {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; label: item.Name,&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; value: item.ID,&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; };&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }));&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }));&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; },&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; minLength: 3,&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; select:&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;function&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;(event, ui) {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; window.location.replace(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;'AsyncSelect.html?id='&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;+ ui.item.value)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; });&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; });&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Even though it looks complicated, it is not hard to handle once you get to know it. Event hough autocomplete has many attributes, we'll use only the basic ones.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Source describes the data source. Its attributes describe themselves properly: url, dataType, type and contentType. We can easily tell that our service MyPath/IceCream.svc/GetIceCreamFlavours will be the target of the request and it will contain the searchKeyword parameter having value of&amp;#160; encodeURI(request.term).&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Let's take a look at success attribute. This is the code that will run when data is retrieved. The following code is important to be included when using WCF services&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;if (data.hasOwnProperty(&amp;quot;d&amp;quot;))&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;data = eval(data.d);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;You may remember that a previous call to our service returned&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&amp;quot;d&amp;quot;:&amp;quot;[{\&amp;quot;ID\&amp;quot;:\&amp;quot;2\&amp;quot;,\&amp;quot;Name\&amp;quot;:\&amp;quot;Chocolate ice cream\&amp;quot;},{\&amp;quot;ID\&amp;quot;:\&amp;quot;4\&amp;quot;,\&amp;quot;Name\&amp;quot;:\&amp;quot;Strawberry ice cream\&amp;quot;},{\&amp;quot;ID\&amp;quot;:\&amp;quot;5\&amp;quot;,\&amp;quot;Name\&amp;quot;:\&amp;quot;Vanilla ice cream\&amp;quot;}]&amp;quot;}&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This is a fine created JSON object, however this &amp;quot;d&amp;quot; property that is by default placed in the beginning when using WCF services will make things hard for autocomplete to handle. This is the reason we need to have it removed.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Moving on, minLength is a useful attribute specifying how many characters need to be filled in order for the AJAX call to be created.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The select attribute describes what will happen when an item is selected. In our case, we are going to be redirected to a new page (actually it's the same page) containing the item's ID as an id parameter.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Everything is ready. Let's take a look at what happens now.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:127px;width:673px;" alt="" src="http://dotnethints.com/admin/gallery/autocomplete2.jpg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Using the catcomplete function.&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We have created our asynchronous select control. Before completing this article there's one more thing to do. That will be, using the catcomplete function, in order to group our results into categories. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;First thing to do is edit the services we have created so that they can support a categories element. We will create the public class &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;IceCreamFlavourCategory which is similar to the IceCreamFlavour class, however it includes an extra string Category attribute.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;public class&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#008080"&gt;IceCreamFlavourCategory&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&amp;#160;&amp;#160; public string&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;ID {&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;get&lt;/font&gt;&lt;/span&gt;;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;set&lt;/font&gt;&lt;/span&gt;; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&amp;#160; public string&lt;/font&gt;&lt;/span&gt;Name { &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;get&lt;/font&gt;&lt;/span&gt;; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;set&lt;/font&gt;&lt;/span&gt;; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&amp;#160;&amp;#160; public string&lt;/font&gt;&lt;/span&gt; Category { &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;get&lt;/font&gt;&lt;/span&gt;; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;set&lt;/font&gt;&lt;/span&gt;; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;} &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We will create a new service called GetIceCreamCategoryFlavours which is about the same as the one we had already created.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;[&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;WebInvoke&lt;/font&gt;&lt;/span&gt;(Method =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;GET&amp;quot;&lt;/font&gt;&lt;/span&gt;, RequestFormat =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;WebMessageFormat&lt;/font&gt;&lt;/span&gt;.Json, ResponseFormat =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;WebMessageFormat&lt;/font&gt;&lt;/span&gt;.Json)]&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; [&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;OperationContract&lt;/font&gt;&lt;/span&gt;]&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;public string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;GetIceCreamCategoryFlavours(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;searchKeyword)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;List&lt;/font&gt;&lt;/span&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;IceCreamFlavourCategory&lt;/font&gt;&lt;/span&gt;&amp;gt; searchResults =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;List&lt;/font&gt;&lt;/span&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;IceCreamFlavourCategory&lt;/font&gt;&lt;/span&gt;&amp;gt;();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; FillIceCreamCategoryFlavours(searchResults);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Use ToLower so letter case will make no difference&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; searchKeyword = searchKeyword.ToLower();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Use lambda expression to filter out data&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; searchResults = searchResults.Where(sr =&amp;gt; sr.Name.ToLower().Contains(searchKeyword)).ToList();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Return no results message&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;if&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;(!searchResults.Any())&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; searchResults.Add(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;IceCreamFlavourCategory&lt;/font&gt;&lt;/span&gt;() { ID =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;-1&amp;quot;&lt;/font&gt;&lt;/span&gt;, Name =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;No results :(&amp;quot;&lt;/font&gt;&lt;/span&gt;, Category =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;, });&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;var&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;jsonSerializer =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;System.Web.Script.Serialization.&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;JavaScriptSerializer&lt;/font&gt;&lt;/span&gt;();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; jsonSerializer.MaxJsonLength = 2147483647;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Return serialized json data&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;jsonSerializer.Serialize(searchResults);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We will also use an extra initialization method we are going to name FillIceCreamFlavours, similar to the FillIceCreamFlavours we created earlier.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public void&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;FillIceCreamCategoryFlavours(&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;List&lt;/font&gt;&lt;/span&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;IceCreamFlavourCategory&lt;/font&gt;&lt;/span&gt;&amp;gt; searchResults)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; searchResults.Add(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;IceCreamFlavourCategory&lt;/font&gt;&lt;/span&gt;() { ID =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;1&amp;quot;&lt;/font&gt;&lt;/span&gt;, Name =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Chocolate chip cookie&amp;quot;&lt;/font&gt;&lt;/span&gt;, Category =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Chocolate&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;});&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; searchResults.Add(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;IceCreamFlavourCategory&lt;/font&gt;&lt;/span&gt;() { ID =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;2&amp;quot;&lt;/font&gt;&lt;/span&gt;, Name =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Chocolate ice cream&amp;quot;&lt;/font&gt;&lt;/span&gt;, Category =&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot;Chocolate&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;});&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; searchResults.Add(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;IceCreamFlavourCategory&lt;/font&gt;&lt;/span&gt;() { ID =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;3&amp;quot;&lt;/font&gt;&lt;/span&gt;, Name =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Cookies and Cream&amp;quot;&lt;/font&gt;&lt;/span&gt;, Category =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Cream&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;});&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; searchResults.Add(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;IceCreamFlavourCategory&lt;/font&gt;&lt;/span&gt;() { ID =&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot;4&amp;quot;&lt;/font&gt;&lt;/span&gt;, Name =&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot;Strawberry ice cream&amp;quot;&lt;/font&gt;&lt;/span&gt;, Category =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Strawberry&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;});&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; searchResults.Add(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;IceCreamFlavourCategory&lt;/font&gt;&lt;/span&gt;() { ID =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;5&amp;quot;&lt;/font&gt;&lt;/span&gt;, Name =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Vanilla ice cream&amp;quot;&lt;/font&gt;&lt;/span&gt;, Category =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Vanilla&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;});&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Now, the tuime has come to test our new service. When requesting the MyPath/IceCream.svc/GetIceCreamCategoryFlavours?searchKeyword=ice URl we get&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&amp;quot;d&amp;quot;:&amp;quot;[{\&amp;quot;ID\&amp;quot;:\&amp;quot;2\&amp;quot;,\&amp;quot;Name\&amp;quot;:\&amp;quot;Chocolate ice cream\&amp;quot;,\&amp;quot;Category\&amp;quot;:\&amp;quot;Chocolate\&amp;quot;},{\&amp;quot;ID\&amp;quot;:\&amp;quot;4\&amp;quot;,\&amp;quot;Name\&amp;quot;:\&amp;quot;Strawberry ice cream\&amp;quot;,\&amp;quot;Category\&amp;quot;:\&amp;quot;Strawberry\&amp;quot;},{\&amp;quot;ID\&amp;quot;:\&amp;quot;5\&amp;quot;,\&amp;quot;Name\&amp;quot;:\&amp;quot;Vanilla ice cream\&amp;quot;,\&amp;quot;Category\&amp;quot;:\&amp;quot;Vanilla\&amp;quot;}]&amp;quot;}&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Notice the results are the same as the ones we got earlier, however now we have the Category info as well.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Finally here's the new script we need to use the code we just created.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;$(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;function&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;() {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; $(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;#AsyncSearch&amp;quot;&lt;/font&gt;&lt;/span&gt;).catcomplete({&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; source: function (request, response) {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; $(this.element).data&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;(&amp;quot;jqAjax&amp;quot;&lt;/font&gt;&lt;/span&gt;, $.ajax({&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; url:&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;/MyPath/IceCream.svc/GetIceCreamCategoryFlavours?searchKeyword=&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;+ encodeURI(request.term),&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; dataType:&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;json&amp;quot;&lt;/font&gt;&lt;/span&gt;,&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; type:&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot;GET&amp;quot;&lt;/font&gt;&lt;/span&gt;,&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; contentType:&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;application/json; charset=utf-8&lt;/font&gt;&lt;/span&gt;&amp;quot;,&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; success:&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;function&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;(data) {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;(data.hasOwnProperty(&amp;quot;d&amp;quot;))&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; data = eval(data.d);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; response($.map(data,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;function&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;(item) {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; label: item.Name,&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; value: item.ID,&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; category: item.Category&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; };&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }));&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }));&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; },&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; minLength: 3,&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; select:&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;function&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;(event, ui) {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; window.location.replace&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;('AsyncSelect.html?id='&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;+ ui.item.value)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; });&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; });&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This piece of code is similar to the previous one as well. You may notice the category attribute that is inserted in the response part.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We will also need the following piece of code to handle the grouping&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; $.widget(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;custom.catcomplete&amp;quot;&lt;/font&gt;&lt;/span&gt;, $.ui.autocomplete, {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _renderMenu:&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;function&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;(ul, items) {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;var&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;that =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;this&lt;/font&gt;&lt;/span&gt;,&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; currentCategory = &amp;quot;&amp;quot;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; $.each(items, function (index, item) {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;if&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;(item.category != currentCategory) {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ul.append(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;lt;li &amp;gt;&amp;lt;b&amp;gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;+ item.category +&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; currentCategory = item.category;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; that._renderItemData(ul, item);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; });&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; });&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Every time an item containing a new category shows up we place the items category info before presenting the actual info. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The result should look like&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:189px;width:673px;" alt="" src="http://dotnethints.com/admin/gallery/autocomplete3.jpg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;JQuery functions can get many attributes that have not been used on this example. If you want to know more on how to master them, you can visit the&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;a style="text-decoration:;color:;" href="http://jqueryui.com/autocomplete/"&gt;&lt;font color="#67217a"&gt;&lt;font style="text-decoration:none;" face="Segoe UI"&gt;official page&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/font&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Summary&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Using a WCF service that returns JSON results based on input in combination with the JQuery autocomplete and catcomplete functions we have created an asynchronous select element. Autocomplete (or catcomplete if we wish to use grouping) calls the service automatically and then handles the results as soon as it gets them.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;Reference &lt;a href="http://dotnethints.com/blog?id=54"&gt;DotNetHints&lt;/a&gt;&lt;/div&gt;&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=76052" width="1" height="1"&gt;</content><author><name>k badas</name><uri>https://www.dotnetzone.gr:443/cs/members/k+badas.aspx</uri></author></entry><entry><title>Attacking a website</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2014/11/27/attacking-a-website.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2014/11/27/attacking-a-website.aspx</id><published>2014-11-27T23:04:13Z</published><updated>2014-11-27T23:04:13Z</updated><content type="html">&lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;People will sometimes attack random websites for their own reason. DotNetHints, being a random website, was bound to become a target of attacks as well. As far as I can tell there has been no damage on either the website or the database. Since all the things I've learned proved quite useful as well as interesting, I decided to write an article containing a list of interesting attack tools, using the attacks made on DotNetHints as a guideline, mentioning what was the purpose of each and every one of them.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;SQL Injection attacks&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;If you would like to read a few basic things concerning attack patterns, you can read this&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;u&gt;&lt;a style="text-decoration:;color:;" href="http://dotnethints.com/blog?id=33"&gt;&lt;font color="#67217a"&gt;&lt;font style="text-decoration:none;"&gt;previous article&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/u&gt;. Now, let's talk about SQL Injection attacks. An SQL Injection is an attack where text inserted as input can be translated as malicious SQL statements.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;For example, DotNetHints gets the value of the blog article to show using the query string, let's say http://dotnethints.com/blog?id=53. We could assume that number 53 is passed through the database into a command that looks like &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;SELECT * FROM Blogs WHERE ID = 53&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;If a malicious user replaced &amp;quot;53&amp;quot; with &amp;quot;53; DROP TABLE Blogs;&amp;quot; then the SQL statement created would look like&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;SELECT * FROM Blogs WHERE ID = 53; DROP TABLE Blogs;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;and that would easily delete our table (supposing we had a table called Blogs).&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:160px;width:136px;" alt="Deleting SQL table" src="http://dotnethints.com/admin/gallery/computer-attack3.jpg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;However though it may seem easy for us to create malicious SQL statements, the attacker has no clue what his commands are supposed to look like. So he starts off by guessing. He usually creates SQL statements that will cause the server code to fail and using the exception messages or any random piece of info he can get, he forms an image of our database little by little.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Keep in mind that SQL Injections have a hard time getting through parameterized SQL queries. That is because in case a BlogID parameter is expected to be an integer, inserting string value will cause an exception to be thrown instead of messing up your database. However even if the variable is expected to be of string type, an SQL parameter will isolate that variable from the rest of the statement, so everything will still be OK. Yet, keep in mind that if you use stored procedures you may not be protected, depending on the stored procedure's syntax. Apart from SQL protection, using an error page is a good idea as well, since the attacker will have nothing straight in his hands.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So, if a website contains flaws concerning all that is said, it is vulnerable. Now let's move on and see how an attacker may actually create an attack.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Attack tools&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;To make things simple all SQL Injection attacks will be aimed to the current page's ID ( http://dotnethints.com/blog?id=53; that makes it 53 ). The attacker may presume the SQL statement I'm using looks like this &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;SELECT * FROM Blogs WHERE ID = '53'&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;since that is a common way to get data from a table. Yet, the attacker cannot be sure what kind of statement is actually used, so he tries to get as much info as possible. In this section, the attacker is trying to find out if the website is vulnerable. In fact all the attacks mentioned below are up against the same thing.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;53' / '53&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Adding an apostrophe inside the statement will cause no harm to the database. The resulting statement looks like &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;SELECT * FROM Blogs WHERE ID = '53'' / SELECT * FROM Blogs WHERE ID = ''53'&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Supposing the website had security issues the exception returned would mention something like&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;em&gt;&lt;font style="font-size:10.5pt;"&gt;Unclosed quotation mark after the character string '53''&lt;/font&gt;&lt;/em&gt;&lt;font style="font-size:10.5pt;"&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Now the attacker knows that the website is vulnerable and is ready to move on.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;53' and 'x'='x&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The resulting statement looks like &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;SELECT * FROM Blogs WHERE ID = '53' and 'x'='x'&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This time, using the apostrophe, that attacker tries to end the opened string and then add code of his own. 'x'='x' will always result true. So adding this value the result should be the same as if the inserted value were 53. If the attacker gets the same result when adding his code then he knows the website is vulnerable. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Any true expression would do.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;53 and 1=1&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;If the attacker gets the same result as using 53 then he knows that both our site is vulnerable and our statement looks like SELECT * FROM Blogs WHERE ID = 53 (in contrast to the previous assumption, this query does not use apostrophes).&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Instead of using an expression that is always true he could use one that is always false. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;53' and 'x'='y&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The resulting statement looks like &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;SELECT * FROM Blogs WHERE ID = '53' and 'x'='y'&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This time the expression will never return results. Likewise, if the attacker notices system failure, then the site is vulnerable.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Any false expression would do, for example.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;53 and 1&amp;gt;1&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;One more point of interest is the following input&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;999999.9 &lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;that creates the seemingly harmless&lt;em&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;SELECT * FROM Blogs WHERE ID = 999999.9&lt;/em&gt;. This will most probably return no rows and is probably used to see if the website is vulnerable. If you see that, you are about to encounter an evil foe. Havij.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Havij&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;quot;Havij is an automated SQL Injection tool that helps penetration testers&amp;quot; according to its production company. Well, none could prove them wrong. Yet a hacker is nothing more than a penetration tester who has no permission granted from a website's owner. In other words Havij (and other similar products) is like a knife - you can use it inside your kitchen or you can you use it to attack people. Havij consists of an easy to use Windows environment. This makes it a very popular choice as even people who have no idea what SQL stands for can use it. And in case the website is vulnerable they can get anything out of it.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Havij is no magic tool. It uses standard SQL injection attacks. However since it is a software program it can make things work much faster than a single person can. You can find a very interesting description of Havij's basic application on this video entitled&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;a style="text-decoration:;color:;" href="https://www.youtube.com/watch?v=Fp47G4MQFvA"&gt;&lt;font color="#67217a"&gt;&lt;font face="Segoe UI"&gt;&lt;span class="Apple-converted-space"&gt;&lt;font style="text-decoration:none;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;u&gt;Hacking is child's play - SQL injection with Havij by 3 year old&lt;/u&gt;&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/font&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So what Havij is trying to do in a few words is, create exception throwing statements that hold important database info such as tables and columns names on the resulting messages. If the website does not give away exception messages, still Havij can create blind SQL injection attacks and things will end up the same way.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Even though I can't be sure, since the attacks I have described so far could have been created by a single person as well, it is probable that I have been the target of a Havij user all the time. Anyway let's see how Havij tried to mess up with the database.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;999999.9 union all select 0x31303235343830303536,0x31303235343830303536,0x31303235343830303536--&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;OK, so there are three parts in the following SQL statement.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;SELECT * FROM Blogs WHERE ID = 999999.9 union all select 0x31303235343830303536,0x31303235343830303536,0x31303235343830303536--&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;1) 999999.9 will return no rows but still carries the table schema&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;2) union all select 0x31303235343830303536,0x31303235343830303536,0x31303235343830303536 will try to create a union with a three column rows&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;3) will comment out possible remaining code&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So, in case our table had four columns the previous statement would throw the following exception.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;All queries combined using a UNION, INTERSECT or EXCEPT operator must have an equal number of expressions in their target lists.&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;OK, so the table does not have three rows. Let's try out four of them.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;999999.9 union all select 0x31303235343830303536,0x31303235343830303536,0x31303235343830303536,0x31303235343830303536--&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This time the result could be the union created row.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Now, if the table consisted of more than four columns Havij would not mind, as it likes creating requests one after the other adding one more row to the previous one's union each time, till it gets to the bottom of it. In my case it tried out to test if the returning data contained up to 23 columns.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;I have no idea why but Havij is really fond of numbers 999999.9 and 0x31303235343830303536 as I have found many people who have been attacked by exactly the same numbers.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Apart from the standard values already mentioned, Havij may also use actual id values instead of 999999.9 and null values instead of hexadecimal numbers.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;53 union all select null--&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This method is similar to the previous one and will return two rows in case it spots the exact number of columns.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Time based attacks&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Time based attacks are SQL Injections as well, however they consist of requests whose response time depends on the SQL statement execution. They are composed of time delaying statements that will usually work if a condition is true. In a few words, if the response takes longer than usual, the attacker knows that his attempt was successful. Look at the following example&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;53; if (1=1) waitfor delay '00:00:01'--&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This generates the following SQL statement&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;SELECT * FROM Blogs WHERE ID =53; if (1=1) waitfor delay '00:00:01'--&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;WAITFOR DELAY is an SQL Server delay function that is created to test if time based attacks can be used against a website. Since 1=1 is always true, if the site is vulnerable, the client should wait a second more than usual to get his response. Time based attacks can be used to bypass the error page defense, in case a site is actually vulnerable.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Since an attacker is not sure what database management system the website uses, it makes sense that he should try out some MySQL statements as well.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;53 and if(1=1,BENCHMARK(208000,MD5(A)),0)&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;SELECT * FROM Blogs WHERE ID =53 and if(1=1,BENCHMARK(208000,MD5(A)),0)&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;BENCHMARK is a MySQL statement that repeats an expression a number of times. In the previous example MD5(A) will be executed 208000 times. MD5 is a MySQL function that creates a hash value, in our case the hash value of 'A', and will need some time do so.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Using BENCHMARK on MySQL is similar to using WAITFOR DELAY on SQL Server. Both statements will always create time delays so the attacker will know if such an attack can be used.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Time based attacks show up in similar forms such as&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;53' and if(1=1,BENCHMARK(208000,MD5(A)),0) and 'x'='x or&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;53' AnD BeNChMaRK%(2999999%,MD5(NOW()))&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;that generate&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;em&gt;&lt;font style="font-size:10.5pt;"&gt;SELECT * FROM Blogs WHERE ID =53' and if(1=1,BENCHMARK(208000,MD5(A)),0) and 'x'='x'&lt;/font&gt;&lt;/em&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;and&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;em&gt;&lt;font style="font-size:10.5pt;"&gt;SELECT * FROM Blogs WHERE ID =53' AnD BeNChMaRK%(2999999%,MD5(NOW()))&lt;/font&gt;&lt;/em&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;respectively.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The time based attacks I've described have no actual effect on the database. They are nothing more than simple tests. Yet things could have been different if the website had turned out to be vulnerable.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:189px;width:265px;" alt="Time based attack" src="http://dotnethints.com/admin/gallery/computer-attack1.jpg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Padding Oracle attack&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;/WebResource.axd?d=9_aSpQG4otBYJW7wtbgWFn2DTTp5tmDDQLn8KCN2pl3HSkkYcOL6Y5XdP692KHs5mtz1ed72yS&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;_Ulz7TstrWAxxxcmXpmHVo_-1svjD1wJ01&amp;amp;t=635195661120000000&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Padding oracle is an attacking tool discovered a while ago where the attacker takes advantage of web resource files in order to get hold of your website encryption method. This vulnerability has been removed through a security update released soon after but as there could be servers that have not yet applied it, it sounds fair enough that attackers would give it a try. Still there are counter measures you can take yourself to make your application safe. Since padding oracle attack would require a lot of pages to be thoroughly described, the following part will be nothing more than a summary of this method. If you would like to know more concerning this you can look it up on the internet.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;A Web Resource file is a file containing reference to embedded resources within your application. For example if you use ASP.NET's validation controls then the web resource is used to retrieve proper JavaScript files. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;A web resource's URL looks like that&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;WebResource.axd?d=SbXSD3uTnhYsK4gMD8fL84_mHPC5jJ7lfdnr1_WtsftZiUOZ6IXYG8QCXW86UizF0&amp;amp;t=632768953157700078&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The t parameter refers to time stamp value. What we are interested in is the d parameter which consists of the encrypted identifier. The padding oracle attack is using this identifier to get a hold of your encryption mechanism. Here's how this is done.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;When a string is encrypted, it has to fit in into eight byte sized blocks. The empty bytes left on these blocks are called padding. Padding has to be filled with something and this something will be the hexadecimal number of the remaining bytes. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So supposing there are three bytes left on the block, each one of these will contain data 0x03. When we are trying to decrypt the message, in case one of these blocks contained 0x02, that would cause an error thrown. Padding oracle is the method described. It is the mechanism we can use to check if an encrypted message is correctly encrypted.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;OK, so far we know what padding oracle is and that a web resource file contains encrypted data. Now what?&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;An attacker can create multiple requests, using a different encrypted identifier each time. If the result is acceptable he gets an OK response, if not he gets an error. After a lot of requests the attacker can get hold of the initialization vector and, from that moment on, create his own encrypted messages or decrypt already encrypted text. Even worse the attacker can even download the application's web.config file.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;OK, so far I have probably convinced you that padding oracle is some evil thing to deal with. The first question to answer is if a website is vulnerable to padding oracle. To answer that, you must imitate the padding oracle attack.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Get your web resource file URL e.g. http://mywebsite.com/WebResource.axd?d=jzjghMVYzFihd9Uhe_arpA2&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;If you request that, you should get an OK response containing your resource info.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Now the attacker would use another identifier&amp;#160; http://mywebsite.com/WebResource.axd?d=acun&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;If you get anything but an OK response, then the attacker can tell this identifier was not suitable and use another one. So the response should in that case be OK as well.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The same applies in case of missing identifier http://mywebsite.com/WebResource.axd?d= where the response would normally be Not Found.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So how do we deal with it in case in case something wrong showed up on the previous test? Let's follow these simple steps.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;1) Use a custom error in your web.config file.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;2) Set redirectMode to ResponseRewrite in your web.config file.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;3) Add some random sleep delay to your error response.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The first step will return an OK page instead of an Error page.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Second step will return an OK instead of a Redirect page.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Even if you always get an OK page someone may guess if an error has occurred based on the time it takes for the response to get. Adding random sleep delay eliminates this issue as well.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Keep in mind that getting requests concerning resource files is not always a sign of padding oracle attack. Pods crawling over your website may also cause a &amp;quot;This is an invalid webresource request.&amp;quot; exception to be thrown which is no reason to worry about.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:120px;width:100px;" alt="Padding oracle attack" src="http://dotnethints.com/admin/gallery/sick-computer.png" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Other types of attacks&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;There are tons of tools a malicious person can use against your website. Whenever something odd comes up administrators should be on the lookout for what it may cause. This is one strange kind of attack that I would like to mention.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;7 [PLM=0][N ] GET http://dotnethints.com/forum_post?id=7 [0,14770,13801] -&amp;gt; [N ] POST http://dotnethints.com/forum_post?id=7 [R=302][8880,0,522]&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Even though I have made quite a search concerning the previous attack, it got me nowhere. This type of attack does exist, as many people have been wondering, but none of them has a straight idea what it is for. I am really not sure myself yet I might guess that the attacker is trying to post something to the page as this page contains a form to insert input.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Anyway if there is anybody out there who knows what this whole thing is about, I would be really happy to know about it.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;One last thing to point is the following alarming request I would get&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;/blog?id=41&amp;amp;sa=U&amp;amp;ei=kL7iVOelC43VPIuegOgF&amp;amp;ved=0CBYQFjAA&amp;amp;usg=AFQjCNED6y6PaalihyN0XUzcfDo4KvXuEA&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;widows:1;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Fortunately this one is no attack. It is actually caused by some browser add-on called Google Enhancer when using search engine. So, that drops the threats couter by one. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&amp;#160;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Summary&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;SQL Injections are attack tools that have to do with creating malicious SQL statements through input and can be neutralized using parameterized SQL commands. An attacker will usually test to find out if a website is vulnerable before moving on to actual attacks. Using Havij, simple computer users can create effective SQL Injection attacks. Time base attacks are SQL Injection attacks base on the response time. Padding Oracle attack takes advantage of resource files to get access to our encryption methods.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;Reference &lt;a href="http://dotnethints.com/blog?id=53"&gt;DotNetHints&lt;/a&gt;&lt;/div&gt;&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=75975" width="1" height="1"&gt;</content><author><name>k badas</name><uri>https://www.dotnetzone.gr:443/cs/members/k+badas.aspx</uri></author></entry><entry><title>Handling unhandled exceptions</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2014/10/09/handling-unhandled-exceptions.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2014/10/09/handling-unhandled-exceptions.aspx</id><published>2014-10-10T02:59:07Z</published><updated>2014-10-10T02:59:07Z</updated><content type="html">&lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We have already talked about exception handling and creating error pages on a&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;a style="text-decoration:;color:;" href="http://dotnethints.com/blog?id=33"&gt;&lt;font color="#67217a"&gt;&lt;font style="text-decoration:none;" face="Segoe UI"&gt;previous article&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/font&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;. In this article we will see how we can use the Global.asax Application_Error method to handle every possible exception in our website.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Introduction&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Typical exception handling can use try catch blocks in pieces of code where an exception is likely to happen. On the other hand an error page works for all possible exceptions on our website but will do nothing more than display an error page. However it would be nice if we could be informed when an unhandled exception is thrown. Since our code is supposed to work, an unhandled exception would state that either there is something wrong with it, or someone is trying to throw exceptions on purpose, by messing up with the URL for example. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Either way, we can use the Application_Error method to do things like log error info or send an email to the administrator. Application_Error will be called when an unhandled exception is thrown.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:260px;width:260px;" alt="exception handling" src="http://dotnethints.com/admin/gallery/errorhandling2.jpg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Using the Application_Error method&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Getting the exception info is quite easy. All we have to do is use&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;Exception&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;ex = Server.GetLastError();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;and here's our exception waiting for us to fetch the info we want.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Most important things to get are the Message, InnerException.Message and StackTrace. Using these you can get the idea of what exception has been thrown and why. For example&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Message :&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;em&gt;&lt;font style="font-size:10.5pt;"&gt;Exception of type 'System.Web.HttpUnhandledException' was thrown.&lt;/font&gt;&lt;/em&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;InnerException.Message :&lt;/font&gt;&lt;em&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&amp;#160; &lt;/span&gt;Input string was not in a correct format.&lt;/font&gt;&lt;/em&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;StackTrace :&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;em&gt;&lt;font style="font-size:10.5pt;"&gt;at System.Web.UI.Page.HandleError(Exception e)&lt;/font&gt;&lt;/em&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)...&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;You can of course get all the info you like an Exception object can offer besides the ones already mentioned.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;You may also like to write down the time the exception was thrown. This can be easily found using DateTime.Now.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;On a web application you may probably want to get info located in the Request object. Request contains helpful attributes such as the URL that caused the exception. You may also be interested in the client's IP address.&lt;/font&gt;&lt;span class="Apple-tab-span" style="white-space:nowrap;"&gt;&lt;font style="font-size:10.5pt;"&gt; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;string &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;url = Request.RawUrl;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;string &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;IPAddress = GetIPAddress(Request);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Application_Error in action&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The example following shows how we can use the Application_Error method to create an UnhandledException object and then store it in database.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;First we create the UnhandledException class&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;public class&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#008080"&gt;UnhandledException&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public string&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;URL {&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;get&lt;/font&gt;&lt;/span&gt;; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;set&lt;/font&gt;&lt;/span&gt;; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public string&lt;/font&gt;&lt;/span&gt; Message { &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;get&lt;/font&gt;&lt;/span&gt;; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;set&lt;/font&gt;&lt;/span&gt;; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;DateTime&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;DateCreated { &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;get&lt;/font&gt;&lt;/span&gt;; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;set&lt;/font&gt;&lt;/span&gt;; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public string&lt;/font&gt;&lt;/span&gt; StackTrace { &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;get&lt;/font&gt;&lt;/span&gt;; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;set&lt;/font&gt;&lt;/span&gt;; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public string&lt;/font&gt;&lt;/span&gt; IPAddress { &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;get&lt;/font&gt;&lt;/span&gt;;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;set&lt;/font&gt;&lt;/span&gt;; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;UnhandledException(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;/font&gt;&lt;/span&gt; url, &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;/font&gt;&lt;/span&gt; message, &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;DateTime &lt;/font&gt;&lt;/span&gt;dateCreated, &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;/font&gt;&lt;/span&gt; stackTrace, &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;/font&gt;&lt;/span&gt; ipaddress)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; URL = url;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Message = message;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; DateCreated = dateCreated;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; StackTrace = stackTrace;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; IPAddress = ipaddress;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;public int&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;StoreUnhandledException()&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Stores UnhandledException to database.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;StoreUnhandledException(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;this&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Then we place code inside the Application_Error method&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;void&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;Application_Error(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;object&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;sender,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;EventArgs&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;e) &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; { &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Code that runs when an unhandled error occurs&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;url = Request.RawUrl;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;IPAddress = GetIPAddress(Request);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Get the exception object.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Exception&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;ex = Server.GetLastError();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Exception info&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;message = ex.Message;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;(ex.InnerException !=&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;null&lt;/font&gt;&lt;/span&gt;)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //InnerException.Message is more accurate than message&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; message = ex.InnerException.Message;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;UnhandledException&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;uex =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;UnhandledException&lt;/font&gt;&lt;/span&gt;(url, message,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;DateTime&lt;/font&gt;&lt;/span&gt;.Now, ex.StackTrace, IPAddress);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; uex.StoreUnhandledException();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Clear exception&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Server.ClearError();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Redirect to error page&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Response.Redirect(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;~/error.aspx&amp;quot;&lt;/font&gt;&lt;/span&gt;);&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;GetIPAddress is a method returning a string that represents the request's IP address. There are a few ways to get the IP address even though none of them is 100% accurate. In this article we may use the following&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;//Return client's IP address&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;public static string&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;GetIPAddress(&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;HttpRequest&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;request)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160; //In case of proxy use etc&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;ipList = request.ServerVariables[&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;HTTP_X_FORWARDED_FOR&amp;quot;&lt;/font&gt;&lt;/span&gt;];&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt; if&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;(!&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;/font&gt;&lt;/span&gt;.IsNullOrEmpty(ipList))&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //HTTP_X_FORWARDED_FOR may contain multiple addresses.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Get the first one.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;ipList.Split(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;','&lt;/font&gt;&lt;/span&gt;)[0];&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;request.ServerVariables[&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;REMOTE_ADDR&amp;quot;&lt;/font&gt;&lt;/span&gt;];&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;StoreUnhandledException contains code needed to store exception info in database. Additionally you use could some other method to send an email concerning the exception etc&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Finally, we clear the exception and redirect to an error page.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:213px;width:213px;" alt="error handling" src="http://dotnethints.com/admin/gallery/error%20handling1.jpg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Summary&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Storing information concerning unhandled exceptions may prove to be useful. We can use the Application_Error method located within the Global.asax file. This method will be called when an unhandled exception occurs. You can get information concerning both the exception and the request that caused it. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;Reference &lt;a href="http://dotnethints.com/blog?id=52"&gt;DotNetHints&lt;/a&gt;&lt;/div&gt;&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=75764" width="1" height="1"&gt;</content><author><name>k badas</name><uri>https://www.dotnetzone.gr:443/cs/members/k+badas.aspx</uri></author></entry><entry><title>Facebook &amp; .NET</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2014/09/21/facebook-amp-net.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2014/09/21/facebook-amp-net.aspx</id><published>2014-09-22T00:54:15Z</published><updated>2014-09-22T00:54:15Z</updated><content type="html">&lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;It's been a few years since social networks have become a part of our life. Since people such as celebrity stars and politicians use them, it is no wonder that developers would choose to do so, in their own way. Let's choose Facebook to interact with. We are going to see how we can use .NET to communicate with Facebook API and use it to do things like getting users info or posting on Facebook.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:112px;width:200px;" alt="" src="http://dotnethints.com/admin/gallery/facebook.jpg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Introduction&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;To interact with Facebook we need to have a Facebook application of our own. You can create your own application (similar to my DotNetHints application) through the&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;a style="text-decoration:;color:;" href="https://developers.facebook.com/"&gt;&lt;font color="#67217a"&gt;&lt;font style="text-decoration:none;" face="Segoe UI"&gt;Facebook Developers portal&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/font&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;. Creating the basics is not hard but in case you find yourself in trouble, doing some online research will be more than enough to help you.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;After you have created your application you will notice you are given two IDs. That's the App ID and the App Secret. Note them down as we are going to use them later on in our example. One more interesting thing is the Site URL parameter. You should mark down the URL you are going to use. I have used my local URL since I am going to use my Visual Studio server.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:342px;width:500px;" alt="Facebook application set up" src="http://dotnethints.com/admin/gallery/setup.jpg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;That's all we need for now. We have created a functional Facebook application which we will need to communicate with the Facebook API.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Using the Facebook API&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Supposing we want to create an example which displays the user's name. Here's what are we going to do.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;First thing, we have to redirect to Facebook and ask for the user's permissions. The user will need to log in, in case he is not already (there is no point in getting a person's info if he is not a Facebook member, right?). Then Facebook will ask user if he wants to grant us permission to access his info. The permission message will be different, depending on the info we want to get, and will be asked the first time only. If he accepts, Facebook will response to our website and return a code.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We are then going to use this code to create a web request and in response get an access token, which is different depending on the user and the application and will only work for a short period of time. Once we get hold of this access token we can ask for anything we want, depending on the permission we have requested and the authorization we have been given.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;That's pretty much all there is out there. If this is the first time you are dealing with the Facebook API you may be a bit confused right now, so let's do an example to clear things up.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Getting the code&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We are going to create a simple example using C# which will do nothing more than getting the user's personal info. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;To do so, we will create a Web Form containing a button which will cause everything to happen when clicked and a literal where we will show our info.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;asp&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;:&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;Button&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;runat&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;server&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;ID&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;btnShowPersonalInfo&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;Text&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;Show Personal Info&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;OnClick&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;btnShowPersonalInfo_Click&amp;quot; /&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;asp&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;:&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;Literal&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;span class="Apple-converted-space"&gt;&lt;font color="#0000cd"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;runat&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;server&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;ID&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;PersonalInfo&amp;quot; /&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:59px;width:212px;" alt="" src="http://dotnethints.com/admin/gallery/show%20info%20button.jpg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We will check out the Page_Load method later on. Instead we will first see what happens when the button is clicked.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;protected void&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;btnShowPersonalInfo_Click(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;object&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;sender,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;EventArgs&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;e)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Step 1&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Button is clicked&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Redirecting to Facebook and ask the user for authorization&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Base url&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;facebookAuthorizationURL = authorizationURL;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#2f4f4f"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //FacebookApplicationID&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; facebookAuthorizationURL +=&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;?client_id=&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;+ facebookAppID;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Redirection URL&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; facebookAuthorizationURL +=&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot;&amp;amp;redirect_uri=&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;+ GetRedirectURL();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Permission scope&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; facebookAuthorizationURL +=&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot;&amp;amp;scope=user_about_me&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Response.Redirect(facebookAuthorizationURL,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;true&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;As we said, first thing to do is to get the code from Facebook. In order to get it, we have to redirect to Facebook. The URL's structure looks like this&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;authorizationURL?client_id=MyFacebookAppID&amp;amp;redirect_uri=MyRedirectURI&amp;amp;scope=MyScope&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;1) authorizationURL is a standard URL where we ask for Facebook authorization&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;const string&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;authorizationURL =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;https://graph.facebook.com/oauth/authorize&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;2) client_id is our ApplicationID&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;const string&lt;/font&gt;&lt;/span&gt; facebookAppID =&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot;1541805559......&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;3)redirect_uri is the URI we want Facebook to return the user. This most probably will be the same page where we are right now. In our case we use a simple GetRedirectURL method to remove possible code appearance, which will happen when we finally get our code.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;private string&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;GetRedirectURL()&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Step 1.5&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //URL handling&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //This code is nothing more than a simplistic example of how to remove appearance of &amp;quot;code&amp;quot; in the query string &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;redirectUri = Request.Url.AbsoluteUri;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;if&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;(redirectUri.Contains(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;?code=&amp;quot;&lt;/font&gt;&lt;/span&gt;))&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; redirectUri = redirectUri.Remove(redirectUri.IndexOf(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;?code=&amp;quot;&lt;/font&gt;&lt;/span&gt;));&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;redirectUri;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;4)scope represents what kind of data we ask permission from the user. In our case the scope is &amp;quot;user_about_me&amp;quot;. Other scopes include &amp;quot;publish_stream&amp;quot;, &amp;quot;share_item&amp;quot; etc. In our case &amp;quot;user_about_me&amp;quot; will give as the personal info we want.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So we redirect to Facebook. What goes next? We said that if the user is not logged, he will need to do so.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:245px;width:561px;" alt="Facebook login" src="http://dotnethints.com/admin/gallery/facebook-login.jpg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;After that, he will be asked to give us permission to get his data. At the moment, we are given permissions and Facebook knows about it, so we are not asked a second time. However if next time our application requires different permission scopes the user will need to confirm that permission as well. When permission is given, Facebook will redirect back to our website (redirect_uri) and the query string will contain some extra value, the code.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:210px;width:251px;" alt="Facebook user grant permission" src="http://dotnethints.com/admin/gallery/facebook_permissions.jpg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We can now get our code using &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;code = Request[&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;code&amp;quot;&lt;/font&gt;&lt;/span&gt;];&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Getting the access token&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So far we got ourselves a code. Let's see what we can do with it. We are now getting a new request, this time the one Facebook has created for us. Now, it's time to see our Page_Load method.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;protected void&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;Page_Load(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;object&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;sender,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;EventArgs&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;e)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;if&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;(!IsPostBack)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Step 2&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Getting the access token and our info&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;if&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;(Request[&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;code&amp;quot;&lt;/font&gt;&lt;/span&gt;] !=&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;null&lt;/font&gt;&lt;/span&gt;)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //We enter this part only when we are redirected from Facebook&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //In that case we have the user's code&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;code = Request[&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;code&amp;quot;&lt;/font&gt;&lt;/span&gt;];&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Now we need the access token&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;access_token = GetAccessToken(code);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;if&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;(access_token !=&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; GetPersonalInfo(access_token);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; else&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PersonalInfo.Text =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Sorry, no access_token available.&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;As we see in the Page_Load code, we are going to use a new method called GetAccessToken which does exactly what its name describes. The access token is what we need to access our user's info or post our own info to Facebook. Here's how we get it.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;private string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;GetAccessToken(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;code)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Step 3&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Get the access token&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Base URL&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;urlGetAccessToken = getTokenURL;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Facebook Application ID&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; urlGetAccessToken +=&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot;?client_id=&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;+ facebookAppID;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Facebook Application secret ID&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; urlGetAccessToken +=&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;amp;client_secret=&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;+ facebookAppSecret;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Redirection URL&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; urlGetAccessToken +=&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;amp;redirect_uri=&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;+ GetRedirectURL();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //The code we got a moment ago&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; urlGetAccessToken +=&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;amp;code=&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;+ code;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;responseData = GetWebPageString(urlGetAccessToken);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;if&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;(responseData !=&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Use System.Collections.Specialized;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;NameValueCollection&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;col =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;HttpUtility&lt;/font&gt;&lt;/span&gt;.ParseQueryString(responseData);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;access_token = col[&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;access_token&amp;quot;&lt;/font&gt;&lt;/span&gt;] ==&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;null&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;?&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;: col[&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;access_token&amp;quot;&lt;/font&gt;&lt;/span&gt;];&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;access_token;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; else&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;All we have to do is create a GET request to Facebook. The request's URL should look like&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;getTokenURL?client_id=MyFacebookAppID&amp;amp;client_secret=MyFacebookAppSecret&amp;amp;redirect_uri=MyRedirectURI&amp;amp;code=UserCode&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;1)getTokenURL is a standard URL where we ask for Facebook tokens&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;const string&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt; getTokenURL =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;https://graph.facebook.com/oauth/access_token&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;2)client_id is our ApplicationID&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;const string&lt;/font&gt;&lt;/span&gt; facebookAppID =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;1541805559......&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;3)client_secret is our App Secret&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;const string&lt;/font&gt;&lt;/span&gt; facebookAppSecret =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;0ab63a35ffdd220df...............&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;4)redirect_uri is the URI we want Facebook to return the user the same way we did previously. We are using the GetRedirectURL method once again.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;5)code is the code we got from Facebook in the previous step.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;To create the request we will use the GetWebPageString method introduced in a&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;a style="text-decoration:;color:;" href="http://dotnethints.com/blog?id=49"&gt;&lt;font color="#67217a"&gt;&lt;font style="text-decoration:none;" face="Segoe UI"&gt;previous blog post&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/font&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;private string&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;GetWebPageString(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;targetURL)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Step 3.5&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Create a GET request to facebook &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Create a request to the referenced URL&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;WebRequest&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;request =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;WebRequest&lt;/font&gt;&lt;/span&gt;.Create(targetURL);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Get the response&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;WebResponse&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;response = request.GetResponse();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#2f4f4f"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Create a Stream and StreamReader containing info from the server&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Stream&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;dataStream = response.GetResponseStream();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;StreamReader&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;reader =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#000080"&gt;new&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;StreamReader&lt;/font&gt;&lt;/span&gt;(dataStream);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Get the info&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;responseFromServer = reader.ReadToEnd();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Release resources&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; reader.Close();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; dataStream.Close();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; response.Close();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;responseFromServer;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So we create a GET request to Facebook and we get as a result something like this&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;access_token=CAAV6Q......&amp;amp;expires=5126953&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;which we will treat as a query string&amp;#160; to get the access token through a NameValueCollection.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Congratulations. You are now in possession of the access token. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Go for it&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We finally have the access token. From now on the code may depend on what we want to do. In our case, get the user's personal info. Back to the Page_Load you will notice that after we get the access token, we use the GetPersonalInfo method. Here's the method.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;private void&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;GetPersonalInfo(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;accessToken)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Step 4&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Create a GET request to Facebook in order to get personal info&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //When data is returned we store it into a PersonalInfo object&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;personalInfoURL =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;https://graph.facebook.com/me?access_token=&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;+ accessToken;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;jsonPersonalInfo = GetWebPageString(personalInfoURL);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;if&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;(jsonPersonalInfo ==&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PersonalInfo.Text =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Problem while requesting personal info.&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; else&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Use System.Web.Script.Serialization;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;PersonalInfo&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;info =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;JavaScriptSerializer&lt;/font&gt;&lt;/span&gt;().Deserialize&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;PersonalInfo&lt;/font&gt;&lt;/span&gt;&amp;gt;(jsonPersonalInfo);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; PersonalInfo.Text&amp;#160; = ShowPersonalInfo(info);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The personalInfoURL is quite important as it represents the type of data we want to get from Facebook. Actually the part of interest is the &amp;quot;me/&amp;quot;. Using &amp;quot;me/friends/&amp;quot; instead, for example, would ask for the user's friends list. In the personalInfoURL we also have to add our access token.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Using it, we create one last GET request and then get JSON data in response.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The data in the case of personal info can be deserialized in a PersonalInfo class we create. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;public class&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#008080"&gt;PersonalInfo&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public string&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;id {&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;get&lt;/font&gt;&lt;/span&gt;;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;set&lt;/font&gt;&lt;/span&gt;; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public string&lt;/font&gt;&lt;/span&gt; first_name { &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;get&lt;/font&gt;&lt;/span&gt;; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;set&lt;/font&gt;&lt;/span&gt;; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public string&lt;/font&gt;&lt;/span&gt; last_name { &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;get&lt;/font&gt;&lt;/span&gt;; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;set&lt;/font&gt;&lt;/span&gt;; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public string&lt;/font&gt;&lt;/span&gt; gender { &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;get&lt;/font&gt;&lt;/span&gt;; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;set&lt;/font&gt;&lt;/span&gt;; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public string&lt;/font&gt;&lt;/span&gt; link { &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;get&lt;/font&gt;&lt;/span&gt;; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;set&lt;/font&gt;&lt;/span&gt;; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public string&lt;/font&gt;&lt;/span&gt; locale { &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;get&lt;/font&gt;&lt;/span&gt;; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;set&lt;/font&gt;&lt;/span&gt;; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public string&lt;/font&gt;&lt;/span&gt; name { &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;get&lt;/font&gt;&lt;/span&gt;; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;set&lt;/font&gt;&lt;/span&gt;; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public int&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;timezone { &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;get&lt;/font&gt;&lt;/span&gt;; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;set&lt;/font&gt;&lt;/span&gt;; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;DateTime&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;updated_time { &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;get&lt;/font&gt;&lt;/span&gt;; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;set&lt;/font&gt;&lt;/span&gt;; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public bool&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;verified { &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;get&lt;/font&gt;&lt;/span&gt;; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;set&lt;/font&gt;&lt;/span&gt;; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;After desrializing, we have a PersonalInfo object. ShowPersonalInfo will handle that object and use reflection and a StringBuilder to create an HTML table showing the info we got.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;private string&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;ShowPersonalInfo(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;object&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;info)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Step 5 &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Creating an HTML table to show data using reflection&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;StringBuilder&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;infoText =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;StringBuilder&lt;/font&gt;&lt;/span&gt;(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;lt;table&amp;gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Use System.Reflection;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Type&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;type = info.GetType();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;PropertyInfo&lt;/font&gt;&lt;/span&gt;[] properties = type.GetProperties();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;foreach&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;(&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;PropertyInfo&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;property&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;in&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;properties)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; infoText.Append(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;+ property.Name +&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;+ property.GetValue(info,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;null&lt;/font&gt;&lt;/span&gt;) +&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; infoText.Append(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;lt;/table&amp;gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;infoText.ToString();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Finally, back to the GetPersonalInfo we show the return string using our literal.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;PersonalInfo.Text&amp;#160; = ShowPersonalInfo(info);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;That's all. You should now be able to see a picture like the one following.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:251px;width:479px;" alt="Personal Info" src="http://dotnethints.com/admin/gallery/personalinfo.jpg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;What to do next&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Facebook API offers much data to get depending on your permission scope and reference URLs. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;For example, using &amp;quot;email&amp;quot; in your permission scope and https://graph.facebook.com/me/ you can get JSON data similar to the ones we got earlier yet including user's email as well. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;In that case if we created a new class PersonalInfoAndEmail that inherits our PersonalInfo class but also contains the email attribute&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;public class&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;PersonalInfoAndEmail&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;:&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#008080"&gt;PersonalInfo&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public string&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;email {&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;get&lt;/font&gt;&lt;/span&gt;;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;set&lt;/font&gt;&lt;/span&gt;; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;and deserialize to a PersonalInfoAndEmail object, we would get the following results.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:256px;width:500px;" alt="email personal info" src="http://dotnethints.com/admin/gallery/emailpersonalinfo.jpg" /&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Using &amp;quot;user_friends&amp;quot; in your permission scope and https://graph.facebook.com/me/friends you can get JSON data of the user's friends. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;In my case I get &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&amp;quot;data&amp;quot;:[],&amp;quot;summary&amp;quot;:{&amp;quot;total_count&amp;quot;:355}}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Using &amp;quot;publish_stream&amp;quot; permissions and creating a POST request (instead of the GET we created earlier) to https://graph.facebook.com/me/feed you can post on the user's wall.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;You may read more concerning permissions&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;a style="text-decoration:;color:;" href="http://developers.facebook.com/docs/facebook-login/permissions/v2.1"&gt;&lt;font color="#67217a"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="text-decoration:none;"&gt;here&lt;/font&gt;&lt;span class="Apple-converted-space"&gt;&lt;font style="text-decoration:none;"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face="Segoe UI"&gt;and reference URLs&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;a style="text-decoration:;color:;" href="https://developers.facebook.com/docs/graph-api/reference/v2.1/user"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font style="text-decoration:none;" color="#67217a"&gt;here&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;One last thing of importance has to do with Facebook permission policy. According to Facebook, &amp;quot;Apps requesting more than public_profile, email and the user_friends permission must be reviewed by Facebook before those permissions can be requested from people. Active apps created before April 30th, 2014 have one year before they are required to go through login review, including updates to existing apps. Facebook apps created after April 30th, 2014 must go through review.&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So if you want to create an application in order to post in your users' walls, you have to get through Facebook control first. To do so you will need to select your type of extra requests and then upload photos and write a few paragraphs so the Facebook team will have clear understanding of how you are going to use the permissions you ask and then decide if you do need them or not.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Summary&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Since Facebook is one of the most popular social networks it would be nice if we could use it to enhance our applications. First we need to create a Facebook application. Then we will use this application to get access to the users' info, first by getting a code, then the access token and finally our data. That is, of course, if the user allows us to do so. We can get most of the user's info, depending on the permission level Facebook has granted us.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="border-top:red 0px solid;font-family:;border-right:red 0px solid;white-space:normal;word-spacing:0px;border-bottom:red 0px solid;text-transform:none;color:;border-left:red 0px solid;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;float:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font style="font-size:9.8pt;"&gt;Reference&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;a href="http://dotnethints.com/blog?id=51"&gt;DotNetHints&lt;/a&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:9.8pt;"&gt;&lt;/font&gt;&lt;/div&gt;&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=75712" width="1" height="1"&gt;</content><author><name>k badas</name><uri>https://www.dotnetzone.gr:443/cs/members/k+badas.aspx</uri></author></entry><entry><title>URIs, URLs, URNs and .NET</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2014/07/26/uris-urls-urns-and-net.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2014/07/26/uris-urls-urns-and-net.aspx</id><published>2014-07-26T22:56:51Z</published><updated>2014-07-26T22:56:51Z</updated><content type="html">&lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;URL is a term familiar to a lot of people since the beginning of the internet age. Actually, not every internet user is familiar with that URL thing, but at least there are some knowing that copying some letters from the top of your browser and sending them to a friend might help him in opening the same page in his browser. People who are familiar with the internet may have heard the term URI and know that is something like the URL. Finally there is is another yet term connected with the previous ones; that's the URN. We are going to find what each one of these terms is about, what they are made for and how .NET may help us to handle them. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Introduction&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;A nice way to begin, is by saying what these things are. So here's what each term stands for:&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;URI : Uniform Resource Identifier&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;URL : Uniform Resource Locator&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;URN : Uniform Resource Name&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We can now tell that they are all referring to some uniform resource. Uniform resources can actually be a lot of stuff. An image, as well as a website address can be such a resource.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So they all refer to uniform resources. And what do they tell us about such resources? A URI is an identifier, a URL is a locator and a URN is a name. Even though this may not mean much to you to this point, by the time you reach the bottom of the article you will realize that these names are all the fuss is about.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;URIs&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;As told, the URI is used to identify the resource. What does identify mean? In a few words to say which is the resource we are looking for out of a group of resources.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Supposing there is a resource called Sherlock Holmes. Under that name most people may think of the famous detective created by Arthur Conan Doyle. However can we really be sure that by saying Sherlock Holmes we are referring to the famous detective and not to own of its relatives who may bare the same name? This is where the URI comes in play. The URI will indicate the detective and nothing but that. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:130px;width:116px;" alt="uri sherlock" src="http://dotnethints.com/admin/gallery/sherlocksiluet.gif" /&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So what is &amp;quot;Sherlock Holmes&amp;quot; to the person we have just described? It is his name. In other words Sherlock Holmes would be that resource's URN.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;And what would URL (the locator) be? That might be the way a person in need of detective skills might find Sherlock Holmes, in other words his address. URL would this way be 221B, Baker Street, London, supposing that this address is always uniquely connected to our detective.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Now, let's take a look at the following diagram.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:168px;width:301px;" alt="URI diagram" src="http://dotnethints.com/admin/gallery/uri-diagram.jpg" /&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;A resource can always be identified by a URI. The diagram tells us that a URI may be either a URL or a URN or both. Back to our previous example, this means that the Sherlock Holmes resource can either be identified using its name (URN - Sherlock Holmes) or its location (URL - 221B, Baker Street, London).&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Moving on to our familiar URL.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;URLs&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So what is a URL?&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This can be a url : http://dotnethints.com/&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This can also be a url: http://dotnethints.com/images/uploads/news/new_17.jpg&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;URLs tell us how we can find and obtain the specified resource. Getting the http://dotnethints.com/images/uploads/news/new_17.jpg URL, we know that we may find the picture located within the images/uploads/news path of the root menu. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Keep in mind that dotnethints.com is not a unique URL as more than one URLs could be created depending on the application protocol.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;For example http://dotnethints.com/ is not the same URL as ftp://dotnethints.com/. Each one represents a different URL, URI and resource.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Content negotiation is a case where a URI may end up in different resource versions (different URLs) depending on circumstances. For example an image can be returned as GIF or PNG file in case the client's browser may not support one of them.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;URNs&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So, since URLs work just fine the way we described, why do we need that URN thing? Well, imagine we transferred our website from http://dotnethints.com/ to http://dotnethints_newwebsite.com/. A person who would request http://dotnethints.com/ would get a 404 error. However the resource would still be available online. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;A URL describes the resources based on its location; as a result it creates a connection between them. Now, imagine creating a simple request for our dotnethints.com resource and automatically getting its URL in order to get our resource, no matter where that would be located right now.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;That is the ultimate target of the URNs. Being able to locate all resources based on their names. Till then however let's take a look at what a URN looks like.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;urn:NID:NSS&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Every URN starts with &amp;quot;urn:&amp;quot; followed by NID and NSS (separated by a colon), where NID and NSS stand for the namespace Identifier and the Namespace Specific String respectively. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;For example considering that isbn (International Standard Book Number) is the namespace concerning book standards, a travel guide to Rome which happens to be in my bookcase is uniquely identified by ISBN-13 9781409373162. Romeo and Juliet is also identified by ISBN 0-486-27557-4. That way the URN we could use to identify that book would be urn:isbn:0-486-27557-4. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:212px;width:150px;" alt="urn-shakespeare" src="http://dotnethints.com/admin/gallery/250px-Hw-shakespeare.png" /&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Keep in mind that a URN may contain extra namespaces eg urn:NID1:NID2:NSS&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Namespace Identifiers can also be used in XML Schemas to define namespaces eg &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;xsd&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;:&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;schema&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;xmlns&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;xmlns&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;:&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;xsd&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;targetNamespace&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;urn:some_namespace&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;...&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;And .NET&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Uri is quite a useful class created to describe a uri address. The easiest way to create a Uri object is using the string of the address it represents. For example&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;Uri&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;uri =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Uri&lt;/font&gt;&lt;/span&gt;(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;http://dotnethints.com&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;Uri &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;uri = &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Uri&lt;/font&gt;&lt;/span&gt;(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;http://dotnethints.com/blog?id=47&amp;quot;&lt;/font&gt;&lt;/span&gt;); &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;Uri &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;uri = &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Uri&lt;/font&gt;&lt;/span&gt;(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;urn:dotnethints.com&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;However the following line&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;Uri &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;uri = &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Uri&lt;/font&gt;&lt;/span&gt;(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;dotnethints.com&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;will throw a System.UriFormatException as we cannot turn every possible string into a Uri.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;There are two ways to avoid this exception. First one is to use Uri's&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;em&gt;TryCreate&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/em&gt;method. TryCreate is similar to TryParse method. It will try to create a Uri object using a string. If it fails, the Uri is set to null.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;For example&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;Uri &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;uri =&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Uri&lt;/font&gt;&lt;/span&gt;();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;Uri&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;.TryCreate(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;http://dotnethints.com/blog&amp;quot;&lt;/font&gt;&lt;/span&gt;, &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;UriKind&lt;/font&gt;&lt;/span&gt;.Absolute,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;out&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;uri); &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;creates a proper Uri. However using&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;Uri &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;uri = &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Uri&lt;/font&gt;&lt;/span&gt;();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;Uri&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;.TryCreate(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;dotnethints.com/blog&amp;quot;&lt;/font&gt;&lt;/span&gt;,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;UriKind&lt;/font&gt;&lt;/span&gt;.Absolute, &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;out &lt;/font&gt;&lt;/span&gt;uri); &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;we get a Uri equal to null.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The second way, is to use another Uri method, the&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;em&gt;IsWellFormedUriString&lt;/em&gt;. This method returns true if the string is properly formatted. The following lines will show you how it works.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;uriString =&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot;http://dotnethints.com&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;Uri &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;uri =&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Uri&lt;/font&gt;&lt;/span&gt;();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;if&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Uri&lt;/font&gt;&lt;/span&gt;.IsWellFormedUriString(uriString,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;UriKind&lt;/font&gt;&lt;/span&gt;.Absolute))&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; uri = &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Uri&lt;/font&gt;&lt;/span&gt;(uriString);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;A common way to create the Uri for the current page (in case of ASP.NET applications) is to use Request.Url.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:150px;width:226px;" alt="url-uri" src="http://dotnethints.com/admin/gallery/url-writing.jpg" /&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We can also use the&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;em&gt;UriBuilder&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/em&gt;class in order to create a Uri. Think of UriBuilder as a way of creating Uris separated on parts. For example, scheme, host, path and query refer to the Uri parts respectively. When our UriBuilder object is complete we can use its Uri parameter to create the Uri.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The Uri created in the following example is the same as the one created by&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Uri&lt;/font&gt;&lt;/span&gt;(&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&amp;quot;http://dotnethints.com/blog?id=47&amp;quot;&lt;/font&gt;&lt;/span&gt;).&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;UriBuilder&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;builder =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;UriBuilder&lt;/font&gt;&lt;/span&gt;();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;builder.Scheme =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;http&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;builder.Host =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;dotnethints.com&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;builder.Path =&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot;blog&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;builder.Query =&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot;id=47&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;Uri&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;uri = builder.Uri;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So far we have found out how to create a Uri object. Let's see how we can use it.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The Uri class carries along some interesting parameters, for example AbsolutePath, Query and Segments which make things easier when dealing with uris. The following example shows how usefull the Uri class can be.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;Uri &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;uri = &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Uri&lt;/font&gt;&lt;/span&gt;(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;http://dotnethints.com/blog?id=47&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;URIlit.Text =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;OriginalString : &amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;+ uri.OriginalString;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;URIlit.Text +=&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;lt;br/&amp;gt; AbsolutePath : &amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;+ uri.AbsolutePath;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;URIlit.Text +=&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;lt;br/&amp;gt; PathAndQuery : &amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;+ uri.PathAndQuery;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;URIlit.Text +=&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot;&amp;lt;br/&amp;gt; Query : &amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;+ uri.Query;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;URIlit.Text +=&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot;&amp;lt;br/&amp;gt; Scheme : &amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;+ uri.Scheme;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;URIlit.Text +=&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;lt;br/&amp;gt; DnsSafeHost : &amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;+ uri.DnsSafeHost;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;URIlit.Text +=&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;lt;br/&amp;gt; Segments:&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;foreach&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;segment&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;in&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;uri.Segments)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; URIlit.Text += segment +&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#0000cd"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot; - &amp;quot;;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;OriginalString : http://dotnethints.com/blog?id=47&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;AbsolutePath : /blog&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;PathAndQuery : /blog?id=47&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Query : ?id=47&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Scheme : http&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;DnsSafeHost : dotnethints.com&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Segments:/ - blog -&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Reaching the end of this article we are going to create a method that can handle a uri's query string. The method returns the given Uri having inserted new query string value or replaced the existing one, if present. This example, apart from helping in Uris and UriBuilders better understanding, may also prove practically useful.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160; // Replace or insert proper value into uri's query string&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;private&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Uri &lt;/font&gt;&lt;/span&gt;SetValueInQueryString(&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Uri&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;uri,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;strQueryParameter,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;strQueryValue)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //ParseQueryString returns an encoded NameValueCollection&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;var&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;queryStringValues =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;HttpUtility&lt;/font&gt;&lt;/span&gt;.ParseQueryString(uri.Query);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Insert or update selected name&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; queryStringValues.Set(strQueryParameter, strQueryValue);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Create the new uri using a UriBuilder&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;UriBuilder&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;builder =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;UriBuilder&lt;/font&gt;&lt;/span&gt;(uri);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; builder.Query = queryStringValues.ToString();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;builder.Uri;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Summary&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Urls represent a resource’s location while urns represent its unique name. A Uri can be either a url or a urn. So far, urls are mostly used in comparison to urns. .NET contains the Uri and UriBuilder classes that help us to handle and create uris.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;Reference &lt;a href="http://dotnethints.com/blog?id=50"&gt;DotNetHints&lt;/a&gt;&lt;/div&gt;&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=75580" width="1" height="1"&gt;</content><author><name>k badas</name><uri>https://www.dotnetzone.gr:443/cs/members/k+badas.aspx</uri></author></entry><entry><title>Getting content out of web pages - The WebRequest class</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2014/06/21/getting-content-out-of-web-pages-the-webrequest-class.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2014/06/21/getting-content-out-of-web-pages-the-webrequest-class.aspx</id><published>2014-06-22T03:38:20Z</published><updated>2014-06-22T03:38:20Z</updated><content type="html">&lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;A simple project may be able to do just fine using its local resources, database and nothing but that. However an advanced application may be expected to use distributed resources, such as getting data out of web pages. In that case we need to make requests of our own in order to get that info. .Net contains the WebRequest class which can be quite helpful in such cases. We are going to use WebRequest's methods to get distant info, create a few useful examples and finally find out how we can create asynchronous requests using .Net 4.5.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Using the WebRequest&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;A request could be regarded as a basic part of the web architecture. A client sends a request to the server in order to get data. In return, the server will send the data back to the client.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:323px;width:352px;" alt="create web request" src="http://dotnethints.com/admin/gallery/staticWebPageProcess.gif" /&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We can also create requests using a few lines of code using the WebRequest class.&amp;#160; This is what this article is about. To begin with, we are going to create a simple GET requests to see how we can use it.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;First we need to create a WebRequest object&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;WebRequest&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;request = &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;WebRequest &lt;/font&gt;&lt;/span&gt;.Create(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;http://dotnethints.com&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;A request is by default a GET request. If however we would like to change that we could use the request.Method property.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Now we create the response &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;WebResponse&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;response = request.GetResponse();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So far, so good. Now we are going to get the page response. That's what we wanted in the first place. We will use a Stream and a StreamReader&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;Stream&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;dataStream = response.GetResponseStream();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;StreamReader&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;reader =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;StreamReader &lt;/font&gt;&lt;/span&gt;(dataStream);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;responseFromServer = reader.ReadToEnd();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;responseFromServer is the data we are looking for. However we need to release the resources as soon as we are done.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;reader.Close();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;dataStream.Close();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;response.Close();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;That's all. Let's put it all together and create some C# source code which gets the response from a page requested.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;private string&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;GetWebPageString(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;targetURL)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Create a request to the referenced URL&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;WebRequest &lt;/font&gt;&lt;/span&gt;request = &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;WebRequest &lt;/font&gt;&lt;/span&gt;.Create(targetURL);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Get the response&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;WebResponse &lt;/font&gt;&lt;/span&gt;response = request.GetResponse();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Create a Stream and StreamReader containing info from the server&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Stream &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;dataStream = response.GetResponseStream();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; StreamReader &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;reader = &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;StreamReader &lt;/font&gt;&lt;/span&gt;(dataStream);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Get the info&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string &lt;/font&gt;&lt;/span&gt;responseFromServer = reader.ReadToEnd();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Release resources&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; reader.Close();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; dataStream.Close();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; response.Close();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;responseFromServer;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;For example calling GetRequest(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;http://dotnethints.com&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;); will return the dotnethints home page HTML.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This way we got our HTML info. However this is usually not what we want to do. Most likely we would prefer to get the part of the page which is of interest to us.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Supposing a web page contains the following div&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;div&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;id&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;testDiv&amp;quot;&amp;gt;&lt;/font&gt;&lt;/span&gt;This is a test div&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;div&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;and what we want is to get the HTML contained within the testDiv div.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;In that case we could use a method similar to the following,&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;private string&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;HandleResponse(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;responseText, &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string &lt;/font&gt;&lt;/span&gt;startString, &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string &lt;/font&gt;&lt;/span&gt;endString)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;/font&gt;&lt;/span&gt;[] responseParts = responseText.Split(&lt;font color="#0000cd"&gt;&lt;span style="color:;"&gt;new &lt;/span&gt;&lt;span style="color:;"&gt;string&lt;/span&gt;&lt;/font&gt;[] { startString },&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;StringSplitOptions&lt;/font&gt;&lt;/span&gt;.None);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string &lt;/font&gt;&lt;/span&gt;handledResponse = responseParts[1].Split(&lt;font color="#0000cd"&gt;&lt;span style="color:;"&gt;new &lt;/span&gt;&lt;span style="color:;"&gt;string&lt;/span&gt;&lt;/font&gt;[] { endString },&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;StringSplitOptions&lt;/font&gt;&lt;/span&gt;.None)[0];&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //We could use regular expressions instead&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //string partPattern = startString + &amp;quot;.+&amp;quot; + endString;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Match partMatch = Regex.Match(responseText, partPattern);&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //string handledResponse = partMatch.Groups[0].Value.Remove(0, startString.Length);&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //handledResponse = handledResponse.Remove(handledResponse.Length - endString.Length);&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;handledResponse;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We could now get our the desired info using &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;HandleResponse(GetRequest(&amp;quot;http://dotnethints.com&amp;quot;,&amp;quot;&amp;lt;div id=\&amp;quot;testDiv\&amp;quot;&amp;gt;&amp;quot;, &amp;quot;&amp;lt;/div&amp;gt;&amp;quot;));&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;and get the result we've been expecting.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This is a test div&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So far we created a GET request. In order to create a POST request we will first have to insert the POST parameters inside our HttpWebRequest object. The following piece of code looks like the one we used in the previous GET request. However we will need to set request's Method, ContentType, ContentLength and use a Stream object in order to send our parameters, which we have enclosed within a byte array, to the server.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;private string&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;GetWebPageStringPost(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;targetURL)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Create a request to the referenced URL&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;WebRequest &lt;/font&gt;&lt;/span&gt;request = (&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;WebRequest &lt;/font&gt;&lt;/span&gt;)WebRequest.Create(targetURL);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Set request method&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; request.Method =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;POST&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;formContent =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;par1=1&amp;amp;par1=2&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Set parameters to a byte array&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;byte&lt;/font&gt;&lt;/span&gt;[] byteArray =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Encoding&lt;/font&gt;&lt;/span&gt;.UTF8.GetBytes(formContent);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Set content type and length&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; request.ContentType =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;application/x-www-form-urlencoded&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; request.ContentLength = byteArray.Length;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Use a Stream to send parameters&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Stream&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;dataStream = request.GetRequestStream();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; dataStream.Write(byteArray, 0, byteArray.Length);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; dataStream.Close();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Get the response&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;WebResponse&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;response = request.GetResponse();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; dataStream = response.GetResponseStream();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Create a StreamReader containing info from the server&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;StreamReader&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;reader =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;StreamReader&lt;/font&gt;&lt;/span&gt;(dataStream);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Get the info&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;responseFromServer =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;HttpUtility&lt;/font&gt;&lt;/span&gt;.UrlDecode(reader.ReadToEnd());&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Release resources&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; reader.Close();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; dataStream.Close();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; response.Close();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;responseFromServer;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;A WebRequest example&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;img style="height:112px;width:121px;" alt="dictionary web request" src="http://dotnethints.com/admin/gallery/dictionary.bk.gif" /&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Before we go on, let's take a look at an interesting example. Supposing you want to create a dictionary and you are familiar enough with the Dictionary.com, so you know it is quite trustworthy a website. Doing some research, we find out that the search keyword is placed within the search url in the form of&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;em&gt;http://dictionary.reference.com/browse/search_keyword?s=t&lt;/em&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We also know that the primary result is always placed inside the following HTML code&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;span&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;class&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;dnindex&amp;quot;&amp;gt;&lt;/font&gt;&lt;/span&gt;1.&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;span&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&amp;gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;div&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;class&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;dndata&amp;quot;&amp;gt;&lt;/font&gt;&lt;/span&gt;search_results&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;div&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Using both facts mentioned we can create a simple method that gets a string parameter and returns the primary result.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This is our method&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;private string&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;UseOnlineDictionary(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;keyword)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;HandleResponse(GetWebPageString(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;http://dictionary.reference.com/browse/&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;+ keyword +&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;?s=t&amp;quot;&lt;/font&gt;&lt;/span&gt;),&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;lt;span class=\&amp;quot;dnindex\&amp;quot;&amp;gt;1.&amp;lt;/span&amp;gt;&amp;lt;div class=\&amp;quot;dndata\&amp;quot;&amp;gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;,&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot;&amp;lt;/div&amp;gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Using the following code&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Response.Write(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;dot: &amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;+ UseOnlineDictionary(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;dot&amp;quot;&lt;/font&gt;&lt;/span&gt;));&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Response.Write(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;lt;br/&amp;gt;net: &amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;+ UseOnlineDictionary(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;net&amp;quot;&lt;/font&gt;&lt;/span&gt;));&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Response.Write(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;lt;br/&amp;gt;hint: &amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;+ UseOnlineDictionary(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;hint&amp;quot;&lt;/font&gt;&lt;/span&gt;));&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;we get&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;dot: a small, roundish mark made with or as if with a pen.&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;net: a bag or other contrivance of strong thread or cord worked into an open, meshed fabric, for catching fish, birds, or other animals: a butterfly net.&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;hint: an indirect, covert, or helpful suggestion; clue: Give me a hint as to his identity.&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We have succeeded in creating a simple dictionary!&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Well, our dictionary will not be effective all the time as Dictionary.com does not always create the HTML format we presumed it does. For the sake of our example however we do not take all possible results and error handling into account .&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Keep in mind that web pages are usually followed by privacy issues. You may probably not be allowed to use directly or copy the content of a web page in case the author is not aware of it. Thus, the previous dictionary example, no matter how simple or useful it may seem, is not suggested to be of use none other than development practice.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Getting web pages info asynchronously&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We have already covered how to make asynchronous calls in a&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;a style="text-decoration:;color:;" href="http://dotnethints.com/blog?id=32"&gt;&lt;font color="#67217a"&gt;&lt;font style="text-decoration:none;" face="Segoe UI"&gt;previous article&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;&lt;/font&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;. If you are not familiar with asynchronous operations I'd suggest you take a look before going any further. Moving on let's do the previous dictionary example in a WPF manner.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;GetStringAsync is a method contained within the HttpClient class. It will cause an asynchronous request. We are going to use the Result parameter to get the response HTML following our request.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;All we need is a TextBox named KeywordTextBox, a Label named ResultsLabel and a Button that calls the GetResultsButton_Click method. The user may insert his keyword in the KeywordTextBox and when the button is pressed he may get his results in the ResultsLabel. This time however, the request will be executed asynchronously. While we wait for the response to get to us we may use that valuable time to compute other staff.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;In just a few words, when using asynchronous operations a method marked as async may use the await keyword to stop the code executing till all previous asynchronous methods are completed.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Here's the source code.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // State the method as async, so you can use the await keyword&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;private void&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;GetResultsButton_Click(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;object&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;sender,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;RoutedEventArgs&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;e)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; CreateAsyncRequest();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;private async&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Task&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;CreateAsyncRequest()&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;keyword = KeywordTextBox.Text;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //pageHTML will contain all page HTML&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;pageHTML =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;await&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;GetDictionaryAsync(keyword);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Show results&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;if&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;(pageHTML !=&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ResultsLabel.Content = HandleResponse(pageHTML,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;lt;span class=\&amp;quot;dnindex\&amp;quot;&amp;gt;1.&amp;lt;/span&amp;gt;&amp;lt;div class=\&amp;quot;dndata\&amp;quot;&amp;gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;lt;/div&amp;gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; else&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //In case sth goes wrong with the GetDictionaryAsync we get an empty string&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ResultsLabel.Content =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Something went wrong. Please try again.&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;private async&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Task&lt;/font&gt;&lt;/span&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;string&lt;/font&gt;&lt;/span&gt;&amp;gt; GetDictionaryAsync(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;keyword)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; try&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;HttpClient&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;client =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;HttpClient&lt;/font&gt;&lt;/span&gt;();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Create asynchronous operation&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //We are going to get the content of the dictionary web page asynchronously&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Task&lt;/font&gt;&lt;/span&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;/font&gt;&lt;/span&gt;&amp;gt; getDotNetHintsStringTask = client.GetStringAsync(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;http://dictionary.reference.com/browse/&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;+ keyword +&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;?s=t&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //The method will still run at the same time as the asynchronous operation&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ComputeOtherStuff();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Here the method must wait for the response to complete&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;await&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Task&lt;/font&gt;&lt;/span&gt;.WhenAll(getDotNetHintsStringTask);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;getDotNetHintsStringTask.Result;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; catch&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;private void&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;ComputeOtherStuff()&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ResultsLabel.Content =&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot;Getting data . . . In the meanwhile several operations are executed.&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Get the part of the page we are interested in.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;private string&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;HandleResponse(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;/font&gt;&lt;/span&gt; responseText, &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;/font&gt;&lt;/span&gt; startString, &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;/font&gt;&lt;/span&gt; endString)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;/font&gt;&lt;/span&gt;[] responseParts = responseText.Split(new &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;/font&gt;&lt;/span&gt;[] { startString },&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;StringSplitOptions&lt;/font&gt;&lt;/span&gt;.None);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;/font&gt;&lt;/span&gt; handledResponse = responseParts[1].Split(new &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;/font&gt;&lt;/span&gt;[] { endString },&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;StringSplitOptions&lt;/font&gt;&lt;/span&gt;.None)[0];&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;handledResponse;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This is the way the example works.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:427px;width:601px;" alt="get data synchronous" src="http://dotnethints.com/admin/gallery/GetDataAsynchronous.jpg" /&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Summary&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;WebRequest is a useful class that helps us create requests using .Net code. We can create both GET and POST requests and then get the response HTML using a stream object. Using .Net 4.5&amp;#160; we can create asynchronous requests so that we can continue working till the response is complete.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;Reference &lt;a href="http://dotnethints.com/blog?id=49"&gt;DotNetHints&lt;/a&gt;&lt;/div&gt;&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=75499" width="1" height="1"&gt;</content><author><name>k badas</name><uri>https://www.dotnetzone.gr:443/cs/members/k+badas.aspx</uri></author></entry><entry><title>Garbage collection and memory management.</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2014/06/01/garbage-collection-and-memory-management.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2014/06/01/garbage-collection-and-memory-management.aspx</id><published>2014-06-02T04:38:32Z</published><updated>2014-06-02T04:38:32Z</updated><content type="html">&lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Garbage collection is an essential part of .Net architecture since it saves you from the trouble of managing the memory parts you have already used.&amp;#160; We are going to see what garbage collection actually is and what may cause it. Next we'll check out how we can manage memory parts ourselves and talk about the disposed pattern.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Introduction&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Garbage collection was one of the first things I heard of when started learning .Net. Even so, it's been some time since then that I got the first idea of what garbage collection is about, as most developers were not interested in how it works. Since garbage collection and memory allocation is not a part of a typical .Net developer and &amp;quot;it ain't broke&amp;quot; it doesn't sound like it &amp;quot;needs to be fixed&amp;quot;. However a developer who likes to know how things work, may find this article quite interesting, as it forms a simple description of what happens under the hood while our programs keep running.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The stack and the heap&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This is an older article where I talk about memory allocation in detail. Let's just go through the basics and see how things are stored in memory, so we can see how things are removed from memory later on.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;A .Net application gets a part of the available memory and uses it as its own. This part is called virtual memory and even though it can be much larger in 64-bit systems than mere 4GB in 32-bit systems, it will always be limited.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Information is stored in two parts of the virtual memory, called the stack and the heap. The stack stores value data types. On the contrary, the heap stores reference data types.&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Supposing we wanted to create an integer value &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;int&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;int1 = 0;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;that value would be stored to the stack.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Now, if we wanted to create a class object&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;ReferenceTypeClass&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;object1=&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;ReferenceTypeClass&lt;/font&gt;&lt;/span&gt;();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;we would create a reference to the stack pointing to some certain point of the heap where we would store the actual object info.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:128px;width:426px;" alt="The stack and the heap" src="http://dotnethints.com/admin/gallery/garbage-stack-heap.jpg" /&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Actually the heap consists of two types, the small object heap and the large object heap. Objects are by default stored in the small object heap unless they are larger than 85000 bytes, in which case they are stored in the large object heap. These types of heaps are no different to the garbage collector so we will refer to both in the same way; heap.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Stack memory allocation&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So, information is stored both on the stack and the heap. Since the stack seems to be simpler than the stack, let's do this first.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Stack values are stored the way a simple stack would. From bottom to top. However the stack can only take up to 1 MB of data. Exceeding this limit will result in StackOverflow and I guess it is quite clear at that point why this exception is called that way.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;To avoid this endless info flow .Net uses a stack pointer. This is nothing more than a simple pointer to the next available memory place. So, if I create some integer, the stack pointer will rise by 4 bytes etc. However when a variable stored in the stack goes out of scope, the memory where it's value was stored is no longer useful and the stack pointer will fall down to the place where our integer was stored. There, it will wait till a new variable is created and overwrite the old integer's value. That way, the same memory parts will be used again and again thus causing the StackOverflow far less possible to be thrown.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;A variable goes out of scope when it can no longer be used in our source code. Here's an example.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;bool&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;getValueFromCookie = GetValueFromCookie();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;int&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;unencryptedValue = 0;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(getValueFromCookie)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;HttpCookie&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;cookie = Request.Cookies[&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;EncryptedValue&amp;quot;&lt;/font&gt;&lt;/span&gt;];&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt; if&lt;/font&gt;&lt;/span&gt;(cookie !=&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;null&lt;/font&gt;&lt;/span&gt;)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int&lt;/font&gt;&lt;/span&gt; encryptedValue = (&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int&lt;/font&gt;&lt;/span&gt;)cookie[&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;EncryptedValue&amp;quot;&lt;/font&gt;&lt;/span&gt;]&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; unencryptedValue = UnencryptInteger(encryptedValue);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;span class="Apple-tab-span" style="white-space:nowrap;"&gt;&lt;font style="font-size:10.5pt;"&gt; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;int&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt; newInteger = 0;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We have stored an encrypted integer within a cookie. To get it back we check if getValueFromCookie is true, and then we use UnencryptInteger to unencrypt the stored value. This example contains three value types. getValueFromCookie, unencryptedValue and encryptedValue. However the encryptedValue's scope extends far less than the other two variables'. This is because encryptedValue exists only within the if(cookie != null) brackets. When the code reaches the closing bracket the stack pointer will move to the point where the encryptedValue is stored in the stack. The next command, (int newInteger = 0;) will cause this new variable to be placed on that position.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Heap memory allocation - Garbage collection&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The heap (also known as managed heap) uses its own pointer, the heap pointer. In contrast to the stack, the heap will keep moving the heap pointer to the next free memory part when a new object is created. Using the same way as the stack to move the heap pointer up and down would be no good as, due to the objects' size diversity, it wouldn't be easy for the heap pointer to find the position suitable to all new objects. As a result the heap pointer always points to the next available memory part.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Repeating the same procedure for many objects the heap pointer would eventually reach the end of the heap. In order to avoid this, CLR will cause a garbage collection when the heap pointer surpasses an accepting threshold (this threshold can be adjusted while the application runs). Garbage collection will probably clear some part of the heap and allow the application to move on. Here's how it works.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;When an object gets out of scope its connection between the stack and the heap is lost, much like it would happen if we had set that object to null. When garbage collection is initialized it searches for objects whose connections are dropped. (We could also say that garbage collection searches for objects without roots. Roots represent the location of the objects in the heap.) The memory these objects required is released. When this procedure is completed, the remaining parts are combined so that they form a solid part of the memory. The heap pointer is then placed on top of that part waiting for the next object to be stored.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;In the following image there are two examples of garbage collection. In the first one object1 is set to null. In the second, it is object11 that is set to null.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:359px;width:956px;" alt="garbage collection" src="http://dotnethints.com/admin/gallery/garbagecollection.jpg" /&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Keep in mind you can initialize the garbage collection yourselves by calling System.GC.Collect. However you are not advised to do so as the garbage collector and your application cannot both run at the same time.&amp;#160; So, unless you are really sure there are many objects that need to be removed right now, (and not when CLR thinks it's time to do so) you may chose to do so. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Generations&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Some interesting part concerning garbage collections is the way it separates older from younger objects. The heap is separated into three sections called generations. Generation 0, 1 and 2.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;When an object is created, it is placed into the generation 0 section. The heap gets filled with objects this way until the generation 0 threshold is reached. This is when garbage collection is initialized. When the garbage collection is over, all survival objects will be compacted and moved to the generation 1 section.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;At the moment the generation 0 section is empty. When the next garbage collection shows up, the new remaining objects will be transferred to generation 1 section and all remaining objects formerly in generation 1 will be moved to generation 2 section. The story goes on the same way. Objects stored in generation 2 section surviving the garbage collection will simply be compacted in the same section until the time comes when they will be released.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Destroying objects&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Most people have heard that every class apart from the very popular constructor may have a destructor, even though most of them haven't had the chance to use it. A destructor is nothing more than a method named after ~Class_Name. This method can only be called automatically when an object is destroyed (removed from the heap) or the program terminates. For example when an object is destroyed, you may want to change some values in your class. Behind the scenes, a destructor will fire the Finalize method, which is mostly used in languages like C++. That's why the destructors are also called finalizers by some developers.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Here's an example where we see a simple destructor in action.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;protected void&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;Page_Load(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;object&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;sender,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;EventArgs&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;e)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;TerminatingClass&lt;/font&gt;&lt;/span&gt;.status =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; UseGarbageCollector();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Show results&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ProgressLiteral.Text = &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;TerminatingClass&lt;/font&gt;&lt;/span&gt;.status;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt; private void&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;UseGarbageCollector()&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;TerminatingClass&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;t =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;TerminatingClass&lt;/font&gt;&lt;/span&gt;();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Set t to null so it does not survive garbage collection&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; t =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;null&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System.&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;GC&lt;/font&gt;&lt;/span&gt;.Collect();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Wait for two seconds so the garbage collection is completed&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Thread&lt;/font&gt;&lt;/span&gt;.Sleep(2000);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;class&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;TerminatingClass&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;:&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#008080"&gt;IDisposable&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;static public string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;status;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;TerminatingClass()&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; status +=&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Constructor&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; ~TerminatingClass()&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; status +=&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot; - Destructor&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We will use a string static variable to keep track of which methods are called.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;First we create a TerminatingClass object. Then it is set to null and we cause garbage collection. (If t was not null, it would have survived the garbage collection). Then we wait two seconds for the garbage collection to finish and the destructors to be called.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The result in our page is&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Constructor - Destructor &lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;as expected.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Now here's a nice quote I've heard concerning garbage collection: &amp;quot;Garbage collection is simulating a computer with an infinite amount of memory&amp;quot;. What this means is that even though your computer may have limited memory resources, the fact that the garbage collection allows you to use the same resources again and again makes it seem like there's no end (unless you get OutOfMemory or StackOverflow exceptions). So, what the garbage collection does is manage the memory when such a thing has to be done. Supposing we had created a destructor expecting to work for some object of ours. In case the amount of memory was large enough the garbage collector might never occur. So, presuming that garbage collection will always occur at least once is not accurate. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;When an object whose class contains a destructor is created an instance is also created in the Finalize queue pointing that when this object is about to be removed from memory there are some things that need to be done first. When such an object is about to be removed through garbage collection, it is not; instead due to the Finalize queue the destructor code will be executed. Next time the garbage collection occurs, is when that object will be removed. Keeping that in mind we can tell that creating destructors may slow down the garbage collection.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Considering that a destructor cannot be called whenever you want among all that we have said, you can see why destructors are not much used any more. Instead most developers have turned to the disposed pattern.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Disposing of objects&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;A class implementing the IDisposable interface, must contain a Dispose method. This method can either be used directly or by placing the object within a using statement. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Dispose is generally used to get rid of resources connected to an objected. For example instead of writing&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;SqlConnection&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;con =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;SqlConnection&lt;/font&gt;&lt;/span&gt;(connectionString);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;con.Close();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;we could write &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;SqlConnection&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt; con = &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;SqlConnection&lt;/font&gt;&lt;/span&gt;(connectionString);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;con.Dispose();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;as SqlConnection's Dispose method will call the Close method itself.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;quot;using&amp;quot; is a keyword which allows a reference variable to be used within (but not outside) the following brackets. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;For example&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;using&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;(&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;SqlConnection&lt;/font&gt;&lt;/span&gt; con = &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;SqlConnection&lt;/font&gt;&lt;/span&gt;())&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160; // do stuff&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Here's the catch. Dispose will now be called when this object goes out of scope, even if an exception occurs. That way you avoid the try catch you would need before using con.Close() or con.Dispose()&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;An example follows on, similar to the previous, showing how a dispose method works.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;   &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;protected void &lt;/font&gt;&lt;/span&gt;Page_Load(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;object&lt;/font&gt;&lt;/span&gt; sender, &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;EventArgs&lt;/font&gt;&lt;/span&gt; e)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;TerminatingClass&lt;/font&gt;&lt;/span&gt;.status = &lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; DisposeObject();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Show results&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;    &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ProgressLiteral.Text = &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;TerminatingClass&lt;/font&gt;&lt;/span&gt;.status;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt; &lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;private void&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;DisposeObject()&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;using&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;(&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;TerminatingClass&lt;/font&gt;&lt;/span&gt; t =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;TerminatingClass&lt;/font&gt;&lt;/span&gt;())&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //use t object to do stuff&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //some_object.Dispose() works as well&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //TerminatingClass t = new TerminatingClass();&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //t.Dispose();&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;   &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;class&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;TerminatingClass&lt;/font&gt;&lt;/span&gt; : &lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#008080"&gt;IDisposable&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;static public string &lt;/font&gt;&lt;/span&gt;status;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public&lt;/font&gt;&lt;/span&gt; TerminatingClass()&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; status += &lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Constructor&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt; &lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;public&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;void&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;Dispose()&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; status +=&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot; - Dispose&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Now the result is &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Constructor - Dispose&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Destructors or Dispose?&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;A destructor is not the same as calling Dispose method. A destructor will be called by garbage collector, Dispose will be called either directly or when out of scope. When an object is disposed it is not removed from memory. Calling Dispose will do nothing more than calling dispose. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;A combination of the previous methods&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;&lt;font style="font-size:10.5pt;"&gt;TerminatingClass&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt; t = &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new&lt;/font&gt;&lt;/span&gt;&amp;#160;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;TerminatingClass&lt;/font&gt;&lt;/span&gt;();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; t.Dispose();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; t =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;null&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; System.&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;GC&lt;/font&gt;&lt;/span&gt;.Collect();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#008080"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Wait for two seconds so the garbage collection is completed&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Thread&lt;/font&gt;&lt;/span&gt;.Sleep(2000);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;will result in &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Constructor - Dispose - Destructor&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;As said, a disposed object is not removed from memory. That is what the garbage collection looks after.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Using Dispose seems to be a better way to handle such issues than using destructors, However you may choose to use both methods should you wish to cover all possible cases.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Summary&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Garbage collection is the way .Net releases no more needed memory resources and is initialized when the CLR thinks it is needed. We can create destructors containing code that will run when the object is about to be removed from memory. Implementing the IDisposable interface, classes may use the Dispose method to release resources much easier.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&amp;#160;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;Reference &lt;a href="http://dotnethints.com/blog?id=48"&gt;DotNetHints&lt;/a&gt;&lt;/div&gt;&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=75443" width="1" height="1"&gt;</content><author><name>k badas</name><uri>https://www.dotnetzone.gr:443/cs/members/k+badas.aspx</uri></author></entry><entry><title>Strange little thing called postback.</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2014/05/10/strange-little-thing-called-postback.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2014/05/10/strange-little-thing-called-postback.aspx</id><published>2014-05-10T19:38:50Z</published><updated>2014-05-10T19:38:50Z</updated><content type="html">&lt;p style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;/p&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;I guess that most people know what postback is. Well, at least most developers that have been using ASP.NET Web Forms. If so, you know that postback is an essential part of your application. In this article we are going to search in depth what postback actually is, how it is created and how it can be used in combination with other parts of web applications.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Brings back memories&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Probably the first time you heard of postback was when you tried to create a DropDownList the way it is in the following&amp;#160; example.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;asp&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;:&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;DropDownList&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;span class="Apple-converted-space"&gt;&lt;font color="#0000cd"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;runat&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;server&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;ID&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;DropDownListID&amp;quot; /&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;asp&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;:&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;Button&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;runat&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;server&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;Text&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;Click&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;OnClick&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;ButtonClicked&amp;quot; /&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;asp&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;:&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;Label&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;runat&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;server&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;ID&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;LabelID&amp;quot; /&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;protected void&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;Page_Load(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;object&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;sender,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;EventArgs&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;e)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; DropDownListID.Items.Add(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Element 1&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; DropDownListID.Items.Add(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Element 2&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;protected void&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;ButtonClicked(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;object&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;sender,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;EventArgs&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;e)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; LabelID.Text =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Selected &amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;+ DropDownListID.SelectedValue;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Feeling proud at how you managed to capture the DropDownList's value and print it, you might have suddenly realized that your list contained two more elements than before. Troubled, you might have probably asked some senior developer in order to get an answer; you should use the IsPostBack parameter.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:103px;width:289px;" alt="ispostback" src="http://dotnethints.com/admin/gallery/ispostback.jpg" /&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;if&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;(!IsPostBack)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; DropDownListID.Items.Add(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Element 1&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; DropDownListID.Items.Add(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Element 2&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;And suddenly, it worked. That's some magic here.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:73px;width:284px;" alt="ispostback2" src="http://dotnethints.com/admin/gallery/ispostback2.jpg" /&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This may have been the first time you heard about postback. You heard that the IsPostBack is a property that is always false the first time you request a page but is true when an event causes postback, for example clicking a button. Later on you found out that there are web controls like the DropDownList you had already seen, which could be set events like OnSelectedIndexChanged so if a postback happened. they would cause certain methods to occur. There was an AutoPostBack parameter as well which could cause a postback of its own. In that way whenever you picked a new element in the list you created a postback.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Later on you found out that there exists something called viewstate and that this viewstate carried along with it all the values your server controls contained. This viewstate was sent back to the server when a postback request was created and this way the server could find out that you had either chosen Element 1 or Element 2. Because that value was automatically stored&amp;#160; within the viewstate. That was great.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Later on you heard people arguing that this great thing called viewstate was not&amp;#160; so great after all as it could grow that big that could slow down the request and in total the response time. Then people started disabling viewstate whenever they could do so and talking about ASP.NET MVC and using pure JavaScript to create their requests. No matter how this discussion ended, about that time there may be a day when you look at yourself at the mirror and wonder &amp;quot;What the heck is this postback that I've been using for so long?&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Even though only a few or none of the above may have occurred to you, we are now ready to see what is actually happening during a postback.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Postback in action&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Let's create one more DropDownList control&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;asp&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;:&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;DropDownList&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;runat&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;server&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;ID&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;DropDownListID&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;OnSelectedIndexChanged&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;IndexChanged&amp;quot;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;asp&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;:&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;ListItem&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;Text&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;Item 1&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;Value&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;1&amp;quot; /&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;asp&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;:&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;ListItem &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;Text&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;Item 2&amp;quot; &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;Value&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;2&amp;quot; /&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;asp&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;:&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;DropDownList &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This server control will be rendered into a simple select HTML code &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;select name=&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;DropDownListID&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&amp;quot; id=&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;DropDownListID&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;option selected=&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;selected&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&amp;quot; value=&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;1&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;&amp;gt;Item 1&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;/option&lt;/font&gt;&lt;/span&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;option value=&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;2&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;&amp;gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;Item 2&lt;/font&gt;&lt;/span&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;/option&lt;/font&gt;&lt;/span&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;/select&lt;/font&gt;&lt;/span&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So far so good. What we are actually interested in, is the effect of the AutoPostBack parameter. Let's add AutoPostBack=&amp;quot;true&amp;quot; to the control. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The new HTML code consists of some interesting staff.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;   &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;select name=&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;DropDownListID&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&amp;quot; &lt;/font&gt;&lt;/span&gt;onchange=&amp;quot;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;BLOCKED SCRIPTsetTimeout(&amp;amp;#39;__doPostBack(\&amp;amp;#39;DropDownListID\&amp;amp;#39;,\&amp;amp;#39;\&amp;amp;#39;)&amp;amp;#39;, 0)&lt;/font&gt;&lt;/span&gt;&amp;quot;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt; id=&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;DropDownListID&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;option selected=&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;selected&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&amp;quot; value=&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;1&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;&amp;gt;Item 1&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;/option&lt;/font&gt;&lt;/span&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;option value=&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;2&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;&amp;gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;Item 2&lt;/font&gt;&lt;/span&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;/option&lt;/font&gt;&lt;/span&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;/select&lt;/font&gt;&lt;/span&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt; &lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;First thing to notice is the presence of a JavaScript call&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;onchange=&amp;quot;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;BLOCKED SCRIPTsetTimeout(&amp;amp;#39;__doPostBack(\&amp;amp;#39;DropDownListID\&amp;amp;#39;,\&amp;amp;#39;\&amp;amp;#39;)&amp;amp;#39;, 0)&lt;/font&gt;&lt;/span&gt;&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This command will call the __doPostBack function. If we perform some HTML decoding in the previous line, we are calling __doPostBack('DropDownListID',''). This __doPostBack function is automatically inserted in the code by the ASP.NET&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;script&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;type&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;//&amp;lt;![CDATA[&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;var&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;theForm = document.forms[&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;'form1&lt;/font&gt;&lt;/span&gt;'];&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;if&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(!theForm) {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; theForm = document.form1;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;function&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;__doPostBack(eventTarget, eventArgument) {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;if&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;(!theForm.onsubmit || (theForm.onsubmit() !=&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;false&lt;/font&gt;&lt;/span&gt;)) {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; theForm.__EVENTTARGET.value = eventTarget;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; theForm.__EVENTARGUMENT.value = eventArgument;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; theForm.submit();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;//]]&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;script&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:211px;width:531px;" alt="automatic postback" src="http://dotnethints.com/admin/gallery/AutomaticPostBack.png" /&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;And what it actually does is submitting the form having __EVENTTARGET.value equal to 'DropDownListID' and __EVENTARGUMENT.value equal to '', in our case.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;That's all concerning the client part. Now the request is sent to the server.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;To begin with, keep in mind that a postback is always caused by a POST request. However creating your own POST request code will not set IsPostBack to true.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Now, let's see what the server will do next. Request.Form, contains info sent to the server in case of a POST request.. It contains a lot of stuff such as viewstate. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Two interesting parts are __EVENTTARGET and __EVENTARGUMENT which we already saw while viewing client side. You may be right to think that this info is transferred all the way to the server.&amp;#160; __EVENTTARGET&amp;#160; contains the ID of the control which caused the postback, while __EVENTARGUMENT contains the info it contains.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;That's the way server knows which control caused the postback and is able find the proper method to call. A postback will cause the event handlers specified to the control, raised. In the example, the postback will call the IndexChanged method. This method will be set to the page life cycle position saved for controls events. That is after Page_Load and before Page_PreRender.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Let's see how we can use&amp;#160; __EVENTTARGET and __EVENTARGUMENT to find out which control caused the postback or what the arguments are using &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;(IsPostBack)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;if&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;(!&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;String&lt;/font&gt;&lt;/span&gt;.IsNullOrEmpty(Request.Form[&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;__EVENTTARGET&amp;quot;&lt;/font&gt;&lt;/span&gt;]))&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;ControlID = Page.Request.Params[&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;__EVENTTARGET&amp;quot;&lt;/font&gt;&lt;/span&gt;];&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Control&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;postbackControl = Page.FindControl(ControlID);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;(Request.Form[&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;__EVENTARGUMENT&amp;quot;&lt;/font&gt;&lt;/span&gt;] !=&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;null&lt;/font&gt;&lt;/span&gt;)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;argumentID = Page.Request.Params[&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;__EVENTARGUMENT&amp;quot;&lt;/font&gt;&lt;/span&gt;];&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Knowing which control caused the postback may sometimes save time from refreshing data, in case you may not need to. Something like the next piece of code could save a few seconds of your response time.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;(!IsPostBack)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Retrieve and compute data&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;else if&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;(!&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;String&lt;/font&gt;&lt;/span&gt;.IsNullOrEmpty(Request.Form[&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;__EVENTTARGET&lt;/font&gt;&lt;/span&gt;&amp;quot;]))&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (Page.Request.Params[&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;__EVENTTARGET&amp;quot;&lt;/font&gt;&lt;/span&gt;] !=&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;DropDownListID&amp;quot;&lt;/font&gt;&lt;/span&gt;)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Retrieve and compute refreshed data&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; else&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //You do not need to refresh data. Just use viewstate&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;In the example, __EVENTARGUMENT is an empty string. Other types of postback do not end up that way. Intentionally we could call the __doPostBack method ourselves and use the arguments we like.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Server controls such as Buttons may cause direct postbacks without JavaScript. For example a button may be rendered as &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#a52a2a"&gt;input&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;type&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;submit&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;value&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;Click me&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;name&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;ctl02&amp;quot;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Such a postback would contain no values in __EVENTTARGET or __EVENTARGUMENT.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;How do we know which control caused the postback then, if __EVENTTARGET&amp;#160; is empty? &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Remember our button?&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;   &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;asp&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;:&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;Button &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;runat&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;server&amp;quot; &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;Text&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;Click&amp;quot; &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;OnClick&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;ButtonClicked&amp;quot; /&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;If we clicked that, the Request.Form would contain something like this ,,,&amp;amp;Button1=Click&amp;amp;,,,&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This is the way to go on.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;In the previous method we should add&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;     &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;if &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(!&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;String&lt;/font&gt;&lt;/span&gt;.IsNullOrEmpty(Request.Form[&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;__EVENTTARGET&amp;quot;&lt;/font&gt;&lt;/span&gt;]))&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;      &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;      &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string &lt;/font&gt;&lt;/span&gt;ControlID = Page.Request.Params[&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;__EVENTTARGET&amp;quot;&lt;/font&gt;&lt;/span&gt;];&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;      &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Control &lt;/font&gt;&lt;/span&gt;postbackControl = Page.FindControl(ControlID);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;      &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;   &lt;/div&gt;    &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;else&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;    &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;     &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;foreach&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;controlID&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;in&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;Request.Form)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;      &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;      &lt;div&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Check all possible info within the form&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;      &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Control&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;objControl = Page.FindControl(controlID);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;      &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;if&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;(objControl is&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Button&lt;/font&gt;&lt;/span&gt;)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;      &lt;div&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //If it is a button, this is what you are looking for&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;      &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;      &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;buttonControlID = objControl.ID;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;      &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;break&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;      &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;      &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;   &lt;/div&gt;    &lt;div&gt;     &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;   &lt;/div&gt; &lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Finally, keep in mind that you can create your own custom controls which can create and handle postbacks the way you want.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Avoid postback if possible&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Postback is usually great, but it may sometimes cause trouble. The faster a page responds the better a website feels. Even though there may be hundreds of things you could do to speed up your website you should always keep in mind that excessive use of postbacks may backfire.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Postbacks allow you to have server side control over your page but that will cause a new request to be sent and a new response to wait upon. That request will carry all the viewstate info along with it. Let alone the fact that possible client JavaScript calls will be reset. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:250px;width:250px;" alt="avoid postback" src="http://dotnethints.com/admin/gallery/too-much-data-300x300.jpg" /&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;A postback is NOT user friendly, therefore it should be used only when necessary. That means, when you need to do something which cannot be done client sided. For example a redirect can be done using a Hyperlink server control or a button. The Hyperlink will be rendered into an HTMLAnchor control and send a brand new request to the server asking for the new page and take it back. On the contrast, the button will cause a postback (carrying the viewstate info along) run through all the handlers till it reaches the button event handler and then redirect. Even better we could straight away use an HTMLAnchor control. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;In order to make a part of the page disappeardisapear we could use JavaScript or make a postback and set its visible parameter to false. You should always go for the JavaScript whenever you can.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;To change the data in your page, you need not cause a postback. Use AJAX instead. Keep in mind that AJAX can't be the key to the solution all the time. You should know when it is best to be used.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;You may also try to reduce the total viewstate size if there are controls which do not need viewstate. You can set their EnableViewState property to false. EnableViewState is by default set to true.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Summary&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Postback is an ASP.NET technique which helps us create a request carrying viewstate info back to the server, in order to create a new response. It uses client side JavaScript to submit the HTML form and will set the IsPostBack parameter to true. We can use the submitted form to get info concerning the postback. Even though postback may prove to be useful, it should be avoided when possible as it may decrease our websites speed.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Reference &lt;a href="http://dotnethints.com/blog?id=36"&gt;DotNetHints&lt;/a&gt;&lt;/p&gt;&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=75352" width="1" height="1"&gt;</content><author><name>k badas</name><uri>https://www.dotnetzone.gr:443/cs/members/k+badas.aspx</uri></author></entry><entry><title>Delegates</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2014/04/16/delegates.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2014/04/16/delegates.aspx</id><published>2014-04-17T06:58:54Z</published><updated>2014-04-17T06:58:54Z</updated><content type="html">&lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Delegates are a way to handle methods in a different way than we are used to. They comprise a basic part of the .Net architecture and are important in order to use technologies like lambda expressions.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;What is a delegate?&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;A delegate is a reference type which can be used as a connection between that and the methods it is assigned. Think of it as a reference type for methods. In a few words, we can create the WriteSthDelegate delegate and the WriteSthMethod method. Then we connect the method to the delegate. Now, we can use the delegate the way we would use the method. Consider a delegate something like a pointer to a method.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Let's see an example.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We will use a simple literal object called DelegateOutputLitID to show the output.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Here's our delegate and the method it will use.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;delegate void&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;WriteSthDelegate&lt;/font&gt;&lt;/span&gt;(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;outputText);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;void&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;WriteSthMethod(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;outputText)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; DelegateOutputLitID.Text += outputText;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;and this is the way to associate them&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;protected void&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;Page_Load(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;object&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;sender,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;EventArgs&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;e)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; DelegateOutputLitID.Text = &amp;quot;&amp;quot;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Attach WriteSthMethod while creating the writeSthDelegateObject delegate &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;WriteSthDelegate&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;writeSthDelegateObject =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;WriteSthDelegate&lt;/font&gt;&lt;/span&gt;(WriteSthMethod);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; writeSthDelegateObject(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Hello, I am a delegate&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;What do we have here? We create an instance of the WriteSthDelegate and connect it to the WriteSthMethod. From now on, using the delegate in the way of writeSthDelegateObject(&amp;quot;Hello, I am a delegate&amp;quot;) will be equal to calling the method WriteSthMethod(&amp;quot;Hello, I am a delegate&amp;quot;)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The output will be&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;span id="DelegateOutputLitID"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Hello, I am a delegate&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Using a diagram, this is the line followed in order to get the result.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img alt="delegates diagram" src="http://dotnethints.com/admin/gallery/delegate3.jpg" /&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Keep in mind that both the delegate and the method must have the same return value and the same arguments. In our case the return value is void and there is one argument of string type.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;In addition to using the method directly, the connection between the delegate and the method can occur at runtime and we can thus create a much more flexible application.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Handling delegates&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We learned how to assign a method to a delegate. Still, a delegate can be assigned more than one method or dismiss some of the ones it is already assigned.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The way to do this is quite simple. You associate the method you want to a new delegate object and then you either add the two delegates or subtract them, much like you would do if you wanted to add or subtract two integers.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;delegateObject += newDelegateObject will assign new methods to a delegate.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;delegateObject -= newDelegateObject will remove methods from a delegate's assigned list.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;In order to combine two (or more) delegates, they must be instances of the same delegate class.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;You can also manage that by using the methods directly. For example the previous commands will be the same as&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;delegateObject += newDelegateMethod&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;delegateObject -= newDelegateMethod&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:122px;width:144px;" alt="delegates" src="http://dotnethints.com/admin/gallery/delegate2.jpg" /&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;To create a useful example we will use one more method&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;void&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;WriteSthElseMethod(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;string&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;outputText)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; DelegateOutputLitID.Text +=&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;lt;br/&amp;gt;Hello, &amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;+ outputText;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Now, here's the example&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;protected void&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;Page_Load(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;object&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;sender,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;EventArgs&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;e)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; DelegateOutputLitID.Text =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Attach WriteSthMethod while creating the writeSthDelegateObject delegate &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;WriteSthDelegate&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;writeSthDelegateObject =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;WriteSthDelegate&lt;/font&gt;&lt;/span&gt;(WriteSthMethod);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; writeSthDelegateObject(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Hello, I am a delegate&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; DelegateOutputLitID.Text +=&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot;&amp;lt;hr/&amp;gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Attach WriteSthElseMethod to the writeSthDelegateObject delegate&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; writeSthDelegateObject += WriteSthElseMethod;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; writeSthDelegateObject(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;I am a delegate&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; DelegateOutputLitID.Text +=&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot;&amp;lt;hr/&amp;gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Remove WriteSthMethod from the writeSthDelegateObject delegate&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; writeSthDelegateObject -= WriteSthMethod;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; writeSthDelegateObject(&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;I am a delegate&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The output will be&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;em&gt;&lt;span id="DelegateOutputLitID"&gt;&lt;font style="font-size:10.5pt;"&gt;Hello, I am a delegate&lt;/font&gt;&lt;/span&gt;&lt;/em&gt;&lt;font style="font-size:10.5pt;"&gt;        &lt;hr /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;em&gt;&lt;span id="DelegateOutputLitID"&gt;I am a delegate            &lt;br /&gt;Hello, I am a delegate&lt;/span&gt;&lt;/em&gt;         &lt;br /&gt;        &lt;hr /&gt;        &lt;br /&gt;&lt;/font&gt;&lt;em&gt;&lt;span id="DelegateOutputLitID"&gt;&lt;font style="font-size:10.5pt;"&gt;Hello, I am a delegate&lt;/font&gt;&lt;/span&gt;&lt;/em&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;All we did, is what we talked about earlier. We created a delegate attached to a method. Then we attached another method to it and combined it so that the first delegate now is connected to both methods. After that we remove the method assigned first.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Delegates contain a few useful methods, for example GetInvocationList() will return a list of the delegates invoked by the current delegate. If we tried out the following piece of code &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;DelegateOutputLitID.Text +=&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;lt;br/&amp;gt;There are now&amp;#160; &amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;+ writeSthDelegateObject.GetInvocationList().Length +&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot; methods attached to the delegate.&amp;lt;br/&amp;gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;foreach&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;(&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;Delegate&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;del&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;in&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;writeSthDelegateObject.GetInvocationList())&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; DelegateOutputLitID.Text += del.Method +&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&amp;quot;&amp;lt;br/&amp;gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;we would get&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;span id="DelegateOutputLitID"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;There are now 2 methods attached to the delegate.            &lt;br /&gt;Void WriteSthMethod(System.String)             &lt;br /&gt;Void WriteSthElseMethod(System.String)&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The previous examples should probably have given you an idea of how delegates work. Moving forward, we are going to see a few more advanced uses.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Events and delegates&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Let's start off by creating two buttons, each of them invoking a method printing a message when clicked. Here's the code.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;asp&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;:&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;Button&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;runat&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;server&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;ID&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;Button1ID&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;Text&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;This is button 1&amp;quot;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;OnClick&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;Button1Clicked&amp;quot; /&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;asp&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;:&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;Button &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;runat&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;server&amp;quot; &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;ID&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;Button2ID&amp;quot; &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;Text&lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;This is button 2&amp;quot; &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#ff0000"&gt;OnClick&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color:;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;Button2Clicked&amp;quot; /&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;protected void&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;Button1Clicked(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;object&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;sender,&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;EventArgs&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;e)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; DelegateOutputLitID.Text +=&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot; This is button 1.&amp;quot;&lt;/font&gt;&lt;/span&gt;;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;protected void&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt; Button2Clicked(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;object &lt;/font&gt;&lt;/span&gt;sender, &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;EventArgs &lt;/font&gt;&lt;/span&gt;e)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; DelegateOutputLitID.Text +=&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot; This is button 2.&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;span class="Apple-tab-span" style="white-space:nowrap;"&gt;&lt;font style="font-size:10.5pt;"&gt; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;That's most simple. When I press the first button I get &amp;quot; This is button 1.&amp;quot;. When I press the second I get &amp;quot; This is button 2.&amp;quot;.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;What we have here for each button is an event (Click) and a method (Button1Clicked). What we miss is their connection. By writing OnClick=&amp;quot;Button1Clicked&amp;quot; we create an event handler, that is the method that will be called by the event. ASP.NET automatically creates the piece of code that says when the Click event of the control with ID Button1ID is raised, the method that will be called will be Button1Clicked.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;What is most important is that these event handlers (actually all event handlers) are implemented using delegates. If that is so we could treat these methods like any other method.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So, the following code &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;void&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;ButtonHandling()&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; DelegateOutputLitID.Text =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Button2ID.Click -= Button2Clicked;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Button2ID.Click += Button1Clicked;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;would remove the Button2Clicked method from the event handler and put Button1Clicked in its place. If we then clicked the second button we would get&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;em&gt;&lt;span id="DelegateOutputLitID"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This is button 1.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/em&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;That is the reason that all event handling methods have the same arguments&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;protected void EventHandlingMethod(object sender, EventArgs e)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Because they are all invoked by a delegate that also needs these arguments.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Why should I use delegates?&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;img style="height:264px;width:142px;" alt="why should i use delegates" src="http://dotnethints.com/admin/gallery/why%20should%20i%20use%20delegates.jpg" /&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We talked about delegates, what they are and what they do. Based on that, you may be able to tell that like most other advanced tools there may not be times where it will be compulsory for you to use delegates, rather than optionally.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;You can use delegates when you have created your methods but do not wish to handle them plainly within the code. In that case, using a delegate may end up in a better organized source code.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Delegates can also be used when you are not completely sure what you want to do in future. You simply create the delegate and later on invoke the methods you feel like.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Delegates still, could be the only solution in case you want to use event handlers or other .Net functions that require delegates.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;LINQ and Lambda expressions for example can use delegates in order to assign expressions created on the fly. For example&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;delegate int&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;linqDelegate&lt;/font&gt;&lt;/span&gt;(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;i);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;int&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;LinqDelegate(int i)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;linqDelegate&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;increase = x =&amp;gt; x + 1;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Equal to int increase(int x){return x +1;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;linqDelegate&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;square = x =&amp;gt; x * x;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Equal to int square(int x){return x * x;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;square(increase(i));&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;If we called this function &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;LinqDelegate(5);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;we would get 36 as a result.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;However, we are going to talk about lambda expressions in a future article.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Summary &lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Delegates can be loosely described as reference types for methods. In that way, calling the delegate is like calling the method invoked. You can invoke more than one method to a delegate, add them and remove them any way that you want. Delegates are used to create event handling and are also used in LINQ and lambda expressions.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Reference &lt;a href="http://dotnethints.com/blog?id=44"&gt;DotNetHints&lt;/a&gt;&lt;/p&gt;&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=75229" width="1" height="1"&gt;</content><author><name>k badas</name><uri>https://www.dotnetzone.gr:443/cs/members/k+badas.aspx</uri></author></entry><entry><title>L stands for lambda</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2014/04/06/l-stands-for-lambda.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2014/04/06/l-stands-for-lambda.aspx</id><published>2014-04-07T01:51:33Z</published><updated>2014-04-07T01:51:33Z</updated><content type="html">&lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Lambda expressions are anonymous functions that can be really helpful at times. Alike many other .NET methods, lambda expressions are not the only way to create the algorithm you want, however they may help you in writing code that is much easier to read than the old fashioned way. We are going to see what lambda expressions are and go through some basic applications.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Lambda calculus&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Even though the fact that you reading this article shows that you are interested in the .NET's lambda part, we'll first take a little tour over its mathematical background. When Microsoft developers released .Net 3.5 and introduced lambda expressions, that idea had been in store for a long time. The following description is nothing more but a naive description of the mathematical model and will be used as an introduction to the development model. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;In 1930s Church, a mathematician, in order to strengthen the foundations of mathematics, created a formal mathematical system based on function abstraction. He called that system lambda calculus and used the Greek letter λ as its symbol. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This λ-calculus system was based on anonymous functions. Till then the usual way to create a function was for example f(x) = x * x. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;λ-calculus suggests that the function's name (f in the previous example) is unnecessary. Instead we could use λx.x*x. Such an expression is no longer a function but is rather called lambda abstraction.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;A lambda abstraction has the form λ&amp;lt;arguments&amp;gt;.&amp;lt;function body&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;By the way, why did Church name his system after the Greek letter λ? Similar attempts so far used the notation&lt;img style="height:18px;width:20px;" alt="" src="http://dotnethints.com/admin/gallery/x-russel.jpg" /&gt;. Church, creating a new system, wished it to be similar, yet different from the existing ones. So he moved the symbol left, like that Λx.x *x. This reminded him of the capital Greek letter lambda (Λ), thus the name was created. Later on the the symbol was turned to λ (λx.x*x), the lowercase Greek letter, as the current typewriters had a hard time printing. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;A lambda abstraction represents a function. The function λx.x*x represents is x-&amp;gt;x*x.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;In the same way we have &amp;lt;parameters&amp;gt; -&amp;gt; &amp;lt;function body&amp;gt;.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This is the way .NET treats its lambda expressions as we are soon about to see. A lambda expression is the equivalent of a lambda abstraction. So, as we stated in the beginning, we end up that a lambda expression is nothing more but an anonymous function. A function that has no name, does not exist in code and is created on the fly in order for us to use it.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:170px;width:170px;" alt="lambda-calculus" src="http://dotnethints.com/admin/gallery/lambda1.png" /&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This is a lambda expression&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We talked about delegates stating that its similar to method pointers in an &lt;u&gt;&lt;a style="text-decoration:;border-bottom-style:none;color:;" href="http://dotnethints.com/blog?id=44"&gt;&lt;font color="#67217a"&gt;older article&lt;/font&gt;&lt;/a&gt;&lt;/u&gt;. Using a delegate we can write the following code.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;delegate int&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;intDelegate&lt;/font&gt;&lt;/span&gt;(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int&lt;/font&gt;&lt;/span&gt; i);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160; //Create anonymous method&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;private int&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;DelegateSquare()&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;intDelegate&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;d =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;delegate&lt;/font&gt;&lt;/span&gt;(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;i){&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;i = i * i;};&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return d(2);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This method will return 4.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Since lambda expressions are nothing more but anonymous functions we can write the same code as&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160; //Create anonymous method using lambda expression&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#0000cd"&gt;&lt;span style="color:;"&gt;private &lt;/span&gt;&lt;span style="color:;"&gt;int&lt;/span&gt;&lt;/font&gt; LambdaSquare()&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;intDelegate &lt;/font&gt;&lt;/span&gt;d = i =&amp;gt; i * i;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return d(2);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Here's the difference: Instead of delegate(int i){return i = i * i;}; we get i =&amp;gt; i * i;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We can tell there's no actual difference in what the result will be. The result will still be 4. What we have accomplished is we have turned a simple anonymous method into an even simpler lambda expression. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Using λ-calculus we have λx.x*x or x-&amp;gt;x*x. Using lambda expressions we have i =&amp;gt; i * i. It's all about the same thing, we create an anonymous function that gets the i parameter and returns i * i. &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;If we wanted to create lambda expressions that looked more like anonymous functions we could use brackets. The previous example would then become&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; //Create anonymous method using lambda expression&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;intDelegate &lt;/font&gt;&lt;/span&gt;LambdaSquare()&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;intDelegate &lt;/font&gt;&lt;/span&gt;d = i =&amp;gt; { &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return &lt;/font&gt;&lt;/span&gt;i* i; };&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return &lt;/font&gt;&lt;/span&gt;d(2);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Supposing we wanted to create lambda expressions having more than one argument, we would have to present the arguments within parenthesis like this&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; delegate int&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;font color="#008080"&gt;&lt;span style="color:;"&gt;twoIntDeleg&lt;/span&gt;&lt;span style="color:;"&gt;ate&lt;/span&gt;&lt;/font&gt;(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int&lt;/font&gt;&lt;/span&gt; i);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160; //Lambda expression accepting more than one argument&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#0000cd"&gt;&lt;span style="color:;"&gt;private &lt;/span&gt;&lt;span style="color:;"&gt;int&lt;/span&gt;&lt;/font&gt; LambdaMultiply()&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#008080"&gt;&lt;span style="color:;"&gt;twoIntDeleg&lt;/span&gt;&lt;span style="color:;"&gt;ate&lt;/span&gt;&lt;/font&gt;d = (i, j) =&amp;gt; i * j;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return &lt;/font&gt;&lt;/span&gt;d(2,3);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Actually all lambda expressions are supposed to contain arguments within parenthesis, however in case of one argument it is not compulsory. So most developers prefer writing i =&amp;gt; i * i instead of (i) =&amp;gt; i * i, even though it's quite the same thing.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Now, here's a bit more complex example that can show us how helpful lambda expressions can be.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This method will return the maximum number from a list of integers that is also greater than the minValue specified.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;//Old fashioned code&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#0000cd"&gt;&lt;span style="color:;"&gt;private &lt;/span&gt;&lt;span style="color:;"&gt;int&lt;/span&gt;&lt;/font&gt; GetMaxIntValueGreaterThanLocalInteger()&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;List&lt;/font&gt;&lt;/span&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int&lt;/font&gt;&lt;/span&gt;&amp;gt; intList =&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;List&lt;/font&gt;&lt;/span&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int&lt;/font&gt;&lt;/span&gt;&amp;gt; { 1, 2, 3, 4, 5 };&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;minValue = 5;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int &lt;/font&gt;&lt;/span&gt;maxValue = -1;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;foreach&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;(&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int &lt;/font&gt;&lt;/span&gt;i &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int &lt;/font&gt;&lt;/span&gt;intList)&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;((i &amp;gt; minValue) &amp;amp;&amp;amp; (i &amp;gt; maxValue))&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; maxValue = i;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;maxValue;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This example returns -1 since there is no integer greater than 5 inside the intList.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Here's the equivalent code using a modern approach.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160; //Modern code&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#0000cd"&gt;&lt;span style="color:;"&gt;private &lt;/span&gt;&lt;span style="color:;"&gt;int&lt;/span&gt;&lt;/font&gt; GetMaxIntValueGreaterThanLocalIntegerLambda()&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;List&lt;/font&gt;&lt;/span&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int&lt;/font&gt;&lt;/span&gt;&amp;gt; intList = &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;List&lt;/font&gt;&lt;/span&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int&lt;/font&gt;&lt;/span&gt;&amp;gt; { 1, 2, 3, 4, 5 };&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int&lt;/font&gt;&lt;/span&gt;minValue = 3;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Get the integers greater than minValue&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;var&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;minValueLambda = intList.Where(i =&amp;gt; i &amp;gt; minValue);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Check if at least one integer was greater than minValue&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;(minValueLambda.Any())&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Return maximum integer&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return minValueLambda.Max();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; else&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;-1;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This time the result will be 5.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;First we use the lambda expression i =&amp;gt; i &amp;gt; minValue to remove the integers that are less than minValue. Then we simply check if there are possible results using Any() and get the maximum result using Max().&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Here's what Visual Studio's IntelliSense proposes we should use as an argument to the Where method - Func(int, bool) predicate. Predicate stands for anonymous methods that use boolean expressions testing each element of the given sequence. Since we can use anonymous methods we can also use lambda expressions. There are quite a lot of methods that can accept such arguments. The previous example could as well have been written as&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#0000cd"&gt;&lt;span style="color:;"&gt;private &lt;/span&gt;&lt;span style="color:;"&gt;int&lt;/span&gt;&lt;/font&gt; GetMaxIntValueGreaterThanLocalIntegerLambdaAny()&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;List&lt;/font&gt;&lt;/span&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int&lt;/font&gt;&lt;/span&gt;&amp;gt; intList = &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;List&lt;/font&gt;&lt;/span&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int&lt;/font&gt;&lt;/span&gt;&amp;gt; { 1, 2, 3, 4, 5 };&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int &lt;/font&gt;&lt;/span&gt;minValue = 3;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Get the integers that are greater than minValue&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;if&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;(intList.Any(i =&amp;gt; i &amp;gt; minValue))&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Return maximum integer&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;intList.Max();&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; else&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return &lt;/font&gt;&lt;/span&gt;-1;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Instead of predicates there are also selector expressions which can modify the return value.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Supposing we wanted to get the square of the previous method's return value. Max method can get lambda expression argument. We can write&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#0000cd"&gt;&lt;span style="color:;"&gt;private &lt;/span&gt;&lt;span style="color:;"&gt;int&lt;/span&gt;&lt;/font&gt;&amp;#160; GetSquareMaxIntValueGreaterThanLocalInteger()&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;   &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#008080"&gt;List&lt;/font&gt;&lt;/span&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int&lt;/font&gt;&lt;/span&gt;&amp;gt; intList = &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#008080"&gt;List&lt;/font&gt;&lt;/span&gt;&amp;lt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int&lt;/font&gt;&lt;/span&gt;&amp;gt; { 1, 2, 3, 4, 5 };&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;    &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;int &lt;/font&gt;&lt;/span&gt;minValue = 3;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt; &lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Get the integers that are greater than minValue&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;if&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;(intList.Any(i =&amp;gt; i &amp;gt; minValue))&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Return square of maximum integer&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return&lt;span class="Apple-converted-space"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;intList.Max(i =&amp;gt; i * i);&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;   &lt;div&gt;&lt;span style="color:;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; else&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;    &lt;div&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:;"&gt;&lt;font color="#0000cd"&gt;return &lt;/font&gt;&lt;/span&gt;-1;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt; &lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:115px;width:128px;" alt="" src="http://dotnethints.com/admin/gallery/lambdathumbnail.jpg" /&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Lambda expressions and anonymous methods.&lt;/font&gt;&lt;span class="Apple-tab-span" style="white-space:nowrap;"&gt;&lt;font style="font-size:10.5pt;"&gt; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So far we have talked about anonymous methods and lambda expressions and it seems that they have many things in common. Actually, we could say that lambda expressions are kind of a special category of anonymous methods. The reason to prefer lambda expressions to anonymous functions is that they are easier to be used by a developer. I have even met novice developers who where familiar with the Where method but knew nothing concerning lambda expressions, delegates or anonymous functions.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Keep in mind these simple expressions we created earlier&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Anonymous method&amp;#160; delegate(int i){return i = i * i;}; &lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Lambda expression&amp;#160;&amp;#160; i =&amp;gt; i * i;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This lambda expression can also be written this way&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;(int i) =&amp;gt; { return i * i; };&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;which makes it similar to the method.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;You can now see all the things we can omit (if possible) when using lambda expressions.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;1) parameter type declaration&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;2) parenthesis between parameter&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;3) brackets between body declaration&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;4) the return keyword&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Ending up in the much simpler expression i =&amp;gt; i * i;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;As we mentioned, when using lambda expressions you do not have to pay attention to parameter types. Even though the anonymous method explicitly states that i is an integer, the lambda expression does not. Lambda expressions use type inference, that is .NET will deduct what type the variable should be and make things easier for you. If however you feel like this will make things worse, stick with the anonymous method.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;img style="height:109px;width:194px;" alt="lambda l" src="http://dotnethints.com/admin/gallery/lambda%20l.jpg" /&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;strong&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Conclusion&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;div style="font-family:;white-space:normal;word-spacing:0px;text-transform:none;color:;letter-spacing:normal;line-height:normal;text-indent:0px;-webkit-text-stroke-width:0px;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Lambda expressions, similar to anonymous methods allow you to write simple and easy to read code. We have mentioned the basic points of how they work and why we should use them.&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;pre&gt;Reference &lt;a href="http://dotnethints.com/blog?id=47"&gt;DotNetHints&lt;/a&gt;&lt;/pre&gt;&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=75211" width="1" height="1"&gt;</content><author><name>k badas</name><uri>https://www.dotnetzone.gr:443/cs/members/k+badas.aspx</uri></author></entry><entry><title>Sending AJAX requests</title><link rel="alternate" type="text/html" href="https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2014/03/20/sending-ajax-requests.aspx" /><id>https://www.dotnetzone.gr:443/cs/blogs/kbadas/archive/2014/03/20/sending-ajax-requests.aspx</id><published>2014-03-21T05:14:56Z</published><updated>2014-03-21T05:14:56Z</updated><content type="html">&lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;In a&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;u&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-fareast-language:el;"&gt;&lt;a style="border-bottom-style:none;" href="http://dotnethints.com/blog?id=31"&gt;&lt;span style="text-decoration:;color:;mso-ansi-language:en-us;mso-bidi-font-size:11.0pt;text-underline:none;"&gt;&lt;font color="#67217a"&gt;previous article&lt;/font&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/u&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;we had some talk concerning AJAX. We used AJAX to read some simple file. Even though this may have seemed to be quite nice it is but a simple example of what AJAX can do. Things are going to get more interesting in this article where we will be talking about AJAX requests. In other words, how to exchange data between an html page and a server page depending on the requests parameters.&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;b&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;GET and POST&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;HTTP Request Methods, describe what the request is about to do. If this isn't the first time you are dealing with the web, you might have probably heard of the two most common methods, GET and POST.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Let's try to describe what these terms actually mean. To begin with, both requests contain information. For example whether we ask for the second page inside a forum or fill out and send a form in a contact page, we send information to the server. However you may be able to tell the difference between these requests. In the first example we are asking the server for data. In the second, it is us who send data to the server. If you understand that, you got the main difference between a GET and a POST request.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Since a GET request asks for data everyone can see, its variables are put in the url (query string).&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;http://dotnethints.com/news?id=16. This is a GET request that will return a news page having id 16. &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;http://dotnethints.com/contact. This is a POST request that will submit the form, but a user will not be able to see its variables since they are not visible.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;That way a POST request is more secure than a GET.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Based on the url, a GET request, in contrast to POST, can be cached, bookmarked or be used for every reason the url is all we need.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Since a GET request is used for requesting data, we do not expect to send much data, but in case you do find yourself sending more than a few KBs of data (actual limit depends on the browser you use), keep in mind that you have to use POST as GET will not support such an action.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So far, we've talked about HTTP Request Methods. Being part of the HTTP, they apply everywhere; ASP. NET, JAVA, PHP, everywhere. We are now going to see how to use what we've covered to create AJAX requests.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;b&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;AJAX and GET&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Here's a brief reminding of what we did last time. We used the following JavaScript function to get and handle an xml file.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;font color="#0000cd"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;function&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;loadXML(url) {&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;font color="#0000cd"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;var&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;xmlhttp;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#0000cd"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;if&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;(window.XMLHttpRequest) {&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;// code for IE7+, Firefox, Chrome, Opera, Safari&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; xmlhttp = new XMLHttpRequest();&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;font color="#0000cd"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;else&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;{&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;// code for IE6, IE5&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; xmlhttp =&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;font color="#0000cd"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;new&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;ActiveXObject(&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Microsoft.XMLHTTP&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; xmlhttp.onreadystatechange =&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;font color="#0000cd"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;function&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;() {&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Check if you are ready&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#0000cd"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;if&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;(xmlhttp.readyState == 4 &amp;amp;&amp;amp; xmlhttp.status == 200) {&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Code that handles the response&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; xmlhttp.open(&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;&amp;quot;GET&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;, url, true);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; xmlhttp.send();&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;If you need to refresh your memory&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;u&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-fareast-language:el;"&gt;&lt;a style="border-bottom-style:none;" href="http://dotnethints.com/blog?id=31"&gt;&lt;span style="text-decoration:;color:;mso-ansi-language:en-us;mso-bidi-font-size:11.0pt;text-underline:none;"&gt;&lt;font color="#67217a"&gt;this &lt;/font&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/u&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;is the article concerning AJAX introduction.&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We are now going to create a simple search form using pure HTML, where the user will insert his search keyword, and a JavaScript function that will send it to the server asynchronous. The server will process the data and response (since we presume that our full-detailed database knows everything) that the search is successful.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Since we are using AJAX everything happens asynchronous. The page will not postback, the user will still see the same page and the server will not need to process the whole of the page.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So, here's the form&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#a52a2a"&gt;div&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;font color="#0000cd"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;Keyword&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;: &amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;font color="#a52a2a"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;input&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#ff0000"&gt;type&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000cd"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;=&amp;quot;text&amp;quot;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#ff0000"&gt;id&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;KeywordInputID&amp;quot; /&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#a52a2a"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;button&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#ff0000"&gt;onclick&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;search()&amp;quot;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;Search&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#a52a2a"&gt;button&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#a52a2a"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;br&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;/&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#a52a2a"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;span&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#ff0000"&gt;id&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;=&amp;quot;ResponseSpanID&amp;quot; /&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#a52a2a"&gt;div&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;It looks like this.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;img alt="ajax Get form" src="http://dotnethints.com/admin/gallery/ajax-GET-form.jpg" /&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The ResponseSpanID span will be used to show the message in the server response.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;And here's the function&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;font color="#0000cd"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;function&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;search() {&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;font color="#0000cd"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;var&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;xmlhttp;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;font color="#0000cd"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;if&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;(window.XMLHttpRequest) {&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;// code for IE7+, Firefox, Chrome, Opera, Safari&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; xmlhttp = new XMLHttpRequest();&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;font color="#0000cd"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;else&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;{&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;// code for IE6, IE5&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; xmlhttp =&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;font color="#0000cd"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;new&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;ActiveXObject(&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Microsoft.XMLHTTP&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; xmlhttp.onreadystatechange = function () {&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;(xmlhttp.readyState == 4 &amp;amp;&amp;amp; xmlhttp.status == 200) {&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; document.getElementById(&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;&amp;quot;ResponseSpanID&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;).innerHTML = xmlhttp.responseText;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var url =&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#b22222"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;quot;AjaxAdvanced.aspx?search=&amp;quot;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;+ document.getElementById(&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;&amp;quot;KeywordInputID&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;).value;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; xmlhttp.open(&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;&amp;quot;GET&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;, url, true);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; xmlhttp.send();&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;As you can see all we have to do is create the url we need&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;var url =&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt; &amp;quot;AjaxAdvanced.aspx?search=&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt; + document.getElementById(&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;&amp;quot;KeywordInputID&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;).value;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;using the value form the input box. Remember, this is a GET request, so we use the url to send our data.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Keep in mind that sending data such as a search keyword using a GET request is not a bad good idea considering what we said earlier. We are asking the server for data, so we will use GET.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;So far we have used HTML and JavaScript. This means we could request every page we wanted no matter what its platform is. However since this is a .Net site we will request the AjaxAdvanced.aspx page.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The page could contain much HTML and code processing but all we need for our little example is this.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;background-image:none;background-repeat:repeat;background-attachment:scroll;background-position:0% 0%;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="background-color:#ffff00;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;%&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;@&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;Page&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#ff0000"&gt;Language&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;=&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&amp;quot;C#&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#ff0000"&gt;AutoEventWireup&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;=&lt;/span&gt;&lt;font color="#0000cd"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#ff0000"&gt;CodeFile&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;=&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&amp;quot;AjaxAdvanced.aspx.cs&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#ff0000"&gt;Inherits&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;=&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&amp;quot;Ajax_AjaxAdvanced&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;background-image:none;background-repeat:repeat;background-attachment:scroll;background-position:0% 0%;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;background-color:#ffff00;"&gt;%&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;and the code behind&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;font color="#0000cd"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;using&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;System;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;public partial class&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;font color="#008080"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;Ajax_AjaxAdvanced&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;: System.Web.UI.&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#008080"&gt;Page&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;protected void&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;Page_Load(&lt;/span&gt;&lt;font color="#0000cd"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;object&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;sender,&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;font color="#008080"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;EventArgs&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;e)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //GET uses the query string&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#0000cd"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;if&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;(Request.QueryString[&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;&amp;quot;search&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;] != null)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;font color="#0000cd"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;string&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;search = Request.QueryString[&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;&amp;quot;search&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;].ToString();&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Searching...&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Supposing search had results&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Response.Write(&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Your search for &amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;+ search +&lt;/span&gt;&lt;font color="#b22222"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;quot; had the following results...&amp;quot;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;I guess the code is quite simple. First we check if we actually have the input we've been expecting. Then we set it to a string and process it. Finally we create the response.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Then the response&amp;#160; will be handled by JavaScript&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;document.getElementById(&amp;quot;ResponseSpanID&amp;quot;).innerHTML = xmlhttp.responseText;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;and presented to the user.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The following images describe the actions.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;img alt="ajax GET form" src="http://dotnethints.com/admin/gallery/ajax-GET-form2.jpg" /&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;img alt="ajax GET response" src="http://dotnethints.com/admin/gallery/ajax-GET-response.jpg" /&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We could easily send more than one variable since urls support multiple variables, e.g.&amp;#160; http://dotnethints.com/blog?search=code&amp;amp;page=2&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;b&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;AJAX and POST&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;This is how we use GET. POST is quite similar. Let's create a form where the user will submit her email and send a question. This would not be a good example of GET request since we are sending data for the server to store.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Here's the HTML code&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;div&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;table&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;tr&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&amp;gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;td&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000cd"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;colspan=&amp;quot;2&amp;quot;&amp;gt;Please insert your email so we can answer your question.&amp;lt;/&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;td&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&amp;gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;tr&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;tr&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&amp;gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;td&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&amp;gt; Email: &amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;td&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&amp;gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;td&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&amp;gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;font color="#b22222"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;input&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#ff0000"&gt;type&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000cd"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;=&amp;quot;text&amp;quot;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#ff0000"&gt;id&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;EmailInputID&amp;quot; /&amp;gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;td&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&amp;gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;tr&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;tr&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&amp;gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;td&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&amp;gt; Question:&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;td&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&amp;gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;td&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&amp;gt; &amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;input &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#ff0000"&gt;type&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;text&amp;quot; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#ff0000"&gt;id&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;QuestionInputID&amp;quot; /&amp;gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;td&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&amp;gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;tr&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;tr&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&amp;gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;td&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;/&amp;gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;td&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&amp;gt; &amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;button&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&lt;font color="#0000cd"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#ff0000"&gt;onclick&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;=&amp;quot;submitQuestion()&amp;quot;&amp;gt;Submit&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;button&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&amp;gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;td&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&amp;gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;tr&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;table&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;span id=&amp;quot;ConfirmSpanID&amp;quot; /&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;div&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#0000cd"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;img alt="ajax POST" src="http://dotnethints.com/admin/gallery/ajax-POST-form.jpg" /&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;and the JavaScript code&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;function &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;submitQuestion() {&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;var &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;xmlhttp;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;if &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;(window.XMLHttpRequest) {&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;// code for IE7+, Firefox, Chrome, Opera, Safari&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; xmlhttp = new XMLHttpRequest();&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;else &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;{&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;// code for IE6, IE5&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; xmlhttp = &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;new &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;ActiveXObject(&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Microsoft.XMLHTTP&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; xmlhttp.onreadystatechange = function () {&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt; (xmlhttp.readyState == 4 &amp;amp;&amp;amp; xmlhttp.status == 200) {&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; document.getElementById(&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;&amp;quot;ConfirmSpanID&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;).innerHTML = xmlhttp.responseText;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; xmlhttp.open(&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;&amp;quot;POST&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;,&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;&amp;quot;AjaxAdvanced.aspx&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;,&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;true&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; xmlhttp.setRequestHeader(&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Content-type&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;,&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;&amp;quot;application/x-www-form-urlencoded&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var email = document.getElementById(&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;&amp;quot;EmailInputID&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;).value;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var question = document.getElementById(&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;&amp;quot;QuestionInputID&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;).value;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var postVariables =&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;&amp;quot;email=&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;+ email +&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;amp;question=&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;+ question;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; xmlhttp.send(postVariables);&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;The actual difference between GET and POST in the script is right here:&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; xmlhttp.open(&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;&amp;quot;POST&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;, &lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;&amp;quot;AjaxAdvanced.aspx&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;, &lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;true&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; xmlhttp.setRequestHeader(&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Content-type&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;, &lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;&amp;quot;application/x-www-form-urlencoded&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var email = document.getElementById(&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;&amp;quot;EmailInputID&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;).value;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var question = document.getElementById(&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;&amp;quot;QuestionInputID&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;).value;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var postVariables = &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;&amp;quot;email=&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt; + email + &lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;&amp;quot;&amp;amp;question=&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt; + question;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; xmlhttp.send(postVariables);&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;First we use the &amp;quot;POST&amp;quot; keyword, then we need to set the RequestHeader and finally insert the variable in the send() method. The rest is quite the same.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Similar this is the server page.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;background-image:none;background-repeat:repeat;background-attachment:scroll;background-position:0% 0%;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="background-color:#ffff00;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;lt;%&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;@&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt; Page &lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#ff0000"&gt;Language&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;=&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&amp;quot;C#&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#ff0000"&gt;AutoEventWireup&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;=&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&amp;quot;true&amp;quot; &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#ff0000"&gt;CodeFile&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;=&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&amp;quot;AjaxAdvanced.aspx.cs&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#ff0000"&gt;Inherits&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;=&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&amp;quot;Ajax_AjaxAdvanced&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;span style="background-image:none;background-repeat:repeat;background-attachment:scroll;background-position:0% 0%;"&gt;&lt;font style="font-size:10.5pt;background-color:#ffff00;"&gt;%&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;font color="#0000cd"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;using&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;System;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;&lt;font style="font-size:10.5pt;"&gt;public partial class&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;#160;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#008080"&gt;Ajax_AjaxAdvanced &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;: System.Web.UI.&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;" color="#008080"&gt;Page&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;protected void&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt; Page_Load(&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;object &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;sender, &lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#008080"&gt;EventArgs &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;e)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //POST uses Form variables&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;font color="#0000cd"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;if&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;(Request.Form[&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;&amp;quot;email&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;] !=&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;font color="#0000cd"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;null&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&amp;amp;&amp;amp; Request.Form[&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;&amp;quot;question&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;] != &lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;null&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;)&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;font color="#0000cd"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;string&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&amp;#160;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;email = Request.Form[&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;&amp;quot;email&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;].ToString();&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#0000cd"&gt;string &lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;question = Request.Form[&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;&amp;quot;question&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;].ToString();&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;" color="#006400"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //Submit email and question&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;font face="Segoe UI"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Response.Write(&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size:10.5pt;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font color="#b22222"&gt;&amp;quot;Form submitted&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font style="font-size:10.5pt;"&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We check for null variables and then get our data from Request.Form. Then (supposing that our cool site never fails) we show a message to the user.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Here's the result.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;img alt="ajax POST" src="http://dotnethints.com/admin/gallery/ajax-POST-form2.jpg" /&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&amp;#160;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;img alt="ajax POST response" src="http://dotnethints.com/admin/gallery/ajax-POST-response.jpg" /&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;b&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;mso-bidi-font-size:11.0pt;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;Summary&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 0pt;line-height:normal;"&gt;&lt;span style="font-family:;color:;mso-fareast-font-family:'Times New Roman';mso-ansi-language:en-us;mso-fareast-language:el;"&gt;&lt;font face="Segoe UI"&gt;&lt;font style="font-size:10.5pt;"&gt;We had a look at what GET and POST HTTP Request Methods stand for. GET is used when we want to ask for data and POST when we want to send data. We can combine both methods with AJAX and create advanced AJAX stuff by sending input to server pages.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin:0cm 0cm 10pt;line-height:13pt;"&gt;&lt;span style="mso-ansi-language:en-us;"&gt;&lt;font face="Calibri"&gt;&lt;font style="font-size:11pt;"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;pre&gt;&lt;font face="Segoe UI"&gt;Reference &lt;/font&gt;&lt;a href="http://dotnethints.com/blog?id=41"&gt;&lt;font face="Segoe UI"&gt;DotNetHints&lt;/font&gt;&lt;/a&gt;&lt;/pre&gt;&lt;img src="https://www.dotnetzone.gr:443/cs/aggbug.aspx?PostID=75167" width="1" height="1"&gt;</content><author><name>k badas</name><uri>https://www.dotnetzone.gr:443/cs/members/k+badas.aspx</uri></author></entry></feed>