<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" version="2.0">
  <channel>
    <title>Marco Bellinaso's Blog</title>
    <link>http://www.dotnet2themax.com/blogs/mbellinaso/</link>
    <description />
    <language>en-us</language>
    <copyright>Marco Bellinaso</copyright>
    <lastBuildDate>Sat, 02 Feb 2008 16:02:40 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 1.8.5223.1</generator>
    <managingEditor>mbellinaso@codearchitects.com</managingEditor>
    <webMaster>mbellinaso@codearchitects.com</webMaster>
    <item>
      <trackback:ping>http://www.dotnet2themax.com/blogs/mbellinaso/Trackback.aspx?guid=52cffd02-6d7d-49d1-a8a2-05a54712a0f1</trackback:ping>
      <pingback:server>http://www.dotnet2themax.com/blogs/mbellinaso/pingback.aspx</pingback:server>
      <pingback:target>http://www.dotnet2themax.com/blogs/mbellinaso/PermaLink,guid,52cffd02-6d7d-49d1-a8a2-05a54712a0f1.aspx</pingback:target>
      <dc:creator>mbellinaso@codearchitects.com (Marco Bellinaso)</dc:creator>
      <wfw:comment>http://www.dotnet2themax.com/blogs/mbellinaso/CommentView,guid,52cffd02-6d7d-49d1-a8a2-05a54712a0f1.aspx</wfw:comment>
      <wfw:commentRss>http://www.dotnet2themax.com/blogs/mbellinaso/SyndicationService.asmx/GetEntryCommentsRss?guid=52cffd02-6d7d-49d1-a8a2-05a54712a0f1</wfw:commentRss>
      <slash:comments>4</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      It has been more than a year since I last posted something in English on this blog.
      I'm now here again to announce that I've recently opened <a href="http://www.marcobellinaso.com">my
      official website with a blog in Italian</a>: I'm publishing there my thoughts and
      discoveries in software development and technology in general. Have a look, if you
      understand the language.
   </p>
        <p>
      I spent the last couple of months working on a website called <a href="http://www.pet-files.com">Pet-files</a>:
      it's a social network for pet lovers, where you can create profile pages for your
      pet(s) with unlimited photos, videos and stories, create slideshow to embed into your
      existing blog, write a blog about life with your pets, and much much more. Give it
      a look if you like the subject. I'm already covering some of the libraries and technologies
      behind that site on my Italian blog.
   </p>
        <img width="0" height="0" src="http://www.dotnet2themax.com/blogs/mbellinaso/aggbug.ashx?id=52cffd02-6d7d-49d1-a8a2-05a54712a0f1" />
      </body>
      <title>New blog in Italian</title>
      <guid>http://www.dotnet2themax.com/blogs/mbellinaso/PermaLink,guid,52cffd02-6d7d-49d1-a8a2-05a54712a0f1.aspx</guid>
      <link>http://www.dotnet2themax.com/blogs/mbellinaso/PermaLink,guid,52cffd02-6d7d-49d1-a8a2-05a54712a0f1.aspx</link>
      <pubDate>Sat, 02 Feb 2008 16:02:40 GMT</pubDate>
      <description>&lt;p&gt;
   It has been more than a year since I last posted something in English on this blog.
   I'm now here again to announce that I've recently opened &lt;a href="http://www.marcobellinaso.com"&gt;my
   official website with a blog in Italian&lt;/a&gt;: I'm publishing there my thoughts and
   discoveries in software development and technology in general. Have a look, if you
   understand the language.
&lt;/p&gt;
&lt;p&gt;
   I spent the last couple of months working on a&amp;nbsp;website called &lt;a href="http://www.pet-files.com"&gt;Pet-files&lt;/a&gt;:
   it's a social network for pet lovers, where you can create profile pages for your
   pet(s) with unlimited photos, videos and stories, create slideshow to embed into your
   existing blog, write a blog about life with your pets, and much much more. Give it
   a look if you like the subject. I'm already covering some of the libraries and technologies
   behind that site&amp;nbsp;on my Italian blog.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.dotnet2themax.com/blogs/mbellinaso/aggbug.ashx?id=52cffd02-6d7d-49d1-a8a2-05a54712a0f1" /&gt;</description>
      <comments>http://www.dotnet2themax.com/blogs/mbellinaso/CommentView,guid,52cffd02-6d7d-49d1-a8a2-05a54712a0f1.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://www.dotnet2themax.com/blogs/mbellinaso/Trackback.aspx?guid=7ab1676b-1132-4063-9176-4071cfc418ae</trackback:ping>
      <pingback:server>http://www.dotnet2themax.com/blogs/mbellinaso/pingback.aspx</pingback:server>
      <pingback:target>http://www.dotnet2themax.com/blogs/mbellinaso/PermaLink,guid,7ab1676b-1132-4063-9176-4071cfc418ae.aspx</pingback:target>
      <dc:creator>mbellinaso@codearchitects.com (Marco Bellinaso)</dc:creator>
      <wfw:comment>http://www.dotnet2themax.com/blogs/mbellinaso/CommentView,guid,7ab1676b-1132-4063-9176-4071cfc418ae.aspx</wfw:comment>
      <wfw:commentRss>http://www.dotnet2themax.com/blogs/mbellinaso/SyndicationService.asmx/GetEntryCommentsRss?guid=7ab1676b-1132-4063-9176-4071cfc418ae</wfw:commentRss>
      <slash:comments>7</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Yes, that's correct, a few days ago <strong><a href="http://weblogs.asp.net/scottgu/default.aspx">Scott
      Guthrie</a></strong> himself published a 5-star review of my book on Amazon, saying:
   </p>
        <p>
          <em>"I am very impressed with this book, and have worked with a number of customers
      who have also found it extremely useful..."<br />
      "The result is a very readable book that provides a great deal of context about how
      ASP.NET 2.0 works, and how the different features integrate together..."<br />
      "I'd definitely recommend this book to anyone who understands the basics of how ASP.NET
      works already, and is looking for a good book to take them to the next level and really
      start to build applications with it."<br /></em>
          <a href="http://www.amazon.com/gp/product/0764584642">
            <font size="1">&lt;click
      here to read the full review&gt;</font>
          </a>
        </p>
        <p>
      I can't believe I got the honor to receive these great words by the man that's globally
      recognized as <strong>the father of ASP.NET</strong> (and he's not just that...he
      also runs the dev teams that build the CLR, IIS, Atlas, WinForms, Compact Framework,
      Commerce Server, WPF, VWD...). It also appears that this is the first review Scott
      writes on Amazon, and this makes it even more important to my eyes :-)
   </p>
        <p>
      So wow, thanks a million Scott, words like yours -- and those from the many other
      readers that sent me their feedback -- really make worthwhile spending so much
      time and energy into writing a book!
   </p>
        <img width="0" height="0" src="http://www.dotnet2themax.com/blogs/mbellinaso/aggbug.ashx?id=7ab1676b-1132-4063-9176-4071cfc418ae" />
      </body>
      <title>Scott Guthrie reviews "ASP.NET 2.0 Website Programming"</title>
      <guid>http://www.dotnet2themax.com/blogs/mbellinaso/PermaLink,guid,7ab1676b-1132-4063-9176-4071cfc418ae.aspx</guid>
      <link>http://www.dotnet2themax.com/blogs/mbellinaso/PermaLink,guid,7ab1676b-1132-4063-9176-4071cfc418ae.aspx</link>
      <pubDate>Fri, 22 Dec 2006 13:19:04 GMT</pubDate>
      <description>&lt;p&gt;
   Yes, that's correct, a few days ago &lt;strong&gt;&lt;a href="http://weblogs.asp.net/scottgu/default.aspx"&gt;Scott
   Guthrie&lt;/a&gt;&lt;/strong&gt; himself published a 5-star review of my book on Amazon, saying:
&lt;/p&gt;
&lt;p&gt;
   &lt;em&gt;"I am very impressed with this book, and have worked with a number of customers
   who have also found it extremely useful..."&lt;br&gt;
   "The result is a very readable book that provides a great deal of context about how
   ASP.NET 2.0 works, and how the different features integrate together..."&lt;br&gt;
   "I'd definitely recommend this book to anyone who understands the basics of how ASP.NET
   works already, and is looking for a good book to take them to the next level and really
   start to build applications with it."&lt;br&gt;
   &lt;/em&gt;&lt;a href="http://www.amazon.com/gp/product/0764584642"&gt;&lt;font size=1&gt;&amp;lt;click
   here to read the full review&amp;gt;&lt;/font&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
   I can't believe I got the honor to receive these great words by the man that's globally
   recognized as &lt;strong&gt;the father of ASP.NET&lt;/strong&gt; (and he's not just that...he
   also runs the dev teams that build the CLR, IIS, Atlas, WinForms, Compact Framework,
   Commerce Server, WPF, VWD...). It also appears that this is the first review Scott
   writes on Amazon, and this makes it even more important to my eyes :-)
&lt;/p&gt;
&lt;p&gt;
   So wow, thanks a million Scott, words like yours -- and those from the many other
   readers that sent me their feedback --&amp;nbsp;really make worthwhile spending so much
   time and energy into writing a book!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.dotnet2themax.com/blogs/mbellinaso/aggbug.ashx?id=7ab1676b-1132-4063-9176-4071cfc418ae" /&gt;</description>
      <comments>http://www.dotnet2themax.com/blogs/mbellinaso/CommentView,guid,7ab1676b-1132-4063-9176-4071cfc418ae.aspx</comments>
      <category>My Book</category>
    </item>
    <item>
      <trackback:ping>http://www.dotnet2themax.com/blogs/mbellinaso/Trackback.aspx?guid=c5425dd6-b7c3-494d-9813-2fa2fbaca661</trackback:ping>
      <pingback:server>http://www.dotnet2themax.com/blogs/mbellinaso/pingback.aspx</pingback:server>
      <pingback:target>http://www.dotnet2themax.com/blogs/mbellinaso/PermaLink,guid,c5425dd6-b7c3-494d-9813-2fa2fbaca661.aspx</pingback:target>
      <dc:creator>mbellinaso@codearchitects.com (Marco Bellinaso)</dc:creator>
      <wfw:comment>http://www.dotnet2themax.com/blogs/mbellinaso/CommentView,guid,c5425dd6-b7c3-494d-9813-2fa2fbaca661.aspx</wfw:comment>
      <wfw:commentRss>http://www.dotnet2themax.com/blogs/mbellinaso/SyndicationService.asmx/GetEntryCommentsRss?guid=c5425dd6-b7c3-494d-9813-2fa2fbaca661</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      My editor has just approved the addresses of the five people that I've randomly picked
      from those who partecipated to the book giveaway contest. Here they are:
   </p>
        <ol>
          <li>
         Mel Grubb II (Columbus, OH)</li>
          <li>
         Mohee Uddin (New York, NY)</li>
          <li>
         Andrew Norman (Sarasota, Fl)</li>
          <li>
         Kyle Nash (Franklin, TN)</li>
          <li>
         Igor Antonacci (Italy)</li>
        </ol>
        <p>
      Congratulation guys, your books have already been ordered, and should be soon on their
      way to your home. I hope you'll enjoy reading the book :-)<br />
      There were about one hundred of you that submitted their info for the contest, so
      I'm afraid 95% won't receive the free book...however, if you really want to read the
      book anyway, I suggest you purchase it on Amazon, because you have a 30% off the regular
      price! 25 bucks is not that bad for a 600-pages book, I think.
   </p>
        <img width="0" height="0" src="http://www.dotnet2themax.com/blogs/mbellinaso/aggbug.ashx?id=c5425dd6-b7c3-494d-9813-2fa2fbaca661" />
      </body>
      <title>Book giveaway: the winners</title>
      <guid>http://www.dotnet2themax.com/blogs/mbellinaso/PermaLink,guid,c5425dd6-b7c3-494d-9813-2fa2fbaca661.aspx</guid>
      <link>http://www.dotnet2themax.com/blogs/mbellinaso/PermaLink,guid,c5425dd6-b7c3-494d-9813-2fa2fbaca661.aspx</link>
      <pubDate>Tue, 20 Jun 2006 14:59:14 GMT</pubDate>
      <description>&lt;p&gt;
   My editor has just approved the addresses of the five people that I've randomly picked
   from those who partecipated to the book giveaway contest. Here they are:
&lt;/p&gt;
&lt;ol&gt;
   &lt;li&gt;
      Mel Grubb II (Columbus, OH)&lt;/li&gt;
   &lt;li&gt;
      Mohee Uddin (New York, NY)&lt;/li&gt;
   &lt;li&gt;
      Andrew Norman (Sarasota, Fl)&lt;/li&gt;
   &lt;li&gt;
      Kyle Nash (Franklin, TN)&lt;/li&gt;
   &lt;li&gt;
      Igor Antonacci (Italy)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
   Congratulation guys, your books have already been ordered, and should be soon on their
   way to your home. I hope you'll enjoy reading the book :-)&lt;br&gt;
   There were about one hundred of you that submitted their info for the contest, so
   I'm afraid 95% won't receive the free book...however, if you really want to read the
   book anyway, I suggest you purchase it on Amazon, because you have a 30% off the regular
   price! 25 bucks is not that bad for a 600-pages book, I think.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.dotnet2themax.com/blogs/mbellinaso/aggbug.ashx?id=c5425dd6-b7c3-494d-9813-2fa2fbaca661" /&gt;</description>
      <comments>http://www.dotnet2themax.com/blogs/mbellinaso/CommentView,guid,c5425dd6-b7c3-494d-9813-2fa2fbaca661.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://www.dotnet2themax.com/blogs/mbellinaso/Trackback.aspx?guid=8d396160-4498-4a4b-b39d-8c8fa57bf64c</trackback:ping>
      <pingback:server>http://www.dotnet2themax.com/blogs/mbellinaso/pingback.aspx</pingback:server>
      <pingback:target>http://www.dotnet2themax.com/blogs/mbellinaso/PermaLink,guid,8d396160-4498-4a4b-b39d-8c8fa57bf64c.aspx</pingback:target>
      <dc:creator>mbellinaso@codearchitects.com (Marco Bellinaso)</dc:creator>
      <wfw:comment>http://www.dotnet2themax.com/blogs/mbellinaso/CommentView,guid,8d396160-4498-4a4b-b39d-8c8fa57bf64c.aspx</wfw:comment>
      <wfw:commentRss>http://www.dotnet2themax.com/blogs/mbellinaso/SyndicationService.asmx/GetEntryCommentsRss?guid=8d396160-4498-4a4b-b39d-8c8fa57bf64c</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      The book giveaway contest is having a very good response, and I've already received
      many dozens of submissions. Because of this, I decided that one more week is already
      enough time. So, you can send your submission (full address and job description) within
      June 15th...I'll announce the winners soon after that. Thanks for your interest :-)
   </p>
        <img width="0" height="0" src="http://www.dotnet2themax.com/blogs/mbellinaso/aggbug.ashx?id=8d396160-4498-4a4b-b39d-8c8fa57bf64c" />
      </body>
      <title>Hurry up with your submissions</title>
      <guid>http://www.dotnet2themax.com/blogs/mbellinaso/PermaLink,guid,8d396160-4498-4a4b-b39d-8c8fa57bf64c.aspx</guid>
      <link>http://www.dotnet2themax.com/blogs/mbellinaso/PermaLink,guid,8d396160-4498-4a4b-b39d-8c8fa57bf64c.aspx</link>
      <pubDate>Fri, 09 Jun 2006 13:02:30 GMT</pubDate>
      <description>&lt;p&gt;
   The book giveaway contest is having a very good response, and I've already received
   many dozens of submissions. Because of this, I decided that one more week is already
   enough time. So, you can send your submission (full address and job description) within
   June 15th...I'll announce the winners soon after that. Thanks for your interest :-)
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.dotnet2themax.com/blogs/mbellinaso/aggbug.ashx?id=8d396160-4498-4a4b-b39d-8c8fa57bf64c" /&gt;</description>
      <comments>http://www.dotnet2themax.com/blogs/mbellinaso/CommentView,guid,8d396160-4498-4a4b-b39d-8c8fa57bf64c.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://www.dotnet2themax.com/blogs/mbellinaso/Trackback.aspx?guid=86249dc4-c135-472b-97b5-c1c6398d7428</trackback:ping>
      <pingback:server>http://www.dotnet2themax.com/blogs/mbellinaso/pingback.aspx</pingback:server>
      <pingback:target>http://www.dotnet2themax.com/blogs/mbellinaso/PermaLink,guid,86249dc4-c135-472b-97b5-c1c6398d7428.aspx</pingback:target>
      <dc:creator>mbellinaso@codearchitects.com (Marco Bellinaso)</dc:creator>
      <wfw:comment>http://www.dotnet2themax.com/blogs/mbellinaso/CommentView,guid,86249dc4-c135-472b-97b5-c1c6398d7428.aspx</wfw:comment>
      <wfw:commentRss>http://www.dotnet2themax.com/blogs/mbellinaso/SyndicationService.asmx/GetEntryCommentsRss?guid=86249dc4-c135-472b-97b5-c1c6398d7428</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      My great acquisitions editor at Wrox, <a href="http://wroxblog.typepad.com/minatel/">Jim
      Minatel</a>, just wrote me an e-mail saying he has no less than <strong>5 copies</strong> of
      my <a href="http://www.dotnet2themax.com/BooksMarco.aspx">ASP.NET 2.0 Website Programming</a> book
      to give away to some of you, blog readers :-) All we ask in return is a review
      on Amazon (and possibly on your blog, if you have one). Please note that we're
      asking for a <strong>100% honest review</strong>...if you don't like something in
      the book, you will be absolutely free to express it. You can rest assured we're
      not looking for biased reviews and comments. So, if you're interested, please <a href="http://www.dotnet2themax.com/EmailForm.aspx?Email=codearchitects.com___at___mbellinaso">contact
      me</a> and specify the following information:
   </p>
        <ul>
          <li>
         your complete name and physical address 
      </li>
          <li>
         if you're outside the USA please include also your phone number 
      </li>
          <li>
         a few lines to describe your job, and your experience with web development and ASP.NET
         2.0</li>
        </ul>
        <p>
      I'll collect your information for a few weeks (how many depends on the number of mails
      I receive...it may be 2 weeks or a month) and then randomly pick 5 of you. I'll
      then publish the names of the winners on the blog, and pass the address information
      to Jim at Wrox so that he can send the books. I hope you appreciate the initiative
      :-)
   </p>
        <p>
      Good luck!
   </p>
        <img width="0" height="0" src="http://www.dotnet2themax.com/blogs/mbellinaso/aggbug.ashx?id=86249dc4-c135-472b-97b5-c1c6398d7428" />
      </body>
      <title>Book giveaway!</title>
      <guid>http://www.dotnet2themax.com/blogs/mbellinaso/PermaLink,guid,86249dc4-c135-472b-97b5-c1c6398d7428.aspx</guid>
      <link>http://www.dotnet2themax.com/blogs/mbellinaso/PermaLink,guid,86249dc4-c135-472b-97b5-c1c6398d7428.aspx</link>
      <pubDate>Wed, 31 May 2006 10:17:13 GMT</pubDate>
      <description>&lt;p&gt;
   My great acquisitions editor at Wrox, &lt;a href="http://wroxblog.typepad.com/minatel/"&gt;Jim
   Minatel&lt;/a&gt;, just wrote me an e-mail saying he has no less than &lt;strong&gt;5 copies&lt;/strong&gt; of
   my &lt;a href="http://www.dotnet2themax.com/BooksMarco.aspx"&gt;ASP.NET 2.0 Website Programming&lt;/a&gt; book
   to give away to some of you,&amp;nbsp;blog&amp;nbsp;readers :-) All we ask in return is a&amp;nbsp;review
   on Amazon&amp;nbsp;(and possibly on your blog, if you have one). Please note that we're
   asking for a &lt;strong&gt;100% honest review&lt;/strong&gt;...if you don't like something in
   the book, you will be absolutely free to express it. You can&amp;nbsp;rest assured we're
   not looking for biased reviews and comments. So, if you're interested, please &lt;a href="http://www.dotnet2themax.com/EmailForm.aspx?Email=codearchitects.com___at___mbellinaso"&gt;contact
   me&lt;/a&gt; and specify the following information:
&lt;/p&gt;
&lt;ul&gt;
   &lt;li&gt;
      your complete name and physical address 
   &lt;li&gt;
      if you're outside the USA please include also your phone number 
   &lt;li&gt;
      a few lines to describe your job, and your experience with web development and ASP.NET
      2.0&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
   I'll collect your information for a few weeks (how many depends on the number of mails
   I receive...it may be&amp;nbsp;2 weeks or a month) and then randomly pick 5 of you. I'll
   then publish the names of the winners on the blog, and pass the address information
   to Jim at Wrox so that he can send the books. I hope you appreciate the initiative
   :-)
&lt;/p&gt;
&lt;p&gt;
   Good luck!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.dotnet2themax.com/blogs/mbellinaso/aggbug.ashx?id=86249dc4-c135-472b-97b5-c1c6398d7428" /&gt;</description>
      <comments>http://www.dotnet2themax.com/blogs/mbellinaso/CommentView,guid,86249dc4-c135-472b-97b5-c1c6398d7428.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://www.dotnet2themax.com/blogs/mbellinaso/Trackback.aspx?guid=f74b0894-a572-4187-9dd8-74215c77d0bb</trackback:ping>
      <pingback:server>http://www.dotnet2themax.com/blogs/mbellinaso/pingback.aspx</pingback:server>
      <pingback:target>http://www.dotnet2themax.com/blogs/mbellinaso/PermaLink,guid,f74b0894-a572-4187-9dd8-74215c77d0bb.aspx</pingback:target>
      <dc:creator>mbellinaso@codearchitects.com (Marco Bellinaso)</dc:creator>
      <wfw:comment>http://www.dotnet2themax.com/blogs/mbellinaso/CommentView,guid,f74b0894-a572-4187-9dd8-74215c77d0bb.aspx</wfw:comment>
      <wfw:commentRss>http://www.dotnet2themax.com/blogs/mbellinaso/SyndicationService.asmx/GetEntryCommentsRss?guid=f74b0894-a572-4187-9dd8-74215c77d0bb</wfw:commentRss>
      <title>An excerpt from Chapter 12: Pre-compiling the Site</title>
      <guid>http://www.dotnet2themax.com/blogs/mbellinaso/PermaLink,guid,f74b0894-a572-4187-9dd8-74215c77d0bb.aspx</guid>
      <link>http://www.dotnet2themax.com/blogs/mbellinaso/PermaLink,guid,f74b0894-a572-4187-9dd8-74215c77d0bb.aspx</link>
      <pubDate>Wed, 31 May 2006 09:36:18 GMT</pubDate>
      <description>&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;
   &lt;br&gt;
   If you deploy the site by copying all the files (including the source code), the pages
   and the source code files are compiled dynamically at runtime when they are first
   requested by a user. This is called &lt;i style="mso-bidi-font-style: normal"&gt;in-place
   compilation,&lt;/i&gt; and the generated assemblies are compiled into a temporary folder.
   As an alternative, instead of deploying source files, you can use the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;aspnet_compiler.exe&lt;/span&gt;&lt;/span&gt; tool
   (located under &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727&lt;/span&gt;&lt;/span&gt;)
   to pre-compile the source code files and (optionally) the markup files. This is the
   command you could use to pre-compile everything (this should all be entered on one
   line):&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codelastwscreen style="MARGIN: 0cm 0cm 10pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;aspnet_compiler.exe
   -p c:\Projects\ASP.NET\TheBeerHouse\TBH_Web -v /TheBeerHouse c:\Deployment\TheBeerHouse&lt;/font&gt;
&lt;/p&gt;
&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;The &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;-p&lt;/span&gt;&lt;/span&gt; parameter
   specifies the source directory, and the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;-v&lt;/span&gt;&lt;/span&gt; parameter
   specifies the virtual directory used at runtime by the site. The path at the end of
   the command is the destination directory for the compiler output files. If you look
   under the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;c:\Deployment\TheBeerHouse\bin&lt;/span&gt;&lt;/span&gt; folder,
   you’ll find multiple .&lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;dll&lt;/span&gt;&lt;/span&gt; assembly
   files, plus one .&lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;compiled&lt;/span&gt;&lt;/span&gt; XML
   file for each .&lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;aspx&lt;/span&gt;&lt;/span&gt; and
   .&lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;ascx&lt;/span&gt;&lt;/span&gt; file
   (see Figure 12-15).&lt;/font&gt;
&lt;/p&gt;
&lt;p class=F style="MARGIN: 12pt 0cm 0pt 25pt"&gt;&lt;?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /&gt;
   &lt;v:shapetype id=_x0000_t75 coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"&gt;
      &lt;v:stroke joinstyle="miter"&gt;&lt;/v:stroke&gt;
      &lt;v:formulas&gt;
         &lt;v:f eqn="if lineDrawn pixelLineWidth 0"&gt;&lt;/v:f&gt;
         &lt;v:f eqn="sum @0 1 0"&gt;&lt;/v:f&gt;
         &lt;v:f eqn="sum 0 0 @1"&gt;&lt;/v:f&gt;
         &lt;v:f eqn="prod @2 1 2"&gt;&lt;/v:f&gt;
         &lt;v:f eqn="prod @3 21600 pixelWidth"&gt;&lt;/v:f&gt;
         &lt;v:f eqn="prod @3 21600 pixelHeight"&gt;&lt;/v:f&gt;
         &lt;v:f eqn="sum @0 0 1"&gt;&lt;/v:f&gt;
         &lt;v:f eqn="prod @6 1 2"&gt;&lt;/v:f&gt;
         &lt;v:f eqn="prod @7 21600 pixelWidth"&gt;&lt;/v:f&gt;
         &lt;v:f eqn="sum @8 21600 0"&gt;&lt;/v:f&gt;
         &lt;v:f eqn="prod @7 21600 pixelHeight"&gt;&lt;/v:f&gt;
         &lt;v:f eqn="sum @10 21600 0"&gt;&lt;/v:f&gt;
      &lt;/v:formulas&gt;
      &lt;v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"&gt;&lt;/v:path&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
      &lt;o:lock v:ext="edit" aspectratio="t"&gt;
         &lt;img src="http://www.dotnet2themax.com/blogs/mbellinaso/content/binary/fig1215.jpg" border=0&gt;
      &lt;/o:lock&gt;
   &lt;/v:shapetype&gt;
&lt;/p&gt;
&lt;p class=FC style="MARGIN: 5pt 0cm 20pt 25pt"&gt;
   &lt;strong&gt;&lt;font face=Arial color=#000000&gt;Figure 12-15&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;The files named with a &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;.compiled&lt;/span&gt;&lt;/span&gt; extension
   contain XML text that shows the relationship between the virtual path of a page or
   user control and the corresponding type compiled into one of the assemblies. If you
   look into any of the .&lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;aspx&lt;/span&gt;&lt;/span&gt; files,
   you won’t find any HTML/ASPX markup code, but rather the markup string printed below:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codelastwscreen style="MARGIN: 0cm 0cm 10pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;This is a
   marker file generated by the precompilation tool, and should not be deleted!&lt;/font&gt;
&lt;/p&gt;
&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;After executing the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;aspnet_compiler&lt;/span&gt;&lt;/span&gt;,
   you take all the output generated by this tool and upload it to the remote server,
   typically via FTP. If you’re deploying to a server within your network you might simply
   copy the files to a shared folder on that server. However, even local servers are
   often isolated behind a firewall, so FTP may be needed anyway.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;Compiling the markup code may definitely be appealing in some
   circumstance, such as for packaged commercial products for which you don’t want the
   client to change anything; however, if you’re deploying to your own site this may
   not be particularly useful or necessary. Furthermore, it would complicate updates,
   because every time you need to change a line of markup you’d have to recompile everything
   and re-deploy the generated files. In the case of deploying to your own sites, it’s
   simpler to pre-compile only the source code files but not the markup files. To do
   this, just add the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;-u&lt;/span&gt;&lt;/span&gt; switch
   (which stands for &lt;i style="mso-bidi-font-style: normal"&gt;updateable&lt;/i&gt;) to the command
   line, as follows:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codelastwscreen style="MARGIN: 0cm 0cm 10pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;aspnet_compiler.exe
   -p c:\Projects\ASP.NET\TheBeerHouse\TBH_Web -v /TheBeerHouse -u c:\Deployment\TheBeerHouse&lt;/font&gt;
&lt;/p&gt;
&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;With this command no .&lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;compiled&lt;/span&gt;&lt;/span&gt; files
   will be generated under the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;/bin&lt;/span&gt;&lt;/span&gt; folder,
   and the content of the .&lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;aspx&lt;/span&gt;&lt;/span&gt; and
   .&lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;ascx&lt;/span&gt;&lt;/span&gt; files
   won’t be removed. However, the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;CodeFile&lt;/span&gt;&lt;/span&gt; attribute
   of the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;@Page&lt;/span&gt;&lt;/span&gt; and &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;@Control&lt;/span&gt;&lt;/span&gt; directives
   will be removed, and the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;Inherits&lt;/span&gt;&lt;/span&gt; will
   be updated with a reference to the type compiled into one of the generated assemblies.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=Boxtext style="MARGIN: 6pt 28pt"&gt;
   &lt;strong&gt;&lt;font style="BACKGROUND-COLOR: #e0e0e0" color=#000000&gt;Note that all static
   files (images, .htm files, .css stylesheet files, etc.) are always copied “as is”
   to the target folder. These are never included as part of a pre-compile.&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;However, there’s a small deployment issue when using one of the
   two pre-compile commands described above: The assemblies they generate always have
   a different name, which makes it difficult to update the site locally and then replicate
   the changes remotely, because the assembly names will be different after each pre-compile.
   If you don’t want to leave old and unused assemblies in the remote &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;/bin&lt;/span&gt;&lt;/span&gt; folder,
   you need to delete them first and then upload all new .&lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;dll&lt;/span&gt;&lt;/span&gt; files.
   This is very annoying and time-consuming, so you can add the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;-fixednames&lt;/span&gt;&lt;/span&gt; compiler
   switch to cause the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;aspnet_compiler&lt;/span&gt;&lt;/span&gt; to
   create an assembly for each file it compiles, using a fixed name scheme. This is good
   because it allows you to update the site locally, recompile it, and then upload only
   the changed assembly file. This is the modified command line:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codelastwscreen style="MARGIN: 0cm 0cm 10pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;aspnet_compiler.exe
   -p c:\Projects\ASP.NET\TheBeerHouse\TBH_Web -v /TheBeerHouse -u -fixednames c:\Deployment\TheBeerHouse&lt;/font&gt;
&lt;/p&gt;
&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;I covered the syntax of the command-line tool for completeness
   (and because many of you will want to script this procedure), but you don’t have to
   remember all the various switches because Visual Studio provides a simple integrated
   UI for &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;aspnet_compiler&lt;/span&gt;&lt;/span&gt;,
   which you can access by clicking Build @@&amp;gt; Publish Web Site. Figure 12-16 shows
   the graphical front-end that it provides, making it easy to select your options, and
   to select a local or remote IIS site, or an FTP site, as the destination for the operation,
   in addition to a local folder.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=F style="MARGIN: 12pt 0cm 0pt 25pt"&gt;
   &lt;img src="http://www.dotnet2themax.com/blogs/mbellinaso/content/binary/fig1216.jpg" border=0&gt;
&lt;/p&gt;
&lt;p class=FC style="MARGIN: 5pt 0cm 20pt 25pt"&gt;
   &lt;strong&gt;&lt;font color=#000000&gt;Figure 12-16&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;Some of you may be concerned about the large quantity of assemblies
   produced by the pre-compilation step. In large projects with hundreds of pages, the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;/bin&lt;/span&gt;&lt;/span&gt; folder
   will contain a lot of files, and it may be more convenient for deployment if you could
   combine all those .&lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;dll&lt;/span&gt;&lt;/span&gt; files
   into a single assembly file. There’s no way to do this with the tools included in
   VS2005 and the standard installation of the .NET Framework 2.0, but Microsoft listened
   to its customers, and after releasing VS2005, they later released a free package called
   “Visual Studio 2005 Web Deployment Projects,” which can be downloaded from &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;http://msdn.microsoft.com/asp.net/reference/infrastructure/wdp/default.aspx&lt;/span&gt;&lt;/span&gt;.
   After installing the package, you’ll find a new command-line tool called &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;aspnet_merge.exe&lt;/span&gt;&lt;/span&gt; under
   the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;C:\Program
   Files\MSBuild\Microsoft\WebDeployment\v8.0&lt;/span&gt;&lt;/span&gt; folder. As its name suggests,
   it enables you to merge the multiple assemblies generated by the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;aspnet_compiler&lt;/span&gt;&lt;/span&gt; tool
   into a single &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;dll&lt;/span&gt;&lt;/span&gt;.
   When you run this program you only need to specify the path of the pre-compiled web
   site where it can find the assemblies you want to merge:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;&lt;font face="Courier New"&gt;aspnet_merge.exe
   c:\Deployment\TheBeerHouse&lt;o:p&gt;&lt;/o:p&gt;
   &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;The preceding command generates a &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;dll&lt;/span&gt;&lt;/span&gt; for
   each of the web site’s folders containing files that were pre-compiled by &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;aspnet_compiler&lt;/span&gt;&lt;/span&gt;.
   This is useful when you have folders that include a sub-application supported by different
   developers (such as the administration console), and you want to have separate assemblies
   for separate sections so that you can update them independently on the production
   server. In other cases, however, you may prefer to merge everything into a single
   assembly: You can do so with the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;-o&lt;/span&gt;&lt;/span&gt; switch,
   which specifies the name of the assembly being generated:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;font color=#000000&gt;&lt;font face="Courier New"&gt;aspnet_merge.exe
   c:\Deployment\TheBeerHouse -o MB.TheBeerHouse.dll&lt;o:p&gt;&lt;/o:p&gt;
   &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=Boxtext style="MARGIN: 6pt 28pt"&gt;
   &lt;strong&gt;&lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e0e0e0"&gt;Note that the
   tool can be used whether&lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt; the
   aspnet_compiler.exe pre-compiled the markup code or not. But this tool never &lt;/span&gt;&lt;/span&gt;merges
   in any external libraries referenced by the web site’s source files and pages, such
   as the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;MB.TheBeerHouse.CustomEvents.dll&lt;/span&gt;&lt;/span&gt; and
   the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;FredCK.FCKEditorV2.dll&lt;/span&gt;&lt;/span&gt; assemblies.
   It only merges assemblies generated by &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;aspnet_compiler.exe&lt;/span&gt;&lt;/span&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;As for &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;aspnet_compiler&lt;/span&gt;&lt;/span&gt;,
   there’s also a front-end UI for &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;aspnet_merge&lt;/span&gt;&lt;/span&gt;.
   The Visual Studio 2005 Web Deployment Projects package is installed as an add-in for
   VS2005, and it adds a new project type called a “Deployment Project.” You add a new
   deployment project to your solution by clicking the Add Web Deployment Project… option
   on the IDE’s Build menu, or via the same option on the context menu of the web site
   in the Solution Explorer window. You create the project by choosing its name and location
   from the dialog box shown in Figure 12-17.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=F style="MARGIN: 12pt 0cm 0pt 25pt"&gt;
   &lt;img src="http://www.dotnet2themax.com/blogs/mbellinaso/content/binary/fig1217.jpg" border=0&gt;
&lt;/p&gt;
&lt;p class=FC style="MARGIN: 5pt 0cm 20pt 25pt"&gt;
   &lt;strong&gt;&lt;font color=#000000&gt;Figure 12-17&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;The project added to the Solution Explorer contains no files;
   you have to double click the project name to open its configuration dialog box, from
   which you can specify a number of options. Among other things, you can specify how
   you want the pre-compiler to work, and how you want the files merged. In the first
   tab of the dialog box (see Figure 12-18), you specify the output folder, and choose
   whether the user interface pages and controls should be pre-compiled (which is the
   updateable option, corresponding to the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;-u&lt;/span&gt;&lt;/span&gt; switch
   of the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;aspnet_compiler.exe&lt;/span&gt;&lt;/span&gt; tool). &lt;/font&gt;
&lt;/p&gt;
&lt;p class=F style="MARGIN: 12pt 0cm 0pt 25pt"&gt;
   &lt;img src="http://www.dotnet2themax.com/blogs/mbellinaso/content/binary/fig1218.jpg" border=0&gt;
&lt;/p&gt;
&lt;p class=FC style="MARGIN: 5pt 0cm 20pt 25pt"&gt;
   &lt;strong&gt;&lt;font color=#000000&gt;Figure 12-18&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;In the second tab, Output Assemblies (see Figure 12-19), you specify
   whether you want to compile everything into a single assembly, have an assembly for
   each folder, have an assembly for the user interface pages and controls, or have an
   assembly for each class and page being compiled (this last option means you don’t
   want to use &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;aspnet_merge.exe&lt;/span&gt;&lt;/span&gt;).
   From here you can also specify the version information of the generated assemblies.
   If this information is not provided, the settings specified in the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;web.config&lt;/span&gt;&lt;/span&gt; file
   located under the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;/App_code&lt;/span&gt;&lt;/span&gt; folder
   will be used instead (if the file is present, which is not a requirement).&lt;/font&gt;
&lt;/p&gt;
&lt;p class=F style="MARGIN: 12pt 0cm 0pt 25pt"&gt;
   &lt;img src="http://www.dotnet2themax.com/blogs/mbellinaso/content/binary/fig1219.jpg" border=0&gt;
&lt;/p&gt;
&lt;p class=FC style="MARGIN: 5pt 0cm 20pt 25pt"&gt;
   &lt;strong&gt;&lt;font color=#000000&gt;Figure 12-19&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;The third tab, Signing (not shown here), enables you to sign the
   generated assemblies with a key file generated by the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;sn.exe&lt;/span&gt;&lt;/span&gt; command-line
   tool, to give them a strong name. This isn’t normally desired for your own sites,
   but may be useful when you’re creating a packaged application and you want to ensure
   that your assemblies will not be tampered with. In the last tab, Deployment (see Figure
   12-20), you can choose to replace one or more sections of the site’s &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;web.config&lt;/span&gt;&lt;/span&gt; file
   with the content from another file. For example, if you write &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;connectionStrings=connectionStrings.LocalSql.config&lt;/span&gt;&lt;/span&gt;,
   the whole &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;&amp;lt;connectionStrings&amp;gt;&lt;/span&gt;&lt;/span&gt; section
   will be replaced with the content of the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;connectionStrings.LocalSql.config&lt;/span&gt;&lt;/span&gt; file
   at the end of the build process. This enables you to have a connection string pointing
   the SQL Server Express database to be used while testing the site locally, and later
   have it automatically replaced with a connection string referencing a local or remote
   SQL Server 2005 database after building the project for deployment. You can specify
   additional sections to replace, one per line. You can also use this window to specify
   a virtual directory to be created during the build process, and whether the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;App_Data&lt;/span&gt;&lt;/span&gt; folder
   will be deleted from the files generated (useful when you will use a SQL Server 2005
   database after the build, in which case you do not want to deploy your express files
   under &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;App_Data&lt;/span&gt;&lt;/span&gt;).&lt;/font&gt;
&lt;/p&gt;
&lt;p class=F style="MARGIN: 12pt 0cm 0pt 25pt"&gt;
   &lt;img src="http://www.dotnet2themax.com/blogs/mbellinaso/content/binary/fig1220.jpg" border=0&gt;
&lt;/p&gt;
&lt;p class=FC style="MARGIN: 5pt 0cm 20pt 25pt"&gt;
   &lt;strong&gt;&lt;font color=#000000&gt;Figure 12-20&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;Once you’ve completed the configuration, you can build the project.
   At the end of the build process you’ll find a copy of the site with the pre-compiled
   and merged assemblies, plus all other files such as pages, controls, images, stylesheets,
   and so on in the output folder. You can then take this entire output and upload everything
   to the production server, typically via FTP.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;Deployment projects simply consist of an XML file used to pass
   options to &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;MSBuild.exe&lt;/span&gt;&lt;/span&gt;,
   the new Microsoft build tool capable of compiling and building complex projects and
   solutions. MSBuild is an extensible tool that uses configuration files that can contain
   many different options. And if an option or a task that you’d like doesn’t exist yet,
   you can create it as a C# class, and have MSBuild call it. Many of the configuration
   settings described here were implemented as custom settings and tasks by the developers
   of the Web Deployment Projects add-in. There are many more available options in addition
   to those you can configure from the Properties window explored earlier, such as the
   option to exclude files from the build, create new folders, grant the ASP.NET account
   write access to a folder (only on your local machine, though—you’ll still need to
   replicate these security settings on the remote production server), execute external
   programs, and much more. You can add more settings and tasks (i.e., operations to
   run before or after the build and the merge processes) directly from the XML configuration
   file, which can be opened by clicking the Open Project File option from the Web Deployment
   project’s context menu. Covering MSBuild is beyond the scope of this book, but you
   can find a lot of good documentation about this on the web, and in the documents that
   come with the Web Deployment Projects package.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=Boxtext style="MARGIN: 6pt 28pt"&gt;
   &lt;strong&gt;&lt;font style="BACKGROUND-COLOR: #e0e0e0" color=#000000&gt;By default, all projects
   added to the solution are built in Visual Studio when you launch the primary project,
   i.e., the web site. Building the deployment project takes quite a lot of time, however,
   depending on the size of the site (on my machine it takes around 30 seconds to generate
   the pre-compiled site), and it is not something you want to do while testing the site
   locally. In order to avoid this waste of time, you can just exclude the project from
   the Build&amp;nbsp;| Configuration Manager… dialog box.&lt;/font&gt;&lt;/strong&gt;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;font color=#000000&gt; 
   &lt;hr&gt;
   &lt;p&gt;
   &lt;/p&gt;
   &lt;p&gt;
   &lt;/p&gt;
   &lt;p&gt;
      &lt;font size=2&gt;&amp;nbsp;&lt;/font&gt;&lt;font face=Verdana size=1&gt;&lt;em&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; This
      excerpt was taken from the book "ASP.NET 2.0 Website Programming". &lt;/em&gt;&lt;/font&gt;&lt;a href="http://www.dotnet2themax.com/blogs/mbellinaso/ct.ashx?id=2ca72726-2047-470d-a8af-4e535b061708&amp;amp;url=http%3a%2f%2fwww.dotnet2themax.com%2fblogs%2fmbellinaso%2fct.ashx%3fid%3d9cef10c7-c7a0-4144-bb0e-a90c65e336fd%26url%3dhttp%253a%252f%252fwww.dotnet2themax.com%252fblogs%252fmbellinaso%252fct.ashx%253fid%253d081e87cc-d3b4-4ba4-a1cc-f49fc701a7ee%2526url%253dhttp%25253a%25252f%25252fwww.dotnet2themax.com%25252fBooksMarco.aspx" ?&gt;&lt;font face=Verdana size=1&gt;&lt;em&gt;Click
      here&lt;/em&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=Verdana size=1&gt;&lt;em&gt; to find more about it, and download
      the complete source code of the sample project.&lt;/em&gt;&lt;/font&gt;
   &lt;/p&gt;
   &lt;/font&gt;&lt;/span&gt;&lt;img width="0" height="0" src="http://www.dotnet2themax.com/blogs/mbellinaso/aggbug.ashx?id=f74b0894-a572-4187-9dd8-74215c77d0bb" /&gt;</description>
      <comments>http://www.dotnet2themax.com/blogs/mbellinaso/CommentView,guid,f74b0894-a572-4187-9dd8-74215c77d0bb.aspx</comments>
      <category>My Book</category>
    </item>
    <item>
      <trackback:ping>http://www.dotnet2themax.com/blogs/mbellinaso/Trackback.aspx?guid=2ca72726-2047-470d-a8af-4e535b061708</trackback:ping>
      <pingback:server>http://www.dotnet2themax.com/blogs/mbellinaso/pingback.aspx</pingback:server>
      <pingback:target>http://www.dotnet2themax.com/blogs/mbellinaso/PermaLink,guid,2ca72726-2047-470d-a8af-4e535b061708.aspx</pingback:target>
      <dc:creator>mbellinaso@codearchitects.com (Marco Bellinaso)</dc:creator>
      <wfw:comment>http://www.dotnet2themax.com/blogs/mbellinaso/CommentView,guid,2ca72726-2047-470d-a8af-4e535b061708.aspx</wfw:comment>
      <wfw:commentRss>http://www.dotnet2themax.com/blogs/mbellinaso/SyndicationService.asmx/GetEntryCommentsRss?guid=2ca72726-2047-470d-a8af-4e535b061708</wfw:commentRss>
      <slash:comments>4</slash:comments>
      <title>An excerpt from Chapter 11: Using Page Level Resources</title>
      <guid>http://www.dotnet2themax.com/blogs/mbellinaso/PermaLink,guid,2ca72726-2047-470d-a8af-4e535b061708.aspx</guid>
      <link>http://www.dotnet2themax.com/blogs/mbellinaso/PermaLink,guid,2ca72726-2047-470d-a8af-4e535b061708.aspx</link>
      <pubDate>Tue, 09 May 2006 18:29:18 GMT</pubDate>
      <description>&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;
   &lt;br&gt;
   You can create page-level resources by creating resource files just as you do for
   global resources, but placing them under a folder named &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;App_LocalResources&lt;/span&gt;&lt;/span&gt; (as
   opposed to &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;App_GlobalResources&lt;/span&gt;&lt;/span&gt; used
   for global resources) located at the same level of the page to localize. For example,
   if the page is in the root folder, then you’ll create the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;App_LocalResources&lt;/span&gt;&lt;/span&gt; under
   the root folder, but if the page is under &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;/Test&lt;/span&gt;&lt;/span&gt;,
   then you’ll create a &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;/Test/App_LocalResources&lt;/span&gt;&lt;/span&gt; folder.
   This means you can have multiple &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;App_LocalResources&lt;/span&gt;&lt;/span&gt; folders,
   whereas you can only have one &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;App_GlobalResources&lt;/span&gt;&lt;/span&gt; folder
   for the whole site. The name of the resource filename is also fundamental, as it must
   be named after the page or control file for which it contains the localized resources,
   plus the part with the culture name: For example, a culture-neutral resource file
   for &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;Localization.aspx&lt;/span&gt;&lt;/span&gt; would
   be named &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;Localization.aspx.resx&lt;/span&gt;&lt;/span&gt;,
   whereas it would be named &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;Localization.aspx.it-IT.resx&lt;/span&gt;&lt;/span&gt; for
   the Italian resources. In Figure 11-5, you can see the organization of files in the
   Solution Explorer, and the resource file being edited in the grid editor.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=F style="MARGIN: 12pt 0cm 0pt 25pt"&gt;&lt;?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /&gt;
   &lt;v:shapetype id=_x0000_t75 stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"&gt;
      &lt;v:stroke joinstyle="miter"&gt;&lt;/v:stroke&gt;
      &lt;v:formulas&gt;
         &lt;v:f eqn="if lineDrawn pixelLineWidth 0"&gt;&lt;/v:f&gt;
         &lt;v:f eqn="sum @0 1 0"&gt;&lt;/v:f&gt;
         &lt;v:f eqn="sum 0 0 @1"&gt;&lt;/v:f&gt;
         &lt;v:f eqn="prod @2 1 2"&gt;&lt;/v:f&gt;
         &lt;v:f eqn="prod @3 21600 pixelWidth"&gt;&lt;/v:f&gt;
         &lt;v:f eqn="prod @3 21600 pixelHeight"&gt;&lt;/v:f&gt;
         &lt;v:f eqn="sum @0 0 1"&gt;&lt;/v:f&gt;
         &lt;v:f eqn="prod @6 1 2"&gt;&lt;/v:f&gt;
         &lt;v:f eqn="prod @7 21600 pixelWidth"&gt;&lt;/v:f&gt;
         &lt;v:f eqn="sum @8 21600 0"&gt;&lt;/v:f&gt;
         &lt;v:f eqn="prod @7 21600 pixelHeight"&gt;&lt;/v:f&gt;
         &lt;v:f eqn="sum @10 21600 0"&gt;&lt;/v:f&gt;
      &lt;/v:formulas&gt;
      &lt;v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"&gt;&lt;/v:path&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
      &lt;o:lock aspectratio="t" v:ext="edit"&gt;&lt;/o:lock&gt;
   &lt;/v:shapetype&gt;
   &lt;img src="http://www.dotnet2themax.com/blogs/mbellinaso/content/binary/Resources1.jpg" border=0&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=FC style="MARGIN: 5pt 0cm 20pt 25pt"&gt;
   &lt;strong&gt;&lt;font color=#000000&gt;Figure 11-5&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;You can still use the Expressions dialog shown in Figure 11-4
   to bind a control’s property to an expression pointing to a localized resource: When
   you point to a page-specific resource you just leave the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;ClassKey&lt;/span&gt;&lt;/span&gt; textbox
   empty. The code below shows the generated expression:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;&amp;lt;asp:Label
   ID="lblCopyright" runat="server"&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codelastwscreen style="MARGIN: 0cm 0cm 10pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Text="&amp;lt;%$
   Resources:CopyrightMessage %&amp;gt;" / &amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;It differs from the expression shown in the previous section,
   as it doesn’t include the class name; it just specifies the resource key. If you want
   to access local resources programmatically, you use the page’s &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;GetLocalResourceObject&lt;/span&gt;&lt;/span&gt; method,
   which takes the resource key name and returns an &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;Object&lt;/span&gt;&lt;/span&gt; that
   you must cast to &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;string&lt;/span&gt;&lt;/span&gt; or
   to the proper destination type (such as &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;Bitmap&lt;/span&gt;&lt;/span&gt; if
   you stored an image):&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codelastwscreen style="MARGIN: 0cm 0cm 10pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;string copyrightMsg
   = (string)this.GetLocalResourceObject("CopyrightMessage");&lt;/font&gt;
&lt;/p&gt;
&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;Even with localization expressions and local resources, localizing
   full pages will be a slow task if you need to create the expressions for dozens of
   controls, and things get worse if you need to localize multiple properties for the
   same control, such as &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;Text&lt;/span&gt;&lt;/span&gt;, &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;ToolTip&lt;/span&gt;&lt;/span&gt;, &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;ImageUrl&lt;/span&gt;&lt;/span&gt;, &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;NavigateUrl&lt;/span&gt;&lt;/span&gt;,
   and so on, which is often the case. To speed things up, Visual Studio offers the Tools
   @@&amp;gt; Generate Local Resource command, which generates a local resource file for
   the current page, and creates entries for all localizable properties of all controls
   on the page, following the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;ControlName.PropertyName&lt;/span&gt;&lt;/span&gt; naming
   convention for the names of the resources. Resource items are also automatically set
   with the value extracted from the page’s markup; if a property is not used in the
   control’s declaration, a resource item for it is generated anyway and left empty. &lt;/font&gt;
&lt;/p&gt;
&lt;p class=Notetextalone style="MARGIN: 0cm 24pt 10pt"&gt;
   &lt;em&gt;&lt;font color=#000000&gt;Localizable properties are those that are decorated with a
   [Localizable(true)] attribute, which you can add to the properties of your custom
   controls. However, even when you add it to properties of user controls, resources
   for those properties will not be automatically generated by the Generate Local Resource
   command. You can create the local resources for those properties yourself, and write
   the localization expressions to make the association: Everything will work perfectly
   at runtime, so this is only a design-time limitation. In addition, you’ll have to
   write the localization expressions manually, because the (Expressions) item is not
   available from the Properties window when a user control is selected.&lt;/font&gt;&lt;/em&gt;
&lt;/p&gt;
&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;Figure 11-6 shows the resource editor for the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;Localization.aspx.resx&lt;/span&gt;&lt;/span&gt; local
   resource file after executing this Generate Local Resource command on the test page.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=F style="MARGIN: 12pt 0cm 0pt 25pt"&gt;
   &lt;img src="http://www.dotnet2themax.com/blogs/mbellinaso/content/binary/Resources2.jpg" border=0&gt;
&lt;/p&gt;
&lt;p class=FC style="MARGIN: 5pt 0cm 20pt 25pt"&gt;
   &lt;strong&gt;&lt;font color=#000000&gt;Figure 11-6&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;Besides the automatic generation of the resource file (or the
   addition of the resource items, if a resource file for that page was already present
   in the proper folder), what’s even more interesting is that each control’s declaration
   is modified as follows (note the code in bold):&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;&amp;lt;asp:Label
   ID="lblTitle" runat="server" Font-Size="X-Large" ForeColor="#C00000" &lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;meta:resourcekey="lblTitleResource1"&lt;/b&gt; Text="Localization
   Demo"&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Text="This
   page provides a nice demo of new ASP.NET 2.0 localization features" &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codelastwscreen style="MARGIN: 0cm 0cm 10pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;/&amp;gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;A &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;meta:resourcekey&lt;/span&gt;&lt;/span&gt; attribute
   is added to the declaration, and is set to the prefix used in the local resource file
   to identify all localized properties of that control, such as &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;lblTitleResource1.Text&lt;/span&gt;&lt;/span&gt; and &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;lblTitleResource1.ToolTip&lt;/span&gt;&lt;/span&gt;.
   These are called &lt;i style="mso-bidi-font-style: normal"&gt;implicit localization expressions&lt;/i&gt; (expressions
   used earlier are considered &lt;i style="mso-bidi-font-style: normal"&gt;explicit&lt;/i&gt;).
   At runtime, the framework parses all resources and applies them to the properties
   of the corresponding controls, making the mapping of the first part of the key with
   the value of &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;meta:resourcename&lt;/span&gt;&lt;/span&gt;.
   This means that the control’s declaration is decorated with just a single new attribute,
   but may make multiple properties localizable. Later, if you want to localize a property
   that you didn’t take into account originally, you just need to go to the resource
   editor and add an item following the naming schema described above, or edit its value
   if it already exists.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=Boxtext style="MARGIN: 6pt 28pt"&gt;
   &lt;strong&gt;&lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e0e0e0"&gt;Note that the
   controls retain their original property declarations after running the Generate Local
   Resource command. These declarations are no longer necessary, though, as the property’s
   value will be replaced at runtime with the values saved in the resource file; therefore,
   you can completely remove the definition of the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;Text&lt;/span&gt;&lt;/span&gt;, &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;ToolTip&lt;/span&gt;&lt;/span&gt;,
   and the other localized properties from the .&lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;aspx&lt;/span&gt;&lt;/span&gt; files
   to avoid confusion.&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;This behavior works with the page’s title as well, originally
   defined in the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;@Page&lt;/span&gt;&lt;/span&gt; directive,
   which is modified as follows:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codelastwscreen style="MARGIN: 0cm 0cm 10pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;&amp;lt;%@ Page
   Language="C#" meta:resourcekey="PageResource1" …other attributes… %&amp;gt;&lt;/font&gt;
&lt;/p&gt;
&lt;span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;font color=#000000&gt; 
&lt;hr&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
   &lt;font size=2&gt;&amp;nbsp;&lt;/font&gt;&lt;font face=Verdana size=1&gt;&lt;em&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; This
   excerpt was taken from the book "ASP.NET 2.0 Website Programming". &lt;/em&gt;&lt;/font&gt;&lt;a href="http://www.dotnet2themax.com/blogs/mbellinaso/ct.ashx?id=9cef10c7-c7a0-4144-bb0e-a90c65e336fd&amp;amp;url=http%3a%2f%2fwww.dotnet2themax.com%2fblogs%2fmbellinaso%2fct.ashx%3fid%3d081e87cc-d3b4-4ba4-a1cc-f49fc701a7ee%26url%3dhttp%253a%252f%252fwww.dotnet2themax.com%252fBooksMarco.aspx" ?&gt;&lt;font face=Verdana size=1&gt;&lt;em&gt;Click
   here&lt;/em&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=Verdana size=1&gt;&lt;em&gt; to find more about it, and download
   the complete source code of the sample project.&lt;/em&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/font&gt;&lt;/span&gt;&lt;img width="0" height="0" src="http://www.dotnet2themax.com/blogs/mbellinaso/aggbug.ashx?id=2ca72726-2047-470d-a8af-4e535b061708" /&gt;</description>
      <comments>http://www.dotnet2themax.com/blogs/mbellinaso/CommentView,guid,2ca72726-2047-470d-a8af-4e535b061708.aspx</comments>
      <category>My Book</category>
    </item>
    <item>
      <trackback:ping>http://www.dotnet2themax.com/blogs/mbellinaso/Trackback.aspx?guid=9cef10c7-c7a0-4144-bb0e-a90c65e336fd</trackback:ping>
      <pingback:server>http://www.dotnet2themax.com/blogs/mbellinaso/pingback.aspx</pingback:server>
      <pingback:target>http://www.dotnet2themax.com/blogs/mbellinaso/PermaLink,guid,9cef10c7-c7a0-4144-bb0e-a90c65e336fd.aspx</pingback:target>
      <dc:creator>mbellinaso@codearchitects.com (Marco Bellinaso)</dc:creator>
      <wfw:comment>http://www.dotnet2themax.com/blogs/mbellinaso/CommentView,guid,9cef10c7-c7a0-4144-bb0e-a90c65e336fd.aspx</wfw:comment>
      <wfw:commentRss>http://www.dotnet2themax.com/blogs/mbellinaso/SyndicationService.asmx/GetEntryCommentsRss?guid=9cef10c7-c7a0-4144-bb0e-a90c65e336fd</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <title>An excerpt from Chapter 10: Developing Web Parts</title>
      <guid>http://www.dotnet2themax.com/blogs/mbellinaso/PermaLink,guid,9cef10c7-c7a0-4144-bb0e-a90c65e336fd.aspx</guid>
      <link>http://www.dotnet2themax.com/blogs/mbellinaso/PermaLink,guid,9cef10c7-c7a0-4144-bb0e-a90c65e336fd.aspx</link>
      <pubDate>Mon, 01 May 2006 11:11:23 GMT</pubDate>
      <description>&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;
   &lt;br&gt;
   As mentioned earlier, a Web Part can be developed as a user control (which is like
   a partial page, with markup code and a code-behind) or a custom control (which is
   a class written in C# for which you create the output 100% programmatically). The
   choice between the two depends on your needs and requirements, and it’s much like
   the choice between writing user and custom controls in general. If you want to compile
   everything into an assembly—so that the source code is protected and the output cannot
   be modified by an external developer and shared among multiple web sites by installing
   it in the GAC—then you’ll want to go with custom controls. If, instead, you don’t
   care much about those aspects, but prefer simplicity and speed of development, and
   the ease of changing the appearance of the Web Part by working with markup code instead
   of with C# code, then user controls will be your best bet. In this section, I’ll provide
   a quick overview of both approaches.&lt;/font&gt;
&lt;/p&gt;
&lt;h3 style="MARGIN: 12pt 0cm 3pt"&gt;&lt;font color=#000000&gt;Building a Web Part as a User
   Control&lt;/font&gt;
&lt;/h3&gt;
&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;For our first example we’ll build a simple online calculator,
   with two textboxes for the operands, a button to submit the form and do the calculation,
   and a label to show the result. You define the UI with the usual markup code, in the
   .&lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;ascx&lt;/span&gt;&lt;/span&gt; file
   (typical of user controls):&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;&amp;lt;%@ Control
   Language="C#" AutoEventWireup="true" CodeFile="Calculator.ascx.cs"&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Inherits="
   Calculator" %&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;Op1: &amp;lt;asp:TextBox
   ID="txtOp1" runat="server" /&amp;gt;&amp;lt;br /&amp;gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;Op2: &amp;lt;asp:TextBox
   ID="txtOp2" runat="server" /&amp;gt;&amp;lt;br /&amp;gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;&amp;lt;asp:Button
   ID="btnCalc" runat="server" Text="Calculate"&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;OnClick="btnCalc_Click"
   /&amp;gt;&amp;lt;br /&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codelastwscreen style="MARGIN: 0cm 0cm 10pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;&amp;lt;asp:Label
   ID="lblResult" runat="server" /&amp;gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;The code-behind needs a property that specifies the type of operation
   to perform: addition, subtraction, division, or multiplication. The property is named &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;Operation&lt;/span&gt;&lt;/span&gt;,
   and is of type &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;OperationType&lt;/span&gt;&lt;/span&gt;,
   an enumeration that contains the values indicated above. Then, when the button is
   clicked, you simply retrieve the input strings, convert them to integers, perform
   the specified operation, and show the result (I’m not showing the type checks and
   other validations in order to keep this simple):&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;public enum
   OperationType : int&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;{&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Addition,&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Subtraction,&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Division,&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Multiplication&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;}&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
   &lt;o:p&gt;
      &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;&amp;nbsp;&lt;/font&gt;
   &lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;public partial
   class Calculator : System.Web.UI.UserControl&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;{&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;private
   OperationType _operation = OperationType.Addition;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;public
   OperationType Operation&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;get
   { return _operation; }&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;set
   { _operation = value; }&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;o:p&gt;
      &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;&amp;nbsp;&lt;/font&gt;
   &lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;protected
   void btnCalc_Click(object sender, EventArgs e)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;int
   op1 = Convert.ToInt32(txtOp1.Text);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;int
   op2 = Convert.ToInt32(txtOp2.Text);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;o:p&gt;
      &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;&amp;nbsp;&lt;/font&gt;
   &lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;if
   (this.Operation == OperationType.Addition)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;lblResult.Text
   = (op1 + op2).ToString();&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;else
   if (this.Operation == OperationType.Subtraction)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;lblResult.Text
   = (op1 - op2).ToString();&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;if
   (this.Operation == OperationType.Division)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;lblResult.Text
   = ((double)op1 / (double)op2).ToString();&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;else&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;lblResult.Text
   = (op1 * op2).ToString();&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codelastwscreen style="MARGIN: 0cm 0cm 10pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;}&lt;/font&gt;
&lt;/p&gt;
&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;So far this is a 100% standard user control. Even so, it can be
   used as a Web Part on a page. Actually, any control can be used as a Web Part: ASP.NET
   will take care of wrapping it into a &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;GenericWebPart&lt;/span&gt;&lt;/span&gt; at
   runtime. However, to enable users to personalize it by setting the properties, you
   need to add some attributes to the public properties that you want to make editable
   at runtime. In particular, the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;WebBrowsable&lt;/span&gt;&lt;/span&gt; attribute
   specifies that the property will be visible in the Web Part’s Editor box; the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;Personalizable&lt;/span&gt;&lt;/span&gt; attribute
   specifies whether the property is editable (either for the shared view or also at
   the user level in the personal view); the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;WebDisplayName&lt;/span&gt;&lt;/span&gt; specifies
   the property title in the editor box, so that it’s more understandable and user friendly;
   and the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;WebDescription&lt;/span&gt;&lt;/span&gt; attribute
   is a longer description of the property. In this example, you would decorate the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;Operation&lt;/span&gt;&lt;/span&gt; property
   with attributes as follows:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=code style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font face="Courier New" color=#000000&gt;private OperationType _operation = OperationType.Addition;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;[Personalizable(PersonalizationScope.User),&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;WebBrowsable,&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;WebDisplayName("Operation
   Type"),&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;WebDescription("The
   type of operation performed when submit is clicked.")]&lt;/font&gt;
&lt;/p&gt;
&lt;p class=code style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font face="Courier New" color=#000000&gt;public OperationType Operation&lt;/font&gt;
&lt;/p&gt;
&lt;p class=code style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font face="Courier New" color=#000000&gt;{&lt;/font&gt;
&lt;/p&gt;
&lt;p class=code style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;get
   { return _operation; }&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=code style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;set
   { _operation = value; }&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codelast style="MARGIN: 0cm 0cm 10pt 30pt"&gt;
   &lt;font face="Courier New" color=#000000&gt;}&lt;/font&gt;
&lt;/p&gt;
&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;Because this is just a normal user control that ASP.NET will wrap
   with &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;GenericWebPart&lt;/span&gt;&lt;/span&gt;,
   it doesn’t specify Web Part–specific attributes such as the title that should be listed
   on the Web Parts catalog, or an icon. You can add those attributes to a user control
   by implementing the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;IWebPart&lt;/span&gt;&lt;/span&gt; interface,
   which defines properties with self-descriptive names such as &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;Title&lt;/span&gt;&lt;/span&gt;, &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;Description&lt;/span&gt;&lt;/span&gt;, &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;TitleIconImageUrl&lt;/span&gt;&lt;/span&gt;, &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;CatalogIconImage&lt;/span&gt;&lt;/span&gt;,
   and &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;TitleUrl&lt;/span&gt;&lt;/span&gt;.
   You implement these properties as simple wrappers for private fields, as follows:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;public partial
   class Controls_Calculator : System.Web.UI.UserControl, IWebPart&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;{&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;private
   string _catalogIconImageUrl = "";&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;public
   string CatalogIconImageUrl&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;get
   { return _catalogIconImageUrl; }&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;set
   { _catalogIconImageUrl = value; }&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;o:p&gt;
      &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;&amp;nbsp;&lt;/font&gt;
   &lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;private
   string _description = "";&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;public
   string Description&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;get
   { return _description; }&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;set
   { _description = value; }&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;o:p&gt;
      &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;&amp;nbsp;&lt;/font&gt;
   &lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;protected
   string _subTitle = "";&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;public
   string Subtitle&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;get
   { return _subTitle; }&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;set
   { _subTitle = value; }&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;o:p&gt;
      &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;&amp;nbsp;&lt;/font&gt;
   &lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;protected
   string _title = "Online Calculator";&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;public
   string Title&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;get
   { return _title; }&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;set
   { _title = value; }&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;o:p&gt;
      &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;&amp;nbsp;&lt;/font&gt;
   &lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;private
   string _titleIconImageUrl = "";&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;public
   string TitleIconImageUrl&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;get
   { return _titleIconImageUrl; }&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;set
   { _titleIconImageUrl = value; }&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;o:p&gt;
      &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;&amp;nbsp;&lt;/font&gt;
   &lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;private
   string _titleUrl = "";&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;public
   string TitleUrl&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;get
   { return _titleUrl; }&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;set
   { _titleUrl = value; }&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font color=#000000&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=code style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;o:p&gt;
      &lt;font face="Courier New" color=#000000&gt;&amp;nbsp;&lt;/font&gt;
   &lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=code style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;//
   ...the rest of the class as shown earlier...&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codelast style="MARGIN: 0cm 0cm 10pt 30pt"&gt;
   &lt;font face="Courier New" color=#000000&gt;}&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
   &lt;font color=#000000&gt;&lt;font face=Verdana&gt;&lt;span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;Note
   that the &lt;/span&gt;&lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 12.0pt; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;_title&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt; field
   is initialized with &lt;/span&gt;&lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 12.0pt; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;“Online
   Calculator”&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;,
   which is the string that will be shown in the Web Part catalog to refer to this Web
   Part, and on the title bar of the Web Part itself when added on the page. You’ll learn
   how to build and use the catalog shortly.
&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;
   &lt;font size=2&gt;&amp;nbsp;&lt;/font&gt;&lt;font face=Verdana size=1&gt;&lt;em&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; This
   excerpt was taken from the book "ASP.NET 2.0 Website Programming". &lt;/em&gt;&lt;/font&gt;&lt;a href="http://www.dotnet2themax.com/blogs/mbellinaso/ct.ashx?id=081e87cc-d3b4-4ba4-a1cc-f49fc701a7ee&amp;amp;url=http%3a%2f%2fwww.dotnet2themax.com%2fBooksMarco.aspx" ?&gt;&lt;font face=Verdana size=1&gt;&lt;em&gt;Click
   here&lt;/em&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=Verdana size=1&gt;&lt;em&gt; to find more about it, and download
   the complete source code of the sample project.&lt;/em&gt;&lt;/font&gt;&gt;&gt;&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.dotnet2themax.com/blogs/mbellinaso/aggbug.ashx?id=9cef10c7-c7a0-4144-bb0e-a90c65e336fd" /&gt;</description>
      <comments>http://www.dotnet2themax.com/blogs/mbellinaso/CommentView,guid,9cef10c7-c7a0-4144-bb0e-a90c65e336fd.aspx</comments>
      <category>My Book</category>
    </item>
    <item>
      <trackback:ping>http://www.dotnet2themax.com/blogs/mbellinaso/Trackback.aspx?guid=081e87cc-d3b4-4ba4-a1cc-f49fc701a7ee</trackback:ping>
      <pingback:server>http://www.dotnet2themax.com/blogs/mbellinaso/pingback.aspx</pingback:server>
      <pingback:target>http://www.dotnet2themax.com/blogs/mbellinaso/PermaLink,guid,081e87cc-d3b4-4ba4-a1cc-f49fc701a7ee.aspx</pingback:target>
      <dc:creator>mbellinaso@codearchitects.com (Marco Bellinaso)</dc:creator>
      <wfw:comment>http://www.dotnet2themax.com/blogs/mbellinaso/CommentView,guid,081e87cc-d3b4-4ba4-a1cc-f49fc701a7ee.aspx</wfw:comment>
      <wfw:commentRss>http://www.dotnet2themax.com/blogs/mbellinaso/SyndicationService.asmx/GetEntryCommentsRss?guid=081e87cc-d3b4-4ba4-a1cc-f49fc701a7ee</wfw:commentRss>
      <title>An excerpt from Chapter 7: Creating and Sending E-mails</title>
      <guid>http://www.dotnet2themax.com/blogs/mbellinaso/PermaLink,guid,081e87cc-d3b4-4ba4-a1cc-f49fc701a7ee.aspx</guid>
      <link>http://www.dotnet2themax.com/blogs/mbellinaso/PermaLink,guid,081e87cc-d3b4-4ba4-a1cc-f49fc701a7ee.aspx</link>
      <pubDate>Sat, 22 Apr 2006 08:29:13 GMT</pubDate>
      <description>&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font size=1&gt;&lt;/font&gt;
   &lt;br&gt;
   &lt;font color=#000000&gt;The &lt;font size=2&gt;&lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;System.Net.Mail&lt;/span&gt;&lt;/span&gt; namespace
   defined in the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;System.dll&lt;/span&gt;&lt;/span&gt; assembly
   contains all the classes used to send e-mails. The older &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;System.Web.Mail&lt;/span&gt;&lt;/span&gt; namespace,
   and its related classes, that were used with ASP.NET 1.x are still there, but its
   use has been deprecated now in favor of these new classes in ASP.NET 2.0 that provide
   more features. The principal classes are &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;MailMessage&lt;/span&gt;&lt;/span&gt;,
   which represents an e-mail message, and the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;SmtpClient&lt;/span&gt;&lt;/span&gt; class,
   which provides the methods used to send a &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;MailMessage&lt;/span&gt;&lt;/span&gt; by
   connecting to a configured SMTP server (SMTP is the Simple Mail Transfer Protocol,
   which is the low-level protocol used by Microsoft Exchange and other mail servers).&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;&lt;font size=2&gt;&lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;MailMessage&lt;/span&gt;&lt;/span&gt; fully
   describes an e-mail message, with its subject, body (in plain-text, HTML, or in both
   formats), the To, CC, and BCC addresses, and any attachments that might be used. The
   simplest way to create an e-mail is using the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;MailMessage&lt;/span&gt;&lt;/span&gt; constructor,
   which takes the sender’s address, the recipient’s address, the mail’s subject, and
   the body, as shown below:&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;MailMessage
   mail = new MailMessage(&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codelastwscreen style="MARGIN: 0cm 0cm 10pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;"from@somewhere.com",
   "to@somewhere.com", "subject", "body");&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;However, this approach will be too limited in most cases, because
   you may want to specify the sender’s display name in addition to his e-mail address
   (the display name is what is displayed by the mail client, if present, instead of
   the address, and makes the mail and its sender look more professional). You may also
   want to send to more than one recipient, use an a HTML body (as an alternative, or
   in addition, to the plain-text version), include some attachments, use a different
   encoding, modify the mail’s priority, and so on. All these settings, and more, are
   specified by means of a number of instance properties of the &lt;font size=2&gt;&lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;MailMessage&lt;/span&gt;&lt;/span&gt; class.
   Their names should be self-explanatory, and some examples include the following: &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;Subject&lt;/span&gt;&lt;/span&gt;, &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;Body&lt;/span&gt;&lt;/span&gt;, &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;IsBodyHtml&lt;/span&gt;&lt;/span&gt;, &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;From&lt;/span&gt;&lt;/span&gt;, &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;To&lt;/span&gt;&lt;/span&gt;, &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;CC&lt;/span&gt;&lt;/span&gt;, &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;Bcc&lt;/span&gt;&lt;/span&gt;, &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;BodyEncoding&lt;/span&gt;&lt;/span&gt;, &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;Attachments&lt;/span&gt;&lt;/span&gt;, &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;AlternateViews&lt;/span&gt;&lt;/span&gt;, &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;Headers&lt;/span&gt;&lt;/span&gt;, &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;Priority&lt;/span&gt;&lt;/span&gt;,
   and &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;ReplyTo&lt;/span&gt;&lt;/span&gt;.
   The class’ constructor enables you to specify a &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;From&lt;/span&gt;&lt;/span&gt; property
   of type &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;MailAddress&lt;/span&gt;&lt;/span&gt;, &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;Address&lt;/span&gt;&lt;/span&gt;,
   and &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;UserName&lt;/span&gt;&lt;/span&gt; properties.
   The &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;To&lt;/span&gt;&lt;/span&gt;, &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;CC&lt;/span&gt;&lt;/span&gt;,
   and &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;Bcc&lt;/span&gt;&lt;/span&gt; properties
   are of type &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;MailAddressCollection&lt;/span&gt;&lt;/span&gt;,
   and thus can accept multiple &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;MailAddress&lt;/span&gt;&lt;/span&gt; instances
   (you can add them by means of the collection’s &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;Add&lt;/span&gt;&lt;/span&gt; method).
   Similarly, the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;MailMessage&lt;/span&gt;&lt;/span&gt;’s &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;Attachments&lt;/span&gt;&lt;/span&gt; property
   is of type &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;AttachmentCollection&lt;/span&gt;&lt;/span&gt;,
   a collection of &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;Attachment&lt;/span&gt;&lt;/span&gt; instances
   that point to files located on the server. The following example shows how to build
   a HTML-formatted e-mail message that will be sent to multiple recipients, with high
   priority, and that includes a couple of attachments:&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;// create
   the message&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;MailMessage
   mail = new MailMessage();&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;// set the
   sender's address and display name&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;mail.From
   = new MailAddress("mbellinaso@wrox.com", "Marco Bellinaso");&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;// add a
   first recipient by specifying only her address&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;mail.To.Add("john@wroxfans.com");&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;// add a
   second recipient by specifying her address and display name&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;mail.To.Add(new
   MailAddress("anne@wroxfans.com", "Anne Gentle"));&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;// add a
   third recipient, but to the CC field this time&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;mail.CC.Add("mike@wroxfans.com");&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;// set the
   mail's subject and HTML body&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;mail.Subject
   = "Sample Mail";&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;mail.Body
   = "Hello, &amp;lt;b&amp;gt;my friend&amp;lt;/b&amp;gt;!&amp;lt;br /&amp;gt;How are you?";&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;mail.IsBodyHtml
   = true;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;// set the
   mail’s priority to high&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;mail.Priority
   = MailPriority.High;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;// add a
   couple of attachments&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;mail.Attachments.Add(&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;new
   Attachment(@"c:\demo.zip", MediaTypeNames.Application.Octet));&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;mail.Attachments.Add(&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codelastwscreen style="MARGIN: 0cm 0cm 10pt 30pt"&gt;
   &lt;font color=#000000&gt;&lt;font style="BACKGROUND-COLOR: #e6e6e6"&gt;&lt;font face="Courier New"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;new
   Attachment(@"c:\report.xls", MediaTypeNames.Application.Octet));&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;If you also wanted to provide a plain-text version of the body
   in the same mail, so that the display format (plain text or HTML) would depend on
   the user’s e-mail client settings, you would add the following lines:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;string body
   = "Hello, my friend!\nHow are you?";&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;&lt;?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /&gt;AlternateView 
   &lt;st1:place w:st="on"&gt;
      &lt;st1:City w:st="on"&gt;plainView&lt;/st1:City&gt;
   &lt;/st1:place&gt;
   = new AlternateView(body, MediaTypeNames.Text.Plain);&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codelastwscreen style="MARGIN: 0cm 0cm 10pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;mail.AlternateViews.Add(&lt;st1:place w:st="on"&gt;
      &lt;st1:City w:st="on"&gt;plainView&lt;/st1:City&gt;
   &lt;/st1:place&gt;
   );&lt;/font&gt;
&lt;/p&gt;
&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;Once a &lt;font size=2&gt;&lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;MailMessage&lt;/span&gt;&lt;/span&gt; object
   is ready, the e-mail message it describes can be sent out by means of the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;Send&lt;/span&gt;&lt;/span&gt; method
   of the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;SmtpClient&lt;/span&gt;&lt;/span&gt; class,
   as shown here:&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codewscreen style="MARGIN: 0cm 0cm 0pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;SmtpClient
   smtpClient = new SmtpClient();&lt;/font&gt;
&lt;/p&gt;
&lt;p class=codelastwscreen style="MARGIN: 0cm 0cm 10pt 30pt"&gt;
   &lt;font style="BACKGROUND-COLOR: #e6e6e6" face="Courier New" color=#000000&gt;smtpClient.Send(mail);&lt;/font&gt;
&lt;/p&gt;
&lt;p class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;
   &lt;font color=#000000&gt;Before calling the &lt;font size=2&gt;&lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;Send&lt;/span&gt;&lt;/span&gt; method,
   you may need to set some configuration settings, such as the SMTP server’s address
   (the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;SmtpClient&lt;/span&gt;&lt;/span&gt;’s &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;Host&lt;/span&gt;&lt;/span&gt; property),
   port (the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;Port&lt;/span&gt;&lt;/span&gt; property)
   and its credentials (the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;Credentials&lt;/span&gt;&lt;/span&gt; property),
   whether the connection in encrypted with SSL (the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;EnableSsl&lt;/span&gt;&lt;/span&gt; property),
   and the timeout in milliseconds for sending the mail (the &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;Timeout&lt;/span&gt;&lt;/span&gt; property,
   which defaults to 100 seconds). An important property is &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;DeliveryMethod&lt;/span&gt;&lt;/span&gt;,
   which defines how the mail message is delivered. It’s of type &lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'"&gt;SmtpDeliveryMethod&lt;/span&gt;&lt;/span&gt;,
   an enumeration with the following values:&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;ul&gt;
   &lt;li&gt;
      &lt;div class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;&lt;font color=#000000&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Network:&lt;/b&gt; The
         e-mail is sent through a direct connection to the specified SMTP server.&lt;/font&gt;
      &lt;/div&gt;
   &lt;li&gt;
      &lt;div class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;&lt;font color=#000000&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;PickupDirectoryFromIis:&lt;/b&gt; The
         e-mail message is prepared and the EML file is saved into the default directory from
         which IIS picks up queued e-mails to send. By default this is &lt;font size=2&gt;&lt;span class=CodeinText&gt;&lt;span style="FONT-SIZE: 9.5pt; LETTER-SPACING: 0pt; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: Times"&gt;&amp;lt;drive&amp;gt;:\Inetpub\mailroot\Queue&lt;/span&gt;&lt;/span&gt;.&lt;/font&gt;&lt;/font&gt;
      &lt;/div&gt;
   &lt;li&gt;
      &lt;div class=GX style="MARGIN: 0cm 0cm 11pt 14.4pt"&gt;&lt;font color=#000000&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;SpecifiedPickupDirectory:&lt;/b&gt; The
         EML file with the mail being sent is saved into the location specified by the &lt;font size=2&gt;&lt;