<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.sciosoft.com/~d/styles/itemcontent.css"?><rss xmlns:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" 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:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>ScioSoft's Community Blogs</title>
    <description>Optimized IT musings for the technically inclined</description>
    <link>http://blogs.sciosoft.com/blogs/</link>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>BlogEngine.NET 1.6.0.0</generator>
    <language>en-CA</language>
    <blogChannel:blogRoll>http://blogs.sciosoft.com/blogs/opml.axd</blogChannel:blogRoll>
    <blogChannel:blink>http://blogs.sciosoft.com/syndication.axd</blogChannel:blink>
    <dc:creator>James Fielding</dc:creator>
    <dc:title>ScioSoft's Community Blogs</dc:title>
    <geo:lat>0.000000</geo:lat>
    <geo:long>0.000000</geo:long>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.sciosoft.com/sciosoftblogs" /><feedburner:info uri="sciosoftblogs" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
      <title>Hosting Your Server: Dedicated  vs. Colocation</title>
      <description>&lt;p&gt;As hardware costs drop, and the need to control IT costs increases, we&amp;rsquo;ve noticed that colocation is becoming a viable option for many small and medium-sized businesses (SMB). Whether you're using a Microsoft&amp;nbsp;or Linux-based system,&amp;nbsp;&amp;nbsp;here&amp;rsquo;s the bottom line:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Dedicated server(s):&lt;/strong&gt; You&amp;rsquo;re renting servers from someone on a server-by-server basis.&lt;/p&gt;
&lt;p&gt;With dedicated servers, you pay a premium for not worrying about the hardware: If there are any hardware issues, someone else replaces/fixes it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Colocation: &lt;/strong&gt;You&amp;rsquo;re renting space for your server&amp;nbsp;from someone.&lt;/p&gt;
&lt;p&gt;In the case of colocation, you get an allotted amount of physical space in a facility that provides your hardware with power and bandwidth, as well as an ideal environment (e.g. climate control, power supply management, facility security), but what you put in your space is up to you.&lt;/p&gt;
&lt;h2&gt;What&amp;rsquo;s Best for You?&lt;/h2&gt;
&lt;p&gt;Of course, there&amp;rsquo;s no&amp;nbsp;"one-size-fits-all" answer, but here are some things to consider:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In general, for short-term projects (less than a year), dedicated servers are cheaper and easier. But if your hosting requirements are more than two years in duration, you&amp;rsquo;ll likely see significant cost-savings in going with colocation.&lt;/li&gt;
&lt;li&gt;In the past, it used to be that if you needed only one or two servers, and after factoring for Microsoft license costs, you were left with the non-choice choice: You went dedicated. But today, with MS Small Business Server, and Essential Business Server being really cost-effective alternatives for SMB, we&amp;rsquo;ve seen a dramatic shift. Now, you can run a Small or Essential Business Server offsite using colocation, which is something that most dedicated server providers can&amp;rsquo;t do for you. This has dramatically shifted the landscape for SMBs looking to implement MS server solutions.&lt;/li&gt;
&lt;li&gt;Also, a lot depends on your technical experience and abilities. If you, or a member of your team, is comfortable with computers, then colocation is a reasonable choice. If you know and/or care little about servers, switches, networking, and firewalls, then you may need to factor in the cost of outsourcing this portion of your IT administration.&lt;/li&gt;
&lt;li&gt;Finally, if you want to have physical access to your machine, then colocation is the obvious answer for you. &lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Other Things to Consider&lt;/h2&gt;
&lt;p&gt;There are a couple of points-of-confusion that seem to always come up in the dedicated versus colocation debate. Here's some clarification:&lt;/p&gt;
&lt;h3&gt;Bandwidth&lt;/h3&gt;
&lt;p&gt;This probably causes the most confusion when comparing dedicated to colocation. &lt;strong&gt;When you&amp;rsquo;re coming from managed hosting, you&amp;rsquo;re used to thinking about your bandwidth quota as the total transfer limit for the month calculated in gigabytes (GB)&lt;/strong&gt;. Denoting bandwidth usage this way helps non-network-savvy people understand exactly how much data they can move in a month, but as a network administrator, you&amp;rsquo;re really concerned with the amount of data moving through your pipe at any given second, or your Mbit/s rate.&lt;/p&gt;
&lt;p&gt;As such, &lt;strong&gt;when you move into colocation, the provider sells you bandwidth based on how they're billed - per mbps transferred&lt;/strong&gt;, typically measured using 95th percentile billing (see below). So, given a colocation 1 Mbit/s transfer rate, and having it running at the limit each second for a month, you&amp;rsquo;d theoretically end up with:&lt;/p&gt;
&lt;p&gt;(1,000,000 / 8bits * 60s * 60m * 24h * 30.5days) / 1,000,000,000 = ~330GB/month&lt;/p&gt;
&lt;p&gt;&amp;ldquo;But what about 1Mbit/s actually equalling 1024Kbit/s,&amp;rdquo; you say? Well, as it turns out in data communications, signal pulses and have historically been counted using the decimal number system, so a megabit is 1,000,000 bits and a kilobit is 1,000 bits.&lt;br /&gt;Of course, colocation bandwidth limits apply to metered usage accounts. Some providers have unmetered bandwidth, which comes with a price tag to match this convenience.&lt;/p&gt;
&lt;h3&gt;95th Percentile Billing&lt;/h3&gt;
&lt;p&gt;The 95th percentile is the mathematical calculation most widely used to determine billings for variable rate or "burstable" network bandwidth connections. It works like this:&lt;/p&gt;
&lt;p&gt;You subscribe to a colocation service that includes a network bandwidth allowance stated in Mbit/s. As such, you&amp;rsquo;re permitted to consume as much bandwidth as you wish up to this limit. Since most networks are oversubscribed, there is often some room for some bursting without advanced planning, when it comes time to bill you for your usage, your provider ignores the top 5% of your peak usage, and bills your bandwidth transfer rate at the 95th Percentile.&lt;/p&gt;
&lt;p&gt;As long as your 95th Percentile transfer rate is at or below your bandwidth allowance, there are no additional fees. If, however, you exceed your allowance then you are invoiced for the additional bandwidth you consume.&lt;/p&gt;
&lt;p&gt;For example, for 100 transfer rate samples, if the top 10 records were:&lt;/p&gt;
&lt;table border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Top 10 Records&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Sample Rate&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Comment&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;100&lt;/td&gt;
&lt;td&gt;2180 Kbps&lt;/td&gt;
&lt;td&gt;Ignored (top 5%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;99&lt;/td&gt;
&lt;td&gt;1970 Kbps&lt;/td&gt;
&lt;td&gt;Ignored (top 5%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;98&lt;/td&gt;
&lt;td&gt;1800 Kbps&lt;/td&gt;
&lt;td&gt;Ignored (top 5%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;97&lt;/td&gt;
&lt;td&gt;1560 Kbps&lt;/td&gt;
&lt;td&gt;Ignored (top 5%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;96&lt;/td&gt;
&lt;td&gt;940 Kbps&lt;/td&gt;
&lt;td&gt;Ignored (top 5%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;95&lt;/td&gt;
&lt;td&gt;920 Kbps&lt;/td&gt;
&lt;td&gt;*95th Percentile*&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;94&lt;/td&gt;
&lt;td&gt;880Kbps&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;93&lt;/td&gt;
&lt;td&gt;850 Kbps&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;92&lt;/td&gt;
&lt;td&gt;780 Kbps&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;91&lt;/td&gt;
&lt;td&gt;720 Kbps&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;In this case, even though you sometimes sustained traffic at speeds as high as 2180 Kbps, your actual 95th percentile consumption was 920 Kbps. If your subscription included 1Mbit/s of network traffic then your usage is below your subscription allowance.&lt;/p&gt;
&lt;p&gt;Hopefully this overview will help you implement the best hosting solution for your business.&lt;/p&gt;
&lt;p&gt;Happy Hosting,&lt;br /&gt;James Fielding&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/47Mn6wqsma9TjBQy82LRc-1G89g/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/47Mn6wqsma9TjBQy82LRc-1G89g/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/47Mn6wqsma9TjBQy82LRc-1G89g/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/47Mn6wqsma9TjBQy82LRc-1G89g/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/sciosoftblogs/~4/vADHQjB-p7Y" height="1" width="1"/&gt;</description>
      <link>http://feeds.sciosoft.com/~r/sciosoftblogs/~3/vADHQjB-p7Y/post.aspx</link>
      <author>ScioJim</author>
      <comments>http://blogs.sciosoft.com/blogs/post/2010/04/22/Hosting-Your-Server-Dedicated-vs-Colocation.aspx#comment</comments>
      <guid isPermaLink="false">http://blogs.sciosoft.com/blogs/post.aspx?id=574c2388-bf61-4d72-ba51-9a2a37ff9b03</guid>
      <pubDate>Thu, 22 Apr 2010 16:21:00 -0400</pubDate>
      <category>Business Decisions</category>
      <category>IT Systems</category>
      <category>Server</category>
      <dc:publisher>ScioJim</dc:publisher>
      <pingback:server>http://blogs.sciosoft.com/blogs/pingback.axd</pingback:server>
      <pingback:target>http://blogs.sciosoft.com/blogs/post.aspx?id=574c2388-bf61-4d72-ba51-9a2a37ff9b03</pingback:target>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://blogs.sciosoft.com/blogs/trackback.axd?id=574c2388-bf61-4d72-ba51-9a2a37ff9b03</trackback:ping>
      <wfw:comment>http://blogs.sciosoft.com/blogs/post/2010/04/22/Hosting-Your-Server-Dedicated-vs-Colocation.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.sciosoft.com/blogs/syndication.axd?post=574c2388-bf61-4d72-ba51-9a2a37ff9b03</wfw:commentRss>
    <feedburner:origLink>http://blogs.sciosoft.com/blogs/post.aspx?id=574c2388-bf61-4d72-ba51-9a2a37ff9b03</feedburner:origLink></item>
    <item>
      <title>Feed Control: Redirect RSS feeds to FeedBurner and AdSense using CNAME</title>
      <description>&lt;p&gt;If you are anything like me, then you spend a significant amount of your professional life thinking about "what ifs". What if a system's user does this? What if a hacker does that? &lt;strong&gt;What if the good people at Google mistakenly&amp;nbsp;sell &lt;a title="Go to FeedBurner" href="http://feedburner.google.com/"&gt;FeedBurner&lt;/a&gt; to some evil people, who in-turn take my redirected RSS (or ATOM) blog or news feed hostage?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Whether your using &lt;a title="Go to Wordpress" href="http://wordpress.org/"&gt;Wordpress&lt;/a&gt;, &lt;a title="Go to BlogEngine.NET" href="http://www.dotnetblogengine.net/"&gt;BlogEngine.NET&lt;/a&gt;, or another syndication CMS, many administrators look at moving their feeds to FeedBurner to monetize their feed using &lt;a title="Go to Adsense" href="http://adsense.google.com"&gt;AdSense&lt;/a&gt;, or to gain access to some great syndication and analysis tools.&amp;nbsp; Some of these people happily redirect their subscribers directly to FeedBurner's feeds at http://feeds.feedburner.com, without a second thought.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;BE FOREWARNED: If at some point you are unhappy, and decide to leave, you can't simply redirect your feed elsewhere, again&lt;/strong&gt;. This would be known as "committing blogicide", as you won't be taking your old subscribers with you; you're just redirecting the new subscribers. This is obviously less than ideal.&lt;/p&gt;
&lt;p&gt;As it stands today: Don't worry, you may be OK. If you decide to leave FeedBurner, as of this post's publish date, the good people at Google have provided tools to transfer your feed elsewhere. Having said this, if you've linked directly, you'll be relying on their system to exist in the future to do the transfer. &lt;strong&gt;Everything else being equal, I'd prefer to have control&lt;/strong&gt;, rather than give it away and rely on someone else. After all, it's my feed. I should own it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Here's how you keep control of your feed:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Determine if your hosting provider will &lt;strong&gt;allow you to create a CNAME entry in your site's DNS records&lt;/strong&gt;.&amp;nbsp;This may sound complicated, but it's not. If you're using a shared hosting account, you may be able to do this through your control panel, or you may have to email your helpdesk to do it for you. Check you provider's knowledge base, or email their helpdesk directly to get a straight answer.&lt;/li&gt;
&lt;li&gt;You'll also need to &lt;strong&gt;be able to add subdomains to your site&lt;/strong&gt;. It is common to name your feed subdomain something like "feeds.mysite.com" or "rss.mysite.com". You don't need to add the subdomain, yet. We'll do this in step 5. But, if you are in doubt about if/how to do this, check it out with your helpdesk, too.&lt;/li&gt;
&lt;li&gt;If step 1 &amp;amp; 2 are doable, log into your Google's FeedBurner account. If you haven't already set up a FeedBurner feed for each of your existing feeds, do so now. Just so there is no confusion, I'm going to rephrase what we're doing here: In this step we're telling FeedBurner where you currently publish your xml feed files on your site.&lt;/li&gt;
&lt;li&gt;While still logged into FeedBurner,&amp;nbsp; go to My Account &amp;gt; Services &amp;gt; MyBrand. Here you'll find the critical CNAME entry snippet. It will look something like:&lt;br /&gt;&lt;br /&gt;
&lt;div class="code"&gt;feeds CNAME xxxxxx.feedproxy.ghs.google.com&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;where "xxxxxx" will be replaced by your FeedBurner account's unique ID. &lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;Go back to your hosting provider and, using the snippet, set up your feed subdomain and add the CNAME entry to it. I can't really walk you through this, as it as the steps are going to be hosting provider specific, but your helpdesk should be happy to walk you through it. If not, find another provider.&lt;/li&gt;
&lt;li&gt;You may need to wait a few hours for the CNAME entry to propagate. You'll know it's propagated when you type in your new subdomain's address in your browser, and the page looks like you've arrived at FeedBurner. It will probably be showing an error, since we haven't activated the MyBrand service, yet. If it still hasn't propagated after 24 hours, check to make sure that your CNAME entry is identically to Google's snippet, and seek out your hosting provider's helpdesk for assistance.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;Return to FeedBurner's MyBrand, enter your newly created feed subdomain, and activate the service.&lt;/li&gt;
&lt;li&gt;Redirect your site's feed subscription buttons through your new feed subdomain. For example if your FeedBurner blog feed is http://feeds.feedburner.com/mysiteblog, and your new subdomain was http://feeds.mysite.com, then you'd redirect to http://feeds.mysite.com/mysiteblog. &lt;/li&gt;
&lt;/ol&gt;
&lt;p class="style1" style="padding-left: 30px;"&gt;NOTE: You can create additional FeedBurner feeds and access them all through your feed subdomain. For example, if you also have a news feed for your site, you could burn your feed to http://feeds.feedburner.com/mysitenews, and then have your subscribers access it at&amp;nbsp; http://feeds.mysite.com/mysitenews.&lt;/p&gt;
&lt;p&gt;So now, &lt;strong&gt;to your subscribers, it&amp;nbsp;appears that&amp;nbsp;your site is&amp;nbsp;hosting your FeedBurner feed&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The great news is, if you've already given up your feed by linking subscribers directly to FeedBurner, you can still implement a CNAME redirect. It won't get you back full control, but it will be good for new subscribers going forward, and you may be able to use FeedBurner's transfer tools to get everything back (I've never used the transfer tools, so if you do,&amp;nbsp;let me know how this goes).&lt;/p&gt;
&lt;p&gt;As you can see, not only have we future-proofed our feed, but we've given our site a professional-looking feed subdomain, and a feed address that is likely more user friendly, Moreover, we've also future-proofed ourselves: &lt;strong&gt;At some point, if you don't like your blog engine, it's no problem. Just swap it out&lt;/strong&gt;. You'll need to relink your Feedburner feed, but your subscribers won't know the difference.&lt;/p&gt;
&lt;p&gt;All in all, I'd say&amp;nbsp;what we've done today isn't&amp;nbsp;bad for an hours work.&lt;/p&gt;
&lt;p&gt;Keep the power,&lt;br /&gt;James Fielding&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/9ThRjiQ4HlMDijqKuj1YoE1sXss/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9ThRjiQ4HlMDijqKuj1YoE1sXss/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/9ThRjiQ4HlMDijqKuj1YoE1sXss/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9ThRjiQ4HlMDijqKuj1YoE1sXss/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/sciosoftblogs/~4/VTqG6oTC6CA" height="1" width="1"/&gt;</description>
      <link>http://feeds.sciosoft.com/~r/sciosoftblogs/~3/VTqG6oTC6CA/post.aspx</link>
      <author>ScioJim</author>
      <comments>http://blogs.sciosoft.com/blogs/post/2010/03/25/Feed-Control-Redirect-RSS-feeds-to-FeedBurner-and-AdSense-using-CNAME.aspx#comment</comments>
      <guid isPermaLink="false">http://blogs.sciosoft.com/blogs/post.aspx?id=86a3f491-cb9e-4954-9ab5-ee14f53180e9</guid>
      <pubDate>Thu, 25 Mar 2010 11:02:00 -0400</pubDate>
      <category>Server</category>
      <category>Syndication</category>
      <category>Web Development</category>
      <dc:publisher>ScioJim</dc:publisher>
      <pingback:server>http://blogs.sciosoft.com/blogs/pingback.axd</pingback:server>
      <pingback:target>http://blogs.sciosoft.com/blogs/post.aspx?id=86a3f491-cb9e-4954-9ab5-ee14f53180e9</pingback:target>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://blogs.sciosoft.com/blogs/trackback.axd?id=86a3f491-cb9e-4954-9ab5-ee14f53180e9</trackback:ping>
      <wfw:comment>http://blogs.sciosoft.com/blogs/post/2010/03/25/Feed-Control-Redirect-RSS-feeds-to-FeedBurner-and-AdSense-using-CNAME.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.sciosoft.com/blogs/syndication.axd?post=86a3f491-cb9e-4954-9ab5-ee14f53180e9</wfw:commentRss>
    <feedburner:origLink>http://blogs.sciosoft.com/blogs/post.aspx?id=86a3f491-cb9e-4954-9ab5-ee14f53180e9</feedburner:origLink></item>
    <item>
      <title>Build an AJAX Contact Us Form using network callbacks in ASP.NET</title>
      <description>&lt;p style="text-align: right;"&gt;&lt;a title="Introduction to Build an AJAX Contact Us form page in ASP.NET" href="http://blogs.sciosoft.com/post.aspx?id=f9330061-eb0d-465c-8c6b-be633e2379d2"&gt;Intro&lt;/a&gt;&amp;nbsp;|&amp;nbsp;&lt;a href="http://blogs.sciosoft.com/post.aspx?id=9a10bccd-3eef-48fb-aafc-97f0b08efe2d"&gt;Part 1&lt;/a&gt;&amp;nbsp;|&amp;nbsp;Part 2&lt;/p&gt;
&lt;p&gt;So we're on the third instalment of this three-part tutorial series,&amp;nbsp;where you and I are&amp;nbsp;building an AJAX Contact Us form in ASP.NET, a couple of different ways. If you need a recap, here are the links to the &lt;a title="Introduction to Build an AJAX Contact Us form page in ASP.NET" href="http://blogs.sciosoft.com/post.aspx?id=f9330061-eb0d-465c-8c6b-be633e2379d2"&gt;introduction&lt;/a&gt;&amp;nbsp;and the&amp;nbsp;&lt;a href="http://blogs.sciosoft.com/post.aspx?id=9a10bccd-3eef-48fb-aafc-97f0b08efe2d"&gt;partial-page updates&lt;/a&gt; method. In this article we&amp;rsquo;re going to put the "less is more" principle into action by initiating our network callbacks directly from client-side JavaScript code, and we'll also build an AJAX-enabled web service to handle our call. As in&amp;nbsp;&lt;a href="http://blogs.sciosoft.com/post.aspx?id=9a10bccd-3eef-48fb-aafc-97f0b08efe2d"&gt;Part 1&lt;/a&gt;, I&amp;rsquo;m going to assume that you are comfortable using &lt;a href="http://www.microsoft.com/visualstudio/"&gt;Visual Studio&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You can download the source files for this project &lt;a href="http://blogs.sciosoft.com/file.axd?file=2010%2f3%2fAJAXEnabledContactForm.zip"&gt;AJAXEnabledContactForm.zip (45.6 kb)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;So we're going from partial-page updates using the asp:UpdatePanel, to network callbacks through a web service using HTML controls. The main reason you'd go this way is to drastically reduce your data transfer between the client and server. And why is this? Well, for two reasons: First, unlike partial-page updates, we're not passing all the form's data back to the server, just the required parameters in an XML wrapper. Second, we're not executing the page's full life-cycle back on the server from the postback, either. So if you're looking for efficiency, this is the way to go.&lt;/p&gt;
&lt;p&gt;We'll be continuing on with the project that we created in&amp;nbsp;&lt;a href="http://blogs.sciosoft.com/post.aspx?id=9a10bccd-3eef-48fb-aafc-97f0b08efe2d"&gt;Part 1&lt;/a&gt;, which we called &amp;ldquo;AjaxEnabledContactForm&amp;rdquo;. Let's start with the our web service, which is going to provide the service methods that our Contact Us form calls. So I`ve created a new web service called "ContactUs.asmx". Since we've already seen the some of this code in&amp;nbsp;&lt;a href="http://blogs.sciosoft.com/post.aspx?id=9a10bccd-3eef-48fb-aafc-97f0b08efe2d"&gt;Part 1&lt;/a&gt;, I'll give you the full page first, and then we'll walk through it.&lt;/p&gt;
&lt;p&gt;&lt;div class="code"&gt;
&lt;span class="kwrd"&gt;Imports&lt;/span&gt; System.Web.Services&lt;br /&gt;&lt;span class="kwrd"&gt;Imports&lt;/span&gt; System.Web.Services.Protocols&lt;br /&gt;&lt;span class="kwrd"&gt;Imports&lt;/span&gt; System.ComponentModel&lt;br /&gt;&lt;br /&gt;&amp;lt;System.Web.Script.Services.ScriptService()&amp;gt; _&lt;br /&gt;&amp;lt;System.Web.Services.WebService(&lt;span class="kwrd"&gt;Namespace&lt;/span&gt;:=&lt;span class="str"&gt;"http://xmlforasp.net"&lt;/span&gt;)&amp;gt; _&lt;br /&gt;&amp;lt;System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)&amp;gt; _&lt;br /&gt;&lt;span class="kwrd"&gt;Public&lt;/span&gt; &lt;span class="kwrd"&gt;Class&lt;/span&gt; ContactUs&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;Inherits&lt;/span&gt; System.Web.Services.WebService&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;WebMethod()&amp;gt; _&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;Public&lt;/span&gt; &lt;span class="kwrd"&gt;Function&lt;/span&gt; Submit(&lt;span class="kwrd"&gt;ByVal&lt;/span&gt; strEmail &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;String&lt;/span&gt;, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; strComment &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;String&lt;/span&gt;) &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Boolean&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Threading.Thread.Sleep(5000)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;Return&lt;/span&gt; SendMail(strEmail, strComment)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Function&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;Private&lt;/span&gt; &lt;span class="kwrd"&gt;Function&lt;/span&gt; SendMail(&lt;span class="kwrd"&gt;ByVal&lt;/span&gt; strEmail &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;String&lt;/span&gt;, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; strComment &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;String&lt;/span&gt;) &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Boolean&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;Dim&lt;/span&gt; mailMessage &lt;span class="kwrd"&gt;As&lt;/span&gt; System.Net.Mail.MailMessage = &lt;span class="kwrd"&gt;New&lt;/span&gt; System.Net.Mail.MailMessage()&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mailMessage.From = &lt;span class="kwrd"&gt;New&lt;/span&gt; System.Net.Mail.MailAddress(&lt;span class="str"&gt;"myserver@mysite.com"&lt;/span&gt;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mailMessage.&lt;span class="kwrd"&gt;To&lt;/span&gt;.Add(&lt;span class="kwrd"&gt;New&lt;/span&gt; System.Net.Mail.MailAddress(&lt;span class="str"&gt;"me@mysite.com"&lt;/span&gt;))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mailMessage.ReplyTo = &lt;span class="kwrd"&gt;New&lt;/span&gt; System.Net.Mail.MailAddress(strEmail.Trim())&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '&lt;span class="kwrd"&gt;Set&lt;/span&gt; additional options&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mailMessage.Priority = Net.Mail.MailPriority.Normal&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mailMessage.IsBodyHtml = &lt;span class="kwrd"&gt;False&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '&lt;span class="kwrd"&gt;Set&lt;/span&gt; the subjet &lt;span class="kwrd"&gt;and&lt;/span&gt; body text&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mailMessage.Subject = &lt;span class="str"&gt;"Contact Us Form from: "&lt;/span&gt; &amp;amp; strEmail.Trim&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mailMessage.Body = strComment&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Create an instance of the SmtpClient &lt;span class="kwrd"&gt;class&lt;/span&gt; &lt;span class="kwrd"&gt;for&lt;/span&gt; sending the email&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'using web.config settings&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;Dim&lt;/span&gt; smtpClient &lt;span class="kwrd"&gt;As&lt;/span&gt; System.Net.Mail.SmtpClient = &lt;span class="kwrd"&gt;New&lt;/span&gt; System.Net.Mail.SmtpClient()&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;Try&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; smtpClient.Send(mailMessage)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;Catch&lt;/span&gt; ex &lt;span class="kwrd"&gt;As&lt;/span&gt; System.Net.Mail.SmtpException&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;Return&lt;/span&gt; &lt;span class="kwrd"&gt;False&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;Catch&lt;/span&gt; ex &lt;span class="kwrd"&gt;As&lt;/span&gt; Exception&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;Return&lt;/span&gt; &lt;span class="kwrd"&gt;False&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;Finally&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mailMessage.Dispose()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Try&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;Return&lt;/span&gt; &lt;span class="kwrd"&gt;True&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Function&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Class&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;The nice thing about doing our Contact Us form through a web service is that we can have&amp;nbsp;both as a separate applications in&amp;nbsp;our production evironment, so if there is a problem in our main application, the service is still available for other applications, or vice-versa.  Web services also lend themselves well to being configured to record submissions to a database. Note: Our setup could be significantly improved by making the service multi-tier, and dealing with the service's security, but what we've done today will definitely get you started.&lt;/p&gt;
&lt;p&gt;So to step through this code, the first thing we did was make our service methods callable by JavaScript. That's why we added the following attribute:&lt;/p&gt;
&lt;p&gt;&lt;div class="code"&gt;
&amp;lt;System.Web.Script.Services.ScriptService()&amp;gt; _&lt;br /&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;This magic little snippet allows the ASP.NET AJAX extension runtime to know that we're going to call our web method from JavaScript.&lt;/p&gt;
&lt;p&gt;For our Submit web method, we've got:&lt;/p&gt;
&lt;p&gt;&lt;div class="code"&gt;
System.Threading.Thread.Sleep(5000)&lt;br /&gt;&lt;span class="kwrd"&gt;Return&lt;/span&gt; SendMail(strEmail, strComment)&lt;br /&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;So first we're faking network latency (so remember to take this out in production) by having the service sleep for 5 seconds, before proceeding to run our SendMail function. I'm not going to explain the SendMail function, because it is basically the same as what we saw in&amp;nbsp;&lt;a href="http://blogs.sciosoft.com/post.aspx?id=9a10bccd-3eef-48fb-aafc-97f0b08efe2d"&gt;Part 1&lt;/a&gt;. The main difference is that instead of a subroutine, we've got a function that returns true if sending the email works out, and false if it doesn't.&lt;/p&gt;
&lt;p&gt;At this point, you can test out the web service if you'd like, by firing up Visual Studio debugging, with ContactUs.asmx as the start page.&lt;/p&gt;
&lt;p&gt;&lt;img src="/image.axd?picture=2010%2f3%2fAjaxContactNetCall4.png" alt="Browser view of the ContactUs web service" /&gt;&lt;/p&gt;
&lt;p&gt;Great. So now we need a Contact Us page. We'll create a new .ASPX page and call it "NetworkCallback". The body tag for the page is as follows:&lt;/p&gt;
&lt;div&gt;&lt;div class="code"&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;body&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;form&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="form1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:ScriptManager&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="ScriptManager1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;span&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Email&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;span&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;br&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;input&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="txtEmail"&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;="text"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;br&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;span&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Comments&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;span&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;br&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;textarea&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="txtComments"&lt;/span&gt; &lt;span class="attr"&gt;cols&lt;/span&gt;&lt;span class="kwrd"&gt;="20"&lt;/span&gt; &lt;span class="attr"&gt;rows&lt;/span&gt;&lt;span class="kwrd"&gt;="4"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;textarea&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;br&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;input&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="btnSubmit"&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;="submit"&lt;/span&gt; &lt;span class="attr"&gt;value&lt;/span&gt;&lt;span class="kwrd"&gt;="submit"&lt;/span&gt; &lt;span class="attr"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;="Submit"&lt;/span&gt;&lt;br /&gt;                &lt;span class="attr"&gt;onclick&lt;/span&gt;&lt;span class="kwrd"&gt;="return btnSubmit_onclick()"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;form&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;body&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;So, the page looks exactly the same as before, except we've swapped out the ASP controls for HTML. We didn't have to do this, but since we've gone from partial-page updates to network callbacks, we might as well save the server processing on our controls, too.&lt;/p&gt;
&lt;p&gt;&lt;img src="/image.axd?picture=2010%2f3%2fAjaxContactNetCall1.png" alt="Browser view of the Contact Us layout" /&gt;&lt;/p&gt;
&lt;p&gt;Just for fun, and to give our users some AJAX feedback, let's throw some progress updates into our HTML, right below our submit button:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;div class="code"&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="divWaiting"&lt;/span&gt; &lt;span class="attr"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;="display: none"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;img&lt;/span&gt; &lt;span class="attr"&gt;alt&lt;/span&gt;&lt;span class="kwrd"&gt;="UpdateProgress"&lt;/span&gt; &lt;span class="attr"&gt;src&lt;/span&gt;&lt;span class="kwrd"&gt;="Images/SquareCircleLoader.gif"&lt;/span&gt;&lt;br /&gt;        &lt;span class="attr"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;="width: 31px; height: 31px"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="divSuccess"&lt;/span&gt; &lt;span class="attr"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;="display: none"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    Thank you for your submission.&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="divFailure"&lt;/span&gt; &lt;span class="attr"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;="display: none"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    There was a problem with your request.&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;In the above code we've got three divs: The first one is displayed after the user has submitted the form, and is waiting for it to be processed by the server. The second is displayed after the form has been processed. The third shows up if there is a problem. By default, none of these divs are visible to the user, so we obviously we need to wire these divs up somehow. Here's the JavaScript that makes things happen:&lt;/p&gt;
&lt;p&gt;&lt;div class="code"&gt;
&amp;lt;script language=&lt;span class="str"&gt;"javascript"&lt;/span&gt; type=&lt;span class="str"&gt;"text/javascript"&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;function&lt;/span&gt; btnSubmit_onclick() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.getElementById(&lt;span class="str"&gt;'divSuccess'&lt;/span&gt;).style.display = &lt;span class="str"&gt;"none"&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.getElementById(&lt;span class="str"&gt;'divFailure'&lt;/span&gt;).style.display = &lt;span class="str"&gt;"none"&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.getElementById(&lt;span class="str"&gt;'divWaiting'&lt;/span&gt;).style.display = &lt;span class="str"&gt;"block"&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;var&lt;/span&gt; txtEmail = document.getElementById(&lt;span class="str"&gt;'txtEmail'&lt;/span&gt;).value;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;var&lt;/span&gt; txtComments = document.getElementById(&lt;span class="str"&gt;'txtComments'&lt;/span&gt;).value;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AJAXEnabledContactForm.ContactUs.Submit(txtEmail, txtComments, OnSuccess, OnFailure);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;false&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;function&lt;/span&gt; OnSuccess(arg) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.getElementById(&lt;span class="str"&gt;'divWaiting'&lt;/span&gt;).style.display = &lt;span class="str"&gt;"none"&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;if&lt;/span&gt; (arg) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.getElementById(&lt;span class="str"&gt;'divSuccess'&lt;/span&gt;).style.display = &lt;span class="str"&gt;"block"&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;else&lt;/span&gt; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.getElementById(&lt;span class="str"&gt;'divFailure'&lt;/span&gt;).style.display = &lt;span class="str"&gt;"block"&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;false&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;function&lt;/span&gt; OnFailure(error) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.getElementById(&lt;span class="str"&gt;'divFailure'&lt;/span&gt;).style.display = &lt;span class="str"&gt;"block"&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.getElementById(&lt;span class="str"&gt;'divWaiting'&lt;/span&gt;).style.display = &lt;span class="str"&gt;"none"&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert(&lt;span class="str"&gt;"Stack Trace: "&lt;/span&gt; + error.get_stackTrace() + &lt;span class="str"&gt;"/r/n"&lt;/span&gt; +&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="str"&gt;"Error: "&lt;/span&gt; + error.get_message() + &lt;span class="str"&gt;"/r/n"&lt;/span&gt; +&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="str"&gt;"Status Code: "&lt;/span&gt; + error.get_statusCode() + &lt;span class="str"&gt;"/r/n"&lt;/span&gt; +&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="str"&gt;"Exception Type: "&lt;/span&gt; + error.get_exceptionType() + &lt;span class="str"&gt;"/r/n"&lt;/span&gt; +&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="str"&gt;"Timed Out: "&lt;/span&gt; + error.get_timedOut());&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;// --&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;So before my SEO friends jump all over me, I realize that I put the JavaScript in the &amp;lt;head&amp;gt; tag in the source file download. The JavaScript should really go just before the end &amp;lt;/body&amp;gt; tag of NetworkCallback.aspx. My apologies...old habits really do die hard. One more thing, on error you'll get an alert box describing the error. This is a handy JavaScript snippet for troubleshooting, but remember to take it out before you drop this into production.&lt;/p&gt;
&lt;p&gt;Now to bring this all together, we've got our one and only instance of the ScriptManager on the page, just after the form tag. In order for our ScriptManager to access our web service, the ScriptManager needs to know about the web service. And to do that, we just need to tell the ScriptManager where to find our web service, and it will take care of the actual implementation:&lt;/p&gt;
&lt;div&gt;&lt;div class="code"&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:ScriptManager&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="ScriptManager1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Services&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:ServiceReference&lt;/span&gt; &lt;span class="attr"&gt;Path&lt;/span&gt;&lt;span class="kwrd"&gt;="~/ContactUs.asmx"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Services&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:ScriptManager&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;So let's just walk through this. When our user clicks the submit button, the contents of the email and comments text boxes are submitted to our web service asynchronously using XML, and our page tells the user to wait as something is happening. When the web service finally sends the email, the client is updated with the good news. If there is a problem, the user is also notified. We could also tie this into &lt;a href="http://blogs.sciosoft.com/post.aspx?id=9a10bccd-3eef-48fb-aafc-97f0b08efe2d"&gt;Part 1&lt;/a&gt;, by adding some JavaScript redirects to our Success.aspx and Failed.aspx pages, but I'll leave that for you to implement as you see fit.&lt;/p&gt;
&lt;p&gt;Go ahead and give it a try running the NetworkCallback.aspx page. After you fill in the text boxes and click the submit button, you should get 5 seconds of progress.&lt;/p&gt;
&lt;p&gt;&lt;img src="/image.axd?picture=2010%2f3%2fAjaxContactNetCall2.png" alt="Browser view of the AJAX Contact Us page with a asynchronous network callback in progress" /&gt;&lt;/p&gt;
&lt;p&gt;This is followed by an email delivered to your hard drive at c:\Temp\ (as just like in &lt;a href="http://blogs.sciosoft.com/post.aspx?id=9a10bccd-3eef-48fb-aafc-97f0b08efe2d"&gt;Part 1&lt;/a&gt;, we're using the &lt;a href="http://blogs.sciosoft.com/post.aspx?id=818935ab-f150-42fa-86b0-35c8a2fc53c2"&gt;Specified Pickup Directory&lt;/a&gt; method to handle our email so you'll need to add that to the web.config if you're building your own project), and a message saying that everything went well.&lt;/p&gt;
&lt;p&gt;&lt;img src="/image.axd?picture=2010%2f3%2fAjaxContactNetCall3.png" alt="Browser view of successful network callback" /&gt;&lt;/p&gt;
&lt;p&gt;Well, now you've got two ways of building that amazing AJAXified Contact Us page you've been dreaming about. As before, at a minimum, you MUST add some server-side validation/security before you contemplate dropping this code into production, otherwise you're leaving the door wide open to hackers. You may also want to look at securing your web service, or risk becoming a spammer's delight. It's not production code, but your definitely on the right path.&lt;/p&gt;
&lt;p&gt;Happy network callbacking,&lt;br /&gt;James Fielding&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/cEaxTieGeTDP4pKefb5jvax7nHc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cEaxTieGeTDP4pKefb5jvax7nHc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/cEaxTieGeTDP4pKefb5jvax7nHc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cEaxTieGeTDP4pKefb5jvax7nHc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/sciosoftblogs/~4/u8EsbwKlOtQ" height="1" width="1"/&gt;</description>
      <link>http://feeds.sciosoft.com/~r/sciosoftblogs/~3/u8EsbwKlOtQ/post.aspx</link>
      <author>ScioJim</author>
      <comments>http://blogs.sciosoft.com/blogs/post/2010/03/18/Build-an-AJAX-Contact-Us-Form-using-network-callbacks-in-ASPNET.aspx#comment</comments>
      <guid isPermaLink="false">http://blogs.sciosoft.com/blogs/post.aspx?id=a5740333-244f-4e30-8c1b-315846b58d60</guid>
      <pubDate>Thu, 18 Mar 2010 13:53:00 -0400</pubDate>
      <category>AJAX</category>
      <category>Web Development</category>
      <category>ASP.NET</category>
      <dc:publisher>ScioJim</dc:publisher>
      <pingback:server>http://blogs.sciosoft.com/blogs/pingback.axd</pingback:server>
      <pingback:target>http://blogs.sciosoft.com/blogs/post.aspx?id=a5740333-244f-4e30-8c1b-315846b58d60</pingback:target>
      <slash:comments>18</slash:comments>
      <trackback:ping>http://blogs.sciosoft.com/blogs/trackback.axd?id=a5740333-244f-4e30-8c1b-315846b58d60</trackback:ping>
      <wfw:comment>http://blogs.sciosoft.com/blogs/post/2010/03/18/Build-an-AJAX-Contact-Us-Form-using-network-callbacks-in-ASPNET.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.sciosoft.com/blogs/syndication.axd?post=a5740333-244f-4e30-8c1b-315846b58d60</wfw:commentRss>
    <feedburner:origLink>http://blogs.sciosoft.com/blogs/post.aspx?id=a5740333-244f-4e30-8c1b-315846b58d60</feedburner:origLink></item>
    <item>
      <title>Build an AJAX Contact Us Form using partial-page updates in ASP.NET</title>
      <description>&lt;p style="text-align: right;"&gt;&lt;a title="Introduction to Build an AJAX Contact Us form page in ASP.NET" href="http://blogs.sciosoft.com/post.aspx?id=f9330061-eb0d-465c-8c6b-be633e2379d2"&gt;Intro&lt;/a&gt;&amp;nbsp;|&amp;nbsp;Part 1&amp;nbsp;|&amp;nbsp;&lt;a title="Build an AJAX Contact Us Form using network callbacks in ASP.NET" href="http://blogs.sciosoft.com/post.aspx?id=a5740333-244f-4e30-8c1b-315846b58d60"&gt;Part 2&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;As promised in the &lt;a href="http://blogs.sciosoft.com/post.aspx?id=f9330061-eb0d-465c-8c6b-be633e2379d2"&gt;intro&lt;/a&gt; of this three-part series,&amp;nbsp;you and I are&amp;nbsp;going to build an AJAX Contact Us form in ASP.NET, a couple of different ways. Today we&amp;rsquo;re going to look to Visual Studio&amp;rsquo;s built in ASP.NET AJAX controls to do dynamic partial-page updates, and we&amp;rsquo;ll leave client-side &lt;a title="Build an AJAX Contact Us Form using network callbacks in ASP.NET" href="http://blogs.sciosoft.com/post.aspx?id=a5740333-244f-4e30-8c1b-315846b58d60"&gt;network callbacks&lt;/a&gt; through a web service for a future post. To keep things moving, I&amp;rsquo;m going to assume that you are comfortable using &lt;a href="http://www.microsoft.com/visualstudio/"&gt;Visual Studio&lt;/a&gt;. If you need to brush up, there are some &lt;a href="http://www.asp.net/web-forms/"&gt;great tutorials&lt;/a&gt; at ASP.NET.&lt;/p&gt;
&lt;p&gt;You can download the source files for this project &lt;a href="http://blogs.sciosoft.com/file.axd?file=2010%2f3%2fAJAXEnabledContactForm.zip"&gt;AJAXEnabledContactForm.zip (46 kb)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To start, I created a new AJAX Enabled Web Application in Visual Studio (you can find the free Visual Studio&amp;nbsp;&lt;a href="http://www.microsoft.com/express/Web/"&gt;Express Edition&lt;/a&gt; here). I called the project &amp;ldquo;AjaxEnabledContactForm&amp;rdquo;, but you can call it whatever you want.&lt;/p&gt;
&lt;p&gt;Next, I implement a &lt;strong&gt;Specified Pickup Directory&lt;/strong&gt; method to test our contact form, and allow our web app to save notification emails to our c:\Temp\ folder. You can find the specifics of adding this to your own project in my post on &lt;a href="http://blogs.sciosoft.com/post.aspx?id=818935ab-f150-42fa-86b0-35c8a2fc53c2"&gt;The SMTP Alternative&lt;/a&gt;, but to keep this short, the code you need to add to your web.config file is as follows:&lt;/p&gt;
&lt;div&gt;&lt;div class="code"&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;configuration&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    ....&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;system.net&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;mailSettings&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;smtp&lt;/span&gt; &lt;span class="attr"&gt;deliveryMethod&lt;/span&gt;&lt;span class="kwrd"&gt;="SpecifiedPickupDirectory"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;specifiedPickupDirectory&lt;/span&gt; &lt;span class="attr"&gt;pickupDirectoryLocation&lt;/span&gt;&lt;span class="kwrd"&gt;="c:\Temp\"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;smtp&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;mailSettings&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;system.net&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    ....&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;configuration&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Now, we need a page for our Contact Us form. I created a new page, called it "PartialPageUpdate.aspx", and added the following content to the body. &lt;/p&gt;
&lt;div&gt;&lt;div class="code"&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;body&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;form&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="form1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:ScriptManager&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="ScriptManager1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:Label&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="lblEmail"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;="Email"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;br&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:TextBox&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="txtEmail"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;br&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:Label&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="lblComments"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;="Comments"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;br&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:TextBox&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="txtComments"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="attr"&gt;Columns&lt;/span&gt;&lt;span class="kwrd"&gt;="20"&lt;/span&gt; &lt;span class="attr"&gt;Rows&lt;/span&gt;&lt;span class="kwrd"&gt;="4"&lt;/span&gt; &lt;span class="attr"&gt;TextMode&lt;/span&gt;&lt;span class="kwrd"&gt;="MultiLine"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;br&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:UpdatePanel&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="UpdatePanel1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ContentTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;                    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:Button&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="btnSubmit"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;="Submit"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;                &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ContentTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:UpdatePanel&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;form&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;body&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This gives us a very basic layout: An email text box, a comment text box, and a submit button.&lt;/p&gt;
&lt;p&gt;&lt;img src="/image.axd?picture=2010%2f3%2fAjaxContactPartPageUp1.png" alt="Browser view of the Contact Us layout" /&gt;&lt;/p&gt;
&lt;p&gt;You can add any other fields you need, but for our purposes, this is addequate. Of course, to use AJAX controls, remember to include the ScriptManager tag.&lt;/p&gt;
&lt;p&gt;To give our form that AJAX feel, and to give the user some feedback, I also added an UpdateProgress control below the UpdatePanel:&lt;/p&gt;
&lt;div&gt;&lt;div class="code"&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:UpdateProgress&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="UpdateProgress1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ProgressTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;img&lt;/span&gt; &lt;span class="attr"&gt;alt&lt;/span&gt;&lt;span class="kwrd"&gt;="UpdateProgress"&lt;/span&gt; &lt;span class="attr"&gt;src&lt;/span&gt;&lt;span class="kwrd"&gt;="Images/SquareCircleLoader.gif"&lt;/span&gt; &lt;span class="attr"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;="width: 31px; height: 31px"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ProgressTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:UpdateProgress&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Moving to the page's codebehind file, we'll have the server email us on each submission, although you could just as easily have the server write our form's contents to a database. To the page load event, I've added a 3 second lag, to imitate network latency, only on postback. The code is as follows:&lt;/p&gt;
&lt;div&gt;&lt;div class="code"&gt;
 &lt;span class="kwrd"&gt;Public&lt;/span&gt; Partial &lt;span class="kwrd"&gt;Class&lt;/span&gt; PartialPageUpdate&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;Inherits&lt;/span&gt; System.Web.UI.Page&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;Protected&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; Page_Load(&lt;span class="kwrd"&gt;ByVal&lt;/span&gt; sender &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Object&lt;/span&gt;, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; e &lt;span class="kwrd"&gt;As&lt;/span&gt; System.EventArgs) &lt;span class="kwrd"&gt;Handles&lt;/span&gt; &lt;span class="kwrd"&gt;Me&lt;/span&gt;.Load&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;If&lt;/span&gt; Page.IsPostBack &lt;span class="kwrd"&gt;Then&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Disable this setting &lt;span class="kwrd"&gt;in&lt;/span&gt; production&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Threading.Thread.Sleep(3000)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Class&lt;/span&gt; &lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Why only postbacks? Well, we're not trying to demonstrate network latency when the page loads for the first time, hence the "only on postback". Obviously, you'll take out this line in a production environment. But more importantly, the notable thing about using the AJAX UpdatePanel, and arguably one of it's problems, is that when you use this control on a page, you actually get a full page postback. At first, this seems rather odd, as we only had the submit button in the UpdatePanel, but this is how the UpdatePanel works. This is the main reason why you might opt for a straight client-side network callback through a web service. However, as long as you're not expecting thousands of postbacks a day, it's probably not going to have a noticable impact on your bandwidth usage.&lt;/p&gt;
&lt;p&gt;Next, we're going to handle the submit button's click event by adding the following code to our PartialPageUpdate class in the codebehind file:&lt;/p&gt;
&lt;div&gt;&lt;div class="code"&gt;
 &lt;span class="kwrd"&gt;Protected&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; btnSubmit_Click(&lt;span class="kwrd"&gt;ByVal&lt;/span&gt; sender &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Object&lt;/span&gt;, &lt;span class="kwrd"&gt;ByVal&lt;/span&gt; e &lt;span class="kwrd"&gt;As&lt;/span&gt; EventArgs) &lt;span class="kwrd"&gt;Handles&lt;/span&gt; btnSubmit.Click&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SendMail()&lt;br /&gt;&lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Finally, we'll add the code that actually sends the email. I'm not going to walk through every line, as this is fairly standard email sending code, but I should point out that I've used a session variable to store any errors that are generated, to add some basic error handling and help us troubleshoot any problems.&lt;/p&gt;
&lt;div&gt;&lt;div class="code"&gt;
 &lt;span class="kwrd"&gt;Private&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; SendMail()&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Create an &lt;span class="kwrd"&gt;error&lt;/span&gt; session variable&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Session(&lt;span class="str"&gt;"myError"&lt;/span&gt;) = &lt;span class="kwrd"&gt;Nothing&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;Dim&lt;/span&gt; mailMessage &lt;span class="kwrd"&gt;As&lt;/span&gt; System.Net.Mail.MailMessage = &lt;span class="kwrd"&gt;New&lt;/span&gt; System.Net.Mail.MailMessage()&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mailMessage.From = &lt;span class="kwrd"&gt;New&lt;/span&gt; System.Net.Mail.MailAddress(&lt;span class="str"&gt;"myserver@mysite.com"&lt;/span&gt;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mailMessage.&lt;span class="kwrd"&gt;To&lt;/span&gt;.Add(&lt;span class="kwrd"&gt;New&lt;/span&gt; System.Net.Mail.MailAddress(&lt;span class="str"&gt;"me@mysite.com"&lt;/span&gt;))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mailMessage.ReplyTo = &lt;span class="kwrd"&gt;New&lt;/span&gt; System.Net.Mail.MailAddress(txtEmail.Text.Trim())&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '&lt;span class="kwrd"&gt;Set&lt;/span&gt; additional options&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mailMessage.Priority = Net.Mail.MailPriority.Normal&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Text/HTML&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mailMessage.IsBodyHtml = &lt;span class="kwrd"&gt;False&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '&lt;span class="kwrd"&gt;Set&lt;/span&gt; the subjet &lt;span class="kwrd"&gt;and&lt;/span&gt; body text&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mailMessage.Subject = &lt;span class="str"&gt;"Contact Us Form from: "&lt;/span&gt; &amp;amp; txtEmail.Text.Trim&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mailMessage.Body = txtComments.Text&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Create an instance of the SmtpClient &lt;span class="kwrd"&gt;class&lt;/span&gt; &lt;span class="kwrd"&gt;for&lt;/span&gt; sending the email&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'using web.config settings&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;Dim&lt;/span&gt; smtpClient &lt;span class="kwrd"&gt;As&lt;/span&gt; System.Net.Mail.SmtpClient = &lt;span class="kwrd"&gt;New&lt;/span&gt; System.Net.Mail.SmtpClient()&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Use a &lt;span class="kwrd"&gt;Try&lt;/span&gt;/&lt;span class="kwrd"&gt;Catch&lt;/span&gt; block &lt;span class="kwrd"&gt;to&lt;/span&gt; trap sending errors&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Especially useful &lt;span class="kwrd"&gt;when&lt;/span&gt; looping through multiple sends&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;Try&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; smtpClient.Send(mailMessage)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;Catch&lt;/span&gt; ex &lt;span class="kwrd"&gt;As&lt;/span&gt; System.Net.Mail.SmtpException&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Session(&lt;span class="str"&gt;"myError"&lt;/span&gt;) = ex&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Response.Redirect(&lt;span class="str"&gt;"/Failed.aspx"&lt;/span&gt;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;Catch&lt;/span&gt; ex &lt;span class="kwrd"&gt;As&lt;/span&gt; Exception&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Session(&lt;span class="str"&gt;"myError"&lt;/span&gt;) = ex&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Response.Redirect(&lt;span class="str"&gt;"/Failed.aspx"&lt;/span&gt;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;Finally&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mailMessage.Dispose()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Try&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Response.Redirect(&lt;span class="str"&gt;"/Success.aspx"&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; &lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So let's just walk through this. When our user clicks the submit button, the page posts back to the server the contents of the email and comments text boxes asynchronously, and our UpdateProgress control tells them to wait as something is happening. When the asynchronouslypostback is complete, the user's browser is redirected to the Success.aspx page (a good thing) or the Failed.aspx page (which isn't good). So we just need to create two new pages, Failed.aspx and Success.aspx, and we should be good to go.&lt;/p&gt;
&lt;p&gt;&lt;img src="/image.axd?picture=2010%2f3%2fAjaxContactPartPageUp2.png" alt="Browser view of the Contact Us page posting back to server asynchronously" /&gt;&lt;/p&gt;
&lt;p&gt;Go ahead and give it a try running the PartialPageUpdate.aspx page. After you fill in the text boxes and click the submit button, you should get 3 seconds of progress, followed by an email delivered to your hard drive in the c:\Temp\ folder, and a browser redirect to the Success.aspx page.&lt;/p&gt;
&lt;p&gt;&lt;img src="/image.axd?picture=2010%2f3%2fAjaxContactPartPageUp3.png" alt="Browser view of Success.aspx" /&gt;&lt;/p&gt;
&lt;p&gt;I hope this gets you started on building that amazing AJAXified Contact Us page you've been thinking about. As I said before, at a minimum, you MUST add some server-side validation/security before you contemplate dropping this code into production, otherwise you're leaving the door wide open to hackers.&lt;/p&gt;
&lt;p&gt;Our next stop is building a &lt;a title="Build an AJAX Contact Us Form using network callbacks in ASP.NET" href="http://blogs.sciosoft.com/post.aspx?id=a5740333-244f-4e30-8c1b-315846b58d60"&gt;network callback&lt;/a&gt; Contact Us form.&lt;/p&gt;
&lt;p&gt;Happy partial-page contacting,&lt;br /&gt;James Fielding&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ZUPmK_JywFT54berRShKX-63Sjg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ZUPmK_JywFT54berRShKX-63Sjg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ZUPmK_JywFT54berRShKX-63Sjg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ZUPmK_JywFT54berRShKX-63Sjg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/sciosoftblogs/~4/PCQLiJUj1Ss" height="1" width="1"/&gt;</description>
      <link>http://feeds.sciosoft.com/~r/sciosoftblogs/~3/PCQLiJUj1Ss/post.aspx</link>
      <author>ScioJim</author>
      <comments>http://blogs.sciosoft.com/blogs/post/2010/03/12/Build-an-AJAX-Contact-Us-Form-using-partial-page-updates-in-ASPNET.aspx#comment</comments>
      <guid isPermaLink="false">http://blogs.sciosoft.com/blogs/post.aspx?id=9a10bccd-3eef-48fb-aafc-97f0b08efe2d</guid>
      <pubDate>Fri, 12 Mar 2010 20:13:00 -0400</pubDate>
      <category>AJAX</category>
      <category>Web Development</category>
      <category>ASP.NET</category>
      <dc:publisher>ScioJim</dc:publisher>
      <pingback:server>http://blogs.sciosoft.com/blogs/pingback.axd</pingback:server>
      <pingback:target>http://blogs.sciosoft.com/blogs/post.aspx?id=9a10bccd-3eef-48fb-aafc-97f0b08efe2d</pingback:target>
      <slash:comments>12</slash:comments>
      <trackback:ping>http://blogs.sciosoft.com/blogs/trackback.axd?id=9a10bccd-3eef-48fb-aafc-97f0b08efe2d</trackback:ping>
      <wfw:comment>http://blogs.sciosoft.com/blogs/post/2010/03/12/Build-an-AJAX-Contact-Us-Form-using-partial-page-updates-in-ASPNET.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.sciosoft.com/blogs/syndication.axd?post=9a10bccd-3eef-48fb-aafc-97f0b08efe2d</wfw:commentRss>
    <feedburner:origLink>http://blogs.sciosoft.com/blogs/post.aspx?id=9a10bccd-3eef-48fb-aafc-97f0b08efe2d</feedburner:origLink></item>
    <item>
      <title>Test sending email on Localhost in ASP.NET: The SMTP server alternative</title>
      <description>&lt;p&gt;Out of the box, &lt;a href="http://www.microsoft.com/visualstudio/"&gt;Visual Studio&lt;/a&gt; is a wonderful environment for creating and testing ASP.NET applications. This includes Microsoft's free &lt;a href="http://www.microsoft.com/express/Web/"&gt;Express Edition&lt;/a&gt;, which is, as some of you know, a great place to start building sites. One thing that can be challenge to test are a site's email related subroutines. A standard and effective approach is to configure the SMTP server on your test machine. Unfortunately, if you send a project to somebody that doesn't have the identical SMTP test environment set up (which is pretty much never), you're going to have problems.&lt;/p&gt;
&lt;p&gt;If you only need to test that your project can create an email, an alternative is to use the &lt;a href="http://msdn.microsoft.com/en-us/library/system.net.configuration.smtpspecifiedpickupdirectoryelement.aspx"&gt;&lt;strong&gt;Specified Pickup Directory&lt;/strong&gt;&lt;/a&gt; method, which simply has your test environment save the email, instead of actually sending it. To accomplish this, you need to add or replace the default mail settings in your project's web.config file:&lt;/p&gt;
&lt;div&gt;&lt;div class="code"&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;configuration&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    ....&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;system.net&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;mailSettings&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;smtp&lt;/span&gt; &lt;span class="attr"&gt;deliveryMethod&lt;/span&gt;&lt;span class="kwrd"&gt;="SpecifiedPickupDirectory"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;specifiedPickupDirectory&lt;/span&gt; &lt;span class="attr"&gt;pickupDirectoryLocation&lt;/span&gt;&lt;span class="kwrd"&gt;="c:\Temp\"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;smtp&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;mailSettings&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;system.net&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    ....&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;configuration&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;As you can probably guess, you can change the pickup directory for your email to anything you want, but take note: The directory has to exist, otherwise you'll get an error. This is particularly important if you are sending your project to somebody else, and don't want them to be stuck debugging your application. So, the temp folder is actually a decent place to store and access test emails.&lt;/p&gt;
&lt;p&gt;The great thing about using the Specified Pickup Directory method is that you can use your production email settings throughout the project, and simply swap out the web.config mailSettings when your done testing. You can also send your email enabled projects to somebody else and have it work as expected.&lt;/p&gt;
&lt;p&gt;Specified Pickup Directory is not a silver bullet, because sometimes you actually do want to do a test send, as opposed to just saving the email. However for most situations, particularly preliminary testing, this method will probably fit your needs.&lt;/p&gt;
&lt;p&gt;Happy emailing,&lt;br /&gt;James Fielding&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/tNVY5iIv7Rd4m23B4OfhYsqQ1O8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tNVY5iIv7Rd4m23B4OfhYsqQ1O8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/tNVY5iIv7Rd4m23B4OfhYsqQ1O8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tNVY5iIv7Rd4m23B4OfhYsqQ1O8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/sciosoftblogs/~4/1rf3HNpeXJ4" height="1" width="1"/&gt;</description>
      <link>http://feeds.sciosoft.com/~r/sciosoftblogs/~3/1rf3HNpeXJ4/post.aspx</link>
      <author>ScioJim</author>
      <comments>http://blogs.sciosoft.com/blogs/post/2010/03/04/Test-sending-email-on-Localhost-in-ASPNET-The-SMTP-server-alternative.aspx#comment</comments>
      <guid isPermaLink="false">http://blogs.sciosoft.com/blogs/post.aspx?id=818935ab-f150-42fa-86b0-35c8a2fc53c2</guid>
      <pubDate>Thu, 04 Mar 2010 09:43:00 -0400</pubDate>
      <category>Web Development</category>
      <category>ASP.NET</category>
      <dc:publisher>ScioJim</dc:publisher>
      <pingback:server>http://blogs.sciosoft.com/blogs/pingback.axd</pingback:server>
      <pingback:target>http://blogs.sciosoft.com/blogs/post.aspx?id=818935ab-f150-42fa-86b0-35c8a2fc53c2</pingback:target>
      <slash:comments>234</slash:comments>
      <trackback:ping>http://blogs.sciosoft.com/blogs/trackback.axd?id=818935ab-f150-42fa-86b0-35c8a2fc53c2</trackback:ping>
      <wfw:comment>http://blogs.sciosoft.com/blogs/post/2010/03/04/Test-sending-email-on-Localhost-in-ASPNET-The-SMTP-server-alternative.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.sciosoft.com/blogs/syndication.axd?post=818935ab-f150-42fa-86b0-35c8a2fc53c2</wfw:commentRss>
    <feedburner:origLink>http://blogs.sciosoft.com/blogs/post.aspx?id=818935ab-f150-42fa-86b0-35c8a2fc53c2</feedburner:origLink></item>
    <item>
      <title>Build an AJAX Contact Us form in ASP.NET</title>
      <description>&lt;p style="text-align: right;"&gt;Intro&amp;nbsp;|&amp;nbsp;&lt;a title="Build an AJAX Contact Us Form using partial-page updates in ASP.NET" href="http://blogs.sciosoft.com/post.aspx?id=9a10bccd-3eef-48fb-aafc-97f0b08efe2d"&gt;Part 1&lt;/a&gt;&amp;nbsp;|&amp;nbsp;&lt;a title="Build an AJAX Contact Us Form using network callbacks in ASP.NET" href="http://blogs.sciosoft.com/post.aspx?id=a5740333-244f-4e30-8c1b-315846b58d60"&gt;Part 2&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;When it comes to building a Contact Us page in ASP.NET, then a page with a form tag, some text boxes, and a submit button is the classic and straightforward way to go. If this isn&amp;rsquo;t what you want to hear, then you&amp;rsquo;ve come to the right place.&lt;/p&gt;
&lt;p&gt;Sure, a simple form may be the easiest, and arguably a more secure way of collecting user feedback, but it just doesn&amp;rsquo;t have that AJAX sparkle...and what&amp;rsquo;s the fun in that?!! Over the next two blogs, I&amp;rsquo;m going to be building an AJAX Contact Us form in ASP.NET using two different methods:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Using Visual Studio&amp;rsquo;s built in ASP.NET AJAX controls to do dynamic partial-page updates.&lt;/li&gt;
&lt;li&gt;Using client-side network callbacks through a web service.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Just a couple of disclaimers before we start: I&amp;rsquo;m going to keep this as simple as possible, so let&amp;rsquo;s just say that the UI design is basic, the database/email hookup will be incompete, and we won&amp;rsquo;t be dealing with any major security concerns. So you&amp;rsquo;ll obviously want to bolster things before you drop this into a production environment. The point of this is not to provide an enterprise-class solution, but to give you a step-off point to building a great system.&lt;/p&gt;
&lt;p&gt;Having said that, let&amp;rsquo;s get going with &lt;a title="Contact Us form page using Partial-Page Update method by means of Visual Studio's ASP.NET AJAX controls" href="http://blogs.sciosoft.com/post.aspx?id=9a10bccd-3eef-48fb-aafc-97f0b08efe2d"&gt;Partial Page Updates&lt;/a&gt;.&lt;br /&gt;James Fielding&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/8NPO2X_ENMthuS7KyPRKnfp8Ogg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8NPO2X_ENMthuS7KyPRKnfp8Ogg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/8NPO2X_ENMthuS7KyPRKnfp8Ogg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8NPO2X_ENMthuS7KyPRKnfp8Ogg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/sciosoftblogs/~4/Vgf1FXMNrHs" height="1" width="1"/&gt;</description>
      <link>http://feeds.sciosoft.com/~r/sciosoftblogs/~3/Vgf1FXMNrHs/post.aspx</link>
      <author>ScioJim</author>
      <comments>http://blogs.sciosoft.com/blogs/post/2010/02/26/Build-an-AJAX-Contact-Us-form-in-ASPNET.aspx#comment</comments>
      <guid isPermaLink="false">http://blogs.sciosoft.com/blogs/post.aspx?id=f9330061-eb0d-465c-8c6b-be633e2379d2</guid>
      <pubDate>Fri, 26 Feb 2010 13:47:00 -0400</pubDate>
      <category>Web Development</category>
      <category>ASP.NET</category>
      <dc:publisher>ScioJim</dc:publisher>
      <pingback:server>http://blogs.sciosoft.com/blogs/pingback.axd</pingback:server>
      <pingback:target>http://blogs.sciosoft.com/blogs/post.aspx?id=f9330061-eb0d-465c-8c6b-be633e2379d2</pingback:target>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://blogs.sciosoft.com/blogs/trackback.axd?id=f9330061-eb0d-465c-8c6b-be633e2379d2</trackback:ping>
      <wfw:comment>http://blogs.sciosoft.com/blogs/post/2010/02/26/Build-an-AJAX-Contact-Us-form-in-ASPNET.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.sciosoft.com/blogs/syndication.axd?post=f9330061-eb0d-465c-8c6b-be633e2379d2</wfw:commentRss>
    <feedburner:origLink>http://blogs.sciosoft.com/blogs/post.aspx?id=f9330061-eb0d-465c-8c6b-be633e2379d2</feedburner:origLink></item>
    <item>
      <title>Referencing external URLs in your web.sitemap in ASP.NET</title>
      <description>&lt;p&gt;In ASP.NET, we often use site maps to set up navigation, particularly for menus. By default, the ASP.NET&amp;nbsp; site-map provider&amp;nbsp; uses the "Web.sitemap" file. Here is an example of this file for a simple site:&lt;/p&gt;
&lt;div&gt;&lt;div class="code"&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="html"&gt;xml&lt;/span&gt; &lt;span class="attr"&gt;version&lt;/span&gt;&lt;span class="kwrd"&gt;="1.0"&lt;/span&gt; &lt;span class="attr"&gt;encoding&lt;/span&gt;&lt;span class="kwrd"&gt;="utf-8"&lt;/span&gt; ?&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;siteMap&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;siteMapNode&lt;/span&gt; &lt;span class="attr"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;="Home"&lt;/span&gt; &lt;span class="attr"&gt;description&lt;/span&gt;&lt;span class="kwrd"&gt;="Home"&lt;/span&gt; &lt;span class="attr"&gt;url&lt;/span&gt;&lt;span class="kwrd"&gt;="~/default.aspx"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;siteMapNode&lt;/span&gt; &lt;span class="attr"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;="Services"&lt;/span&gt; &lt;span class="attr"&gt;description&lt;/span&gt;&lt;span class="kwrd"&gt;="Services we offer"&lt;/span&gt; &lt;span class="attr"&gt;url&lt;/span&gt;&lt;span class="kwrd"&gt;="~/Services.aspx"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;siteMapNode&lt;/span&gt; &lt;span class="attr"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;="Consulting"&lt;/span&gt; &lt;span class="attr"&gt;description&lt;/span&gt;&lt;span class="kwrd"&gt;="Consulting services"&lt;/span&gt; &lt;span class="attr"&gt;url&lt;/span&gt;&lt;span class="kwrd"&gt;="~/Consulting.aspx"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;siteMapNode&lt;/span&gt; &lt;span class="attr"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;="Support"&lt;/span&gt; &lt;span class="attr"&gt;description&lt;/span&gt;&lt;span class="kwrd"&gt;="Supports plans"&lt;/span&gt; &lt;span class="attr"&gt;url&lt;/span&gt;&lt;span class="kwrd"&gt;="~/Support.aspx"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;siteMapNode&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;siteMapNode&lt;/span&gt; &lt;span class="attr"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;="About Us"&lt;/span&gt; &lt;span class="attr"&gt;description&lt;/span&gt;&lt;span class="kwrd"&gt;="About Us"&lt;/span&gt; &lt;span class="attr"&gt;url&lt;/span&gt;&lt;span class="kwrd"&gt;="~/AboutUs.aspx"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;siteMapNode&lt;/span&gt; &lt;span class="attr"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;="Company"&lt;/span&gt; &lt;span class="attr"&gt;description&lt;/span&gt;&lt;span class="kwrd"&gt;="Our people and offices"&lt;/span&gt; &lt;span class="attr"&gt;url&lt;/span&gt;&lt;span class="kwrd"&gt;="~/Company.aspx"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;siteMapNode&lt;/span&gt; &lt;span class="attr"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;="Blogs"&lt;/span&gt; &lt;span class="attr"&gt;description&lt;/span&gt;&lt;span class="kwrd"&gt;="Blogs from us to you"&lt;/span&gt;&lt;br /&gt;              &lt;span class="attr"&gt;url&lt;/span&gt;&lt;span class="kwrd"&gt;="http://blogs.mysite.com/default.aspx"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;siteMapNode&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;siteMapNode&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;siteMap&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;So our basic menu will look like this: &lt;/p&gt;
&lt;div&gt;&lt;div class="code"&gt;&lt;br /&gt;Home&lt;br /&gt;    Services&lt;br /&gt;        Consulting&lt;br /&gt;        Support&lt;br /&gt;    About Us&lt;br /&gt;        Company&lt;br /&gt;        Blogs   &lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Notice that the "Blogs" node in the "About Us" section references an outside URL. This is not a problem, until you start adding role-base security to the site. Specifically, once you set you securityTrimmingEnabled="true" in the Web.config or the Web.sitemap file, the "Blogs" node disappears, and you're left scratching your head.&lt;/p&gt;
&lt;div&gt;&lt;div class="code"&gt;&lt;br /&gt;Home&lt;br /&gt;    Services&lt;br /&gt;        Consulting&lt;br /&gt;        Support&lt;br /&gt;    About Us&lt;br /&gt;        Company&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;At this point, you'll find that some developers get rid of the web.sitemap, and start hard coding menu items. However, there is a really easy fix for this behaviour. Just allow everyone access to the Blogs node so that it doesn't get trimmed:&lt;/p&gt;
&lt;div&gt;&lt;div class="code"&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;siteMapNode&lt;/span&gt; &lt;span class="attr"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;="Blogs"&lt;/span&gt; &lt;span class="attr"&gt;description&lt;/span&gt;&lt;span class="kwrd"&gt;="Blogs from us to you"&lt;/span&gt;&lt;br /&gt;    &lt;span class="attr"&gt;url&lt;/span&gt;&lt;span class="kwrd"&gt;="http://blogs.mysite.com/default.aspx"&lt;/span&gt; &lt;span class="attr"&gt;roles&lt;/span&gt;&lt;span class="kwrd"&gt;="*"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;By adding roles="*", we've got our blog back. That was almost too easy.&lt;/p&gt;
&lt;p&gt;Just for completeness, I'm going to mention that we could have also just disabled the security trimming in the Web.sitemap file by adding securityTrimmingEnabled="false" to the Blogs node. Although I'm not a big fan of this method, as I find it makes the Web.sitemap less clear on what we're trying to accomplish, which is never good for the next guy working on the site, but the choice is yours.&lt;/p&gt;
&lt;p&gt;Happy referencing,&lt;/p&gt;
&lt;p&gt;James Fielding&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/-WyQ5BqW-Txg2BST_V21zfJiAVQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-WyQ5BqW-Txg2BST_V21zfJiAVQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/-WyQ5BqW-Txg2BST_V21zfJiAVQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-WyQ5BqW-Txg2BST_V21zfJiAVQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/sciosoftblogs/~4/CwnhIhXbs_U" height="1" width="1"/&gt;</description>
      <link>http://feeds.sciosoft.com/~r/sciosoftblogs/~3/CwnhIhXbs_U/post.aspx</link>
      <author>ScioJim</author>
      <comments>http://blogs.sciosoft.com/blogs/post/2010/02/23/Referencing-external-URLs-in-your-websitemap-in-ASPNET.aspx#comment</comments>
      <guid isPermaLink="false">http://blogs.sciosoft.com/blogs/post.aspx?id=7cd7b870-d3f6-4206-bacd-509f744ff078</guid>
      <pubDate>Tue, 23 Feb 2010 09:57:00 -0400</pubDate>
      <category>Web Development</category>
      <category>ASP.NET</category>
      <dc:publisher>ScioJim</dc:publisher>
      <pingback:server>http://blogs.sciosoft.com/blogs/pingback.axd</pingback:server>
      <pingback:target>http://blogs.sciosoft.com/blogs/post.aspx?id=7cd7b870-d3f6-4206-bacd-509f744ff078</pingback:target>
      <slash:comments>4</slash:comments>
      <trackback:ping>http://blogs.sciosoft.com/blogs/trackback.axd?id=7cd7b870-d3f6-4206-bacd-509f744ff078</trackback:ping>
      <wfw:comment>http://blogs.sciosoft.com/blogs/post/2010/02/23/Referencing-external-URLs-in-your-websitemap-in-ASPNET.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.sciosoft.com/blogs/syndication.axd?post=7cd7b870-d3f6-4206-bacd-509f744ff078</wfw:commentRss>
    <feedburner:origLink>http://blogs.sciosoft.com/blogs/post.aspx?id=7cd7b870-d3f6-4206-bacd-509f744ff078</feedburner:origLink></item>
    <item>
      <title>Stop Web.Config settings inheritance in ASP.Net</title>
      <description>&lt;p&gt;Have you ever been left scratching your head after getting an error like this:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Configuration Error&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Parser Error Message:&lt;/strong&gt; Could not load file or assembly 'MyUnrequiredAssembly' or one of its dependencies. The system cannot find the file specified. (C:\Inetpub\wwwroot\child\web.config line 89)&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s common to have child sub-applications under the root application in an ASP.NET web site. It&amp;rsquo;s also common to have inheritance problems in a child because of what&amp;rsquo;s in the root application&amp;rsquo;s web.config file. To stop the child application from throwing a configuration error, you&amp;rsquo;ll often find that the previous developer has added assemblies to the GAC, or to every child application&amp;rsquo;s /bin folder in addition to the root folder&amp;rsquo;s /bin. You&amp;rsquo;ll also see similar stop-gap fixes with other resources, particularly in the App_Theme folder. Fortunately, if you are running at least .NET 2.0, or better, there&amp;rsquo;s a number of ways to fix things that won't throw the next guy working on the site for a loop.&lt;/p&gt;
&lt;p&gt;The simplest way to handle this is to:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1. Remove the offending assembly&lt;/strong&gt; in the system.web section of the child application's web.config file.&lt;/p&gt;
&lt;div&gt;&lt;div class="code"&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;compilation&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;assemblies&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;remove&lt;/span&gt; &lt;span class="attr"&gt;assembly&lt;/span&gt;&lt;span class="kwrd"&gt;="MyUnrequiredAssembly"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;assemblies&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;compilation&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;If you can't seem to get rid of the offending assembly, check for httpModules:&lt;/p&gt;
&lt;div&gt;&lt;div class="code"&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;httpModules&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;remove&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="MyUnrequiredAssembly"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;httpModules&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Sometimes, it is easier to start the child application with a clean slate. In that case: &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2. Clear all the assemblies&lt;/strong&gt; in the system.web section of the child application's web.config file.&lt;/p&gt;
&lt;div&gt;&lt;div class="code"&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;compilation&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;assemblies&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;clear&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="rem"&gt;&amp;lt;!-- Add required assemblies here --&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;assemblies&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;compilation&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;You can then go ahead and add the assemblies that the child application needs.&lt;/p&gt;
&lt;p&gt;To take a different approach, you can also disable child inheritance in the root application:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;3. Wrap&lt;/strong&gt; the system.web settings of &lt;strong&gt;the root application web.config file in a location tag&lt;/strong&gt;.&lt;/p&gt;
&lt;div&gt;&lt;div class="code"&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;location&lt;/span&gt; &lt;span class="attr"&gt;path&lt;/span&gt;&lt;span class="kwrd"&gt;="."&lt;/span&gt; &lt;span class="attr"&gt;inheritInChildApplications&lt;/span&gt;&lt;span class="kwrd"&gt;="false"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;system.web&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        ....&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;system.web&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;location&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Finally, you can apply specific resources to child applications in the root web.config by using the 'path' attribute:&lt;/p&gt;
&lt;div&gt;&lt;div class="code"&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;configuration&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="rem"&gt;&amp;lt;!-- Configuration that applies to all applications --&amp;gt;&lt;/span&gt;&lt;br /&gt;   &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;system.web&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        ....&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;system.web&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;span class="rem"&gt;&amp;lt;!-- Configuration for the "ChildApp1" application. --&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;location&lt;/span&gt; &lt;span class="attr"&gt;path&lt;/span&gt;&lt;span class="kwrd"&gt;="ChildApp"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;system.web&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;            ....&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;system.web&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;location&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;span class="rem"&gt;&amp;lt;!-- Configuration for the child of child application "ChildApp1/App2" application. --&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;location&lt;/span&gt; &lt;span class="attr"&gt;path&lt;/span&gt;&lt;span class="kwrd"&gt;="ChildApp1/App2"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;system.web&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;            ....&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;system.web&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;location&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;configuration&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Happy inheriting,&lt;br /&gt;James Fielding&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/-LMybZjQ6wTxrbFSx6W8l2j2Apk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-LMybZjQ6wTxrbFSx6W8l2j2Apk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/-LMybZjQ6wTxrbFSx6W8l2j2Apk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-LMybZjQ6wTxrbFSx6W8l2j2Apk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/sciosoftblogs/~4/J1h1Cnn9IQw" height="1" width="1"/&gt;</description>
      <link>http://feeds.sciosoft.com/~r/sciosoftblogs/~3/J1h1Cnn9IQw/post.aspx</link>
      <author>ScioJim</author>
      <comments>http://blogs.sciosoft.com/blogs/post/2010/02/07/Stop-WebConfig-settings-inheritance-in-ASPNet.aspx#comment</comments>
      <guid isPermaLink="false">http://blogs.sciosoft.com/blogs/post.aspx?id=45cebe70-7383-4db1-8036-95a30fa004a1</guid>
      <pubDate>Sun, 07 Feb 2010 19:16:00 -0400</pubDate>
      <category>Web Development</category>
      <category>ASP.NET</category>
      <dc:publisher>ScioJim</dc:publisher>
      <pingback:server>http://blogs.sciosoft.com/blogs/pingback.axd</pingback:server>
      <pingback:target>http://blogs.sciosoft.com/blogs/post.aspx?id=45cebe70-7383-4db1-8036-95a30fa004a1</pingback:target>
      <slash:comments>9</slash:comments>
      <trackback:ping>http://blogs.sciosoft.com/blogs/trackback.axd?id=45cebe70-7383-4db1-8036-95a30fa004a1</trackback:ping>
      <wfw:comment>http://blogs.sciosoft.com/blogs/post/2010/02/07/Stop-WebConfig-settings-inheritance-in-ASPNet.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.sciosoft.com/blogs/syndication.axd?post=45cebe70-7383-4db1-8036-95a30fa004a1</wfw:commentRss>
    <feedburner:origLink>http://blogs.sciosoft.com/blogs/post.aspx?id=45cebe70-7383-4db1-8036-95a30fa004a1</feedburner:origLink></item>
    <item>
      <title>Using hCard Microformats for SEO (Search Engine Optimization)</title>
      <description>&lt;p&gt;Yesterday, I attended a training session, where Derek Brown from &lt;a href="http://www.prontomarketing.com" target="_blank"&gt;Pronto Marketing&lt;/a&gt; shared some advanced strategies for SEO with us. Derek&amp;rsquo;s presentation was great&amp;hellip;amazing in fact. One of the items that he breezed by, but seemed to really emphasize, was hCards and how &lt;a href="http://googlewebmastercentral.blogspot.com/2009/05/introducing-rich-snippets.html" target="_blank"&gt;Google&lt;/a&gt; and &lt;a href="http://blogs.msdn.com/ie/archive/2008/03/06/activities-and-webslices-in-internet-explorer-8.aspx" target="_blank"&gt;Microsoft&lt;/a&gt; have really starting to embrace microformats in general. I&amp;rsquo;d heard about microformats before, but had not really taken the plunge. Having said this:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Microformats" target="_blank"&gt;Microformats&lt;/a&gt; are a practical way to make data items (such as events, contact details or geographical locations) recognizable to Search Engines, without breaking existing page formatting that is easily read by humans. This is done by adding a set of "class" attributes that can be added to divs and spans in an HTML page to tag content with semantic meaning. For example, my hCard looks like a standard block of text:&lt;/p&gt;
&lt;div id="hcard-James-Fielding" class="vcard"&gt;&lt;a class="url fn n" href="http://www.sciosoft.com"&gt;&lt;span class="given-name"&gt;James&lt;/span&gt; &lt;span class="additional-name"&gt;C.&lt;/span&gt; &lt;span class="family-name"&gt;Fielding&lt;/span&gt; &lt;/a&gt;
&lt;div class="org"&gt;Sciosoft Systems&lt;/div&gt;
&lt;div class="adr"&gt;
&lt;div class="street-address"&gt;1037 Langford Rd.&lt;/div&gt;
&lt;span class="locality"&gt;Baysville&lt;/span&gt;, &lt;span class="region"&gt;ON&lt;/span&gt;, &lt;span class="postal-code"&gt;P0B 1A0&lt;/span&gt; &lt;span class="country-name"&gt;Canada&lt;/span&gt;&lt;/div&gt;
&lt;div class="tel"&gt;705-571-1123&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;To get this, I used the following HTML:&lt;/p&gt;
&lt;div&gt;&lt;div class="code"&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="hcard-James-Fielding"&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="vcard"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;a&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="url fn n"&lt;/span&gt; &lt;span class="attr"&gt;href&lt;/span&gt;&lt;span class="kwrd"&gt;="http://www.sciosoft.com"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;span&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="given-name"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;James&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;span&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;span&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="additional-name"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;C.&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;span&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;span&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="family-name"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Fielding&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;span&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;a&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="org"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    Sciosoft Systems&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="adr"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="street-address"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;1037 Langford Rd.&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;span&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="locality"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Baysville&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;span&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;,&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;span&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="region"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;ON&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;span&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;,&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;span&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="postal-code"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;P0B 1A0&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;span&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;span&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="country-name"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Canada&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;span&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="tel"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    705-571-1123&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Adding this small amount of markup can have significant SEO results. Moreover, you can style this block with CSS by using the class names directly, or by adding a&amp;nbsp;second styling class like this to any of the tags: &lt;/p&gt;
&lt;div&gt;&lt;div class="code"&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="hcard-James-Fielding"&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="vcard mystyle"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;....&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;One big note on CSS styling, don&amp;rsquo;t try to hide the hCard. In general, Google doesn&amp;rsquo;t take kindly to you wrapping things in style="display: none; " tags, and microformats are no exception.&lt;/p&gt;
&lt;p&gt;To get started, you can try out www.microformat.org&amp;rsquo;s &lt;a href="http://microformats.org/code/hcard/creator" target="_blank"&gt;hCard Creator&lt;/a&gt; which formats the hCard HTML for you.&lt;/p&gt;
&lt;p&gt;Besides &lt;a title="hcard" href="http://microformats.org/wiki/hcard" target="_blank"&gt;hCards&lt;/a&gt;, there are a number of other microformat open standard specifications (including &lt;a title="hcalendar" href="http://microformats.org/wiki/hcalendar" target="_blank"&gt;hCalendar&lt;/a&gt;, &lt;a title="rel-license" href="http://microformats.org/wiki/rel-license" target="_blank"&gt;rel-license&lt;/a&gt;, &lt;a title="rel-nofollow" href="http://microformats.org/wiki/rel-nofollow" target="_blank"&gt;rel-nofollow&lt;/a&gt;, &lt;a title="rel-tag" href="http://microformats.org/wiki/rel-tag" target="_blank"&gt;rel-tag&lt;/a&gt;) that are in use, as well as many more (including &lt;a title="geo" href="http://microformats.org/wiki/geo" target="_blank"&gt;geo&lt;/a&gt;, &lt;a title="haudio" href="http://microformats.org/wiki/haudio" target="_blank"&gt;hAudio&lt;/a&gt;, &lt;a title="hmedia" href="http://microformats.org/wiki/hmedia" target="_blank"&gt;hMedia&lt;/a&gt;, &lt;a title="hnews" href="http://microformats.org/wiki/hnews" target="_blank"&gt;hNews&lt;/a&gt;, &lt;a title="hproduct" href="http://microformats.org/wiki/hproduct" target="_blank"&gt;hProduct&lt;/a&gt;, &lt;a title="hrecipe" href="http://microformats.org/wiki/hrecipe" target="_blank"&gt;hRecipe&lt;/a&gt;, &lt;a title="hresume" href="http://microformats.org/wiki/hresume" target="_blank"&gt;hResume&lt;/a&gt;, &lt;a title="hreview" href="http://microformats.org/wiki/hreview" target="_blank"&gt;hReview&lt;/a&gt;) at various stages of acceptance.&lt;/p&gt;
&lt;p&gt;Another great thing about microformats is that they can be readily integrated into XML data sources, but I think I&amp;rsquo;ll leave that for a future discussion.&lt;/p&gt;
&lt;p&gt;Happy optimizing,&lt;br /&gt;James Fielding&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/VfqNMPnEO4LOQc29dSqeUP1L-X8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VfqNMPnEO4LOQc29dSqeUP1L-X8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/VfqNMPnEO4LOQc29dSqeUP1L-X8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VfqNMPnEO4LOQc29dSqeUP1L-X8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/sciosoftblogs/~4/i1p61K8YkFM" height="1" width="1"/&gt;</description>
      <link>http://feeds.sciosoft.com/~r/sciosoftblogs/~3/i1p61K8YkFM/post.aspx</link>
      <author>ScioJim</author>
      <comments>http://blogs.sciosoft.com/blogs/post/2010/02/04/Optimize-Yourself-hCard-Microformats-for-SEO.aspx#comment</comments>
      <guid isPermaLink="false">http://blogs.sciosoft.com/blogs/post.aspx?id=d17c5d64-4e05-42b9-aa7b-dac70089272f</guid>
      <pubDate>Thu, 04 Feb 2010 13:09:00 -0400</pubDate>
      <category>Web Development</category>
      <category>SEO</category>
      <dc:publisher>ScioJim</dc:publisher>
      <pingback:server>http://blogs.sciosoft.com/blogs/pingback.axd</pingback:server>
      <pingback:target>http://blogs.sciosoft.com/blogs/post.aspx?id=d17c5d64-4e05-42b9-aa7b-dac70089272f</pingback:target>
      <slash:comments>10</slash:comments>
      <trackback:ping>http://blogs.sciosoft.com/blogs/trackback.axd?id=d17c5d64-4e05-42b9-aa7b-dac70089272f</trackback:ping>
      <wfw:comment>http://blogs.sciosoft.com/blogs/post/2010/02/04/Optimize-Yourself-hCard-Microformats-for-SEO.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.sciosoft.com/blogs/syndication.axd?post=d17c5d64-4e05-42b9-aa7b-dac70089272f</wfw:commentRss>
    <feedburner:origLink>http://blogs.sciosoft.com/blogs/post.aspx?id=d17c5d64-4e05-42b9-aa7b-dac70089272f</feedburner:origLink></item>
    <item>
      <title>Stopping a Virtual PC image from synchronizing the date with your host OS</title>
      <description>&lt;p&gt;“What will happen if the date/time on a machine is reset or is in a different 
time zone?” is a question that we sometimes run into, particularly from professionals 
whose documents are particularly date/time sensitive. Fortunately, 
this question can easily be handled by setting up one or more virtual machines.&lt;/p&gt;
&lt;p&gt;Having said this, out of the box, Virtual PC virtual machines synchronize their 
date with the date of the hosting operating system. This means that no matter what 
control panel you alter in the guest OS, the date/time reverts back to the host 
OS settings, which can be really frustrating. To prevent this default action from 
occurring, you can add the following XML section to the .VMC file for the image 
that you’d like to desynchronize:&lt;/p&gt;
&lt;div&gt;
	&lt;div class="code"&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;integration&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;microsoft&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        ....&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;components&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;host_time_sync&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;enabled&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;="boolean"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;false&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;enabled&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;host_time_sync&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;components&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        ....&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;microsoft&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;integration&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Happy testing,&lt;br /&gt;
James Fielding&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/msE8OHRUc5V4jMgx8VVqFOjeYqw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/msE8OHRUc5V4jMgx8VVqFOjeYqw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/msE8OHRUc5V4jMgx8VVqFOjeYqw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/msE8OHRUc5V4jMgx8VVqFOjeYqw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/sciosoftblogs/~4/kMSlcq-2vgk" height="1" width="1"/&gt;</description>
      <link>http://feeds.sciosoft.com/~r/sciosoftblogs/~3/kMSlcq-2vgk/post.aspx</link>
      <author>ScioJim</author>
      <comments>http://blogs.sciosoft.com/blogs/post/2010/02/03/Stopping-a-Virtual-PC-image-from-synchronizing-the-date-with-your-host-OS.aspx#comment</comments>
      <guid isPermaLink="false">http://blogs.sciosoft.com/blogs/post.aspx?id=6043417a-034f-45b0-8cca-d89287302944</guid>
      <pubDate>Wed, 03 Feb 2010 10:53:00 -0400</pubDate>
      <category>Virtualization</category>
      <category>Virtual PC</category>
      <dc:publisher>ScioJim</dc:publisher>
      <pingback:server>http://blogs.sciosoft.com/blogs/pingback.axd</pingback:server>
      <pingback:target>http://blogs.sciosoft.com/blogs/post.aspx?id=6043417a-034f-45b0-8cca-d89287302944</pingback:target>
      <slash:comments>63</slash:comments>
      <trackback:ping>http://blogs.sciosoft.com/blogs/trackback.axd?id=6043417a-034f-45b0-8cca-d89287302944</trackback:ping>
      <wfw:comment>http://blogs.sciosoft.com/blogs/post/2010/02/03/Stopping-a-Virtual-PC-image-from-synchronizing-the-date-with-your-host-OS.aspx#comment</wfw:comment>
      <wfw:commentRss>http://blogs.sciosoft.com/blogs/syndication.axd?post=6043417a-034f-45b0-8cca-d89287302944</wfw:commentRss>
    <feedburner:origLink>http://blogs.sciosoft.com/blogs/post.aspx?id=6043417a-034f-45b0-8cca-d89287302944</feedburner:origLink></item>
  </channel>
</rss>
