<?xml version="1.0" encoding="utf-8"?>
<feed xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom">
  <title>Know24.Net</title>
  <link rel="alternate" type="text/html" href="http://www.know24.net/blog/" />
  <link rel="self" href="http://www.know24.net/blog/SyndicationService.asmx/GetAtom" />
  <icon>favicon.ico</icon>
  <updated>2011-08-19T18:47:34.2395+02:00</updated>
  <author>
    <name>Know24.net</name>
  </author>
  <subtitle>Tips - Tricks - Tutorials</subtitle>
  <id>http://www.know24.net/blog/</id>
  <generator uri="http://www.dasblog.net" version="1.9.7067.0">DasBlog</generator>
  <entry>
    <title>Mail Server Benchmarking with MAPSMailer</title>
    <link rel="alternate" type="text/html" href="http://www.know24.net/blog/Mail+Server+Benchmarking+With+MAPSMailer.aspx" />
    <id>http://www.know24.net/blog/PermaLink,guid,a8295b8e-8cae-45ef-984e-2a3523e064da.aspx</id>
    <published>2011-08-19T18:44:45.583+02:00</published>
    <updated>2011-08-19T18:47:34.2395+02:00</updated>
    <category term="Benchmark" label="Benchmark" scheme="http://www.know24.net/blog/CategoryView,category,Benchmark.aspx" />
    <category term="CSharp / C#" label="CSharp / C#" scheme="http://www.know24.net/blog/CategoryView,category,CSharp%2B%2f%2BC%23.aspx" />
    <category term="SMTP" label="SMTP" scheme="http://www.know24.net/blog/CategoryView,category,SMTP.aspx" />
    <category term="Tools" label="Tools" scheme="http://www.know24.net/blog/CategoryView,category,Tools.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:Zoom>0</w:Zoom>
  <w:PunctuationKerning/>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  <w:Compatibility>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
   <w:DontGrowAutofit/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]-->
        <!--[if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
 </w:LatentStyles>
</xml><![endif]-->
        <!--[if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
	mso-para-margin:0cm;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";
	mso-ansi-language:#0400;
	mso-fareast-language:#0400;
	mso-bidi-language:#0400;}
</style>
<![endif]-->
        <p class="MsoNormal">
          <b>
            <span style="font-family: Tahoma;">Introduction:</span>
          </b>
        </p>
        <p class="MsoNormal">
          <span style="font-family: Tahoma;">Maps Mailer is an interactive console application
designed to stress test your incoming and outgoing and Mail servers.<br />
It works by connecting to your SMTP server and from there generates a large volume
of mails to be received by your incoming mail server.<br />
Once the benchmark cycle completes, MAPSMailer will display the total mails transmitted
per second and the bandwidth consumed.</span>
        </p>
        <p class="MsoNormal">
          <span style="font-family: Tahoma;">
            <br />
            <b>Application Use:</b>
          </span>
        </p>
        <p class="MsoNormal">
          <span style="font-family: Tahoma;">As a mail server administrator it’s beneficial
to know just how much load your servers can handle. 
<br />
This tool can assist you in knowing what the peak operating rate is of your incoming
and outgoing mail servers. Additionally it can assist you in identifying network bottlenecks
and helps you measure the result of your mail server configuration changes. </span>
        </p>
        <span style="font-family: Tahoma;">
          <br />
          <b>Application Platform:</b>
        </span>
        <p class="MsoNormal">
          <span style="font-family: Tahoma;">
            <span style="">
            </span>This tool has been written
for the windows platform using the .net framework version 2. Any fairly recent OS
like XP SP2+, Vista, Windows 7 or Windows 2008 comes preloaded with the .net framework
version 2.<br /></span>
        </p>
        <span style="font-family: Tahoma;">
          <br />
          <b>Application Files:</b>
        </span>
        <p class="MsoNormal">
          <span style="font-family: Tahoma;">There are two files. The main executable and the
configuration file.</span>
        </p>
        <p class="MsoNormal">
          <span style="font-family: Tahoma;">1. MAPSM.exe<br />
2. MAPSM.exe.config<br /><br /></span>
        </p>
        <p class="MsoNormal">
          <!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:Zoom>0</w:Zoom>
  <w:PunctuationKerning/>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  <w:Compatibility>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
   <w:DontGrowAutofit/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]-->
          <!--[if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
 </w:LatentStyles>
</xml><![endif]-->
          <!--[if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
	mso-para-margin:0cm;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";
	mso-ansi-language:#0400;
	mso-fareast-language:#0400;
	mso-bidi-language:#0400;}
</style>
<![endif]-->
        </p>
        <p class="MsoNormal">
          <span style="font-family: Tahoma;">
            <b>Configuration: </b>
            <br />
          </span>
        </p>
        <p class="MsoNormal">
          <span style="font-family: Tahoma;">The configuration is contained in an xml called
app.xml.<br />
Here you set your SMTP username, passwords, port number, SSL flag, sender and recipient
address fields.<br /><br /></span>
        </p>
        <p class="MsoNormal" style="">
          <span style="font-size: 9.5pt; font-family: Consolas; color: rgb(241, 242, 243);">
            <pre>
              <span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;">&lt;?xml
version=<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"1.0"</span>?&gt;
&lt;configuration&gt; &lt;appSettings&gt; &lt;!-- server settings --&gt; &lt;add key=<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"SMTPServer"</span> value=<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">""</span> /&gt;
&lt;!-- ip or hostname of your outgoing mail server --&gt; &lt;add key=<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"SMTPUsername"</span> value=<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">""</span> /&gt;
&lt;!-- leave blank <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">if</span> no
username required --&gt; &lt;add key=<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"SMTPPassword"</span> value=<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">""</span> /&gt;
&lt;!-- leave blank <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">if</span> no
password required --&gt; &lt;add key=<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"SMTPUsesSSL"</span> value=<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">""</span> /&gt;
&lt;!-- yes or no --&gt; &lt;add key=<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"SMTPPort"</span> value=<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">""</span> /&gt;
&lt;!-- --&gt; &lt;!-- message settings --&gt; &lt;add key=<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"MessageFrom"</span> value=<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">""</span>/&gt;
&lt;!-- sender@place.com --&gt; &lt;add key=<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"MessageTo"</span> value=<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">""</span>/&gt;
&lt;!-- recipient@place.com --&gt; &lt;add key=<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"MessageSub"</span> value=<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">""</span>/&gt;
&lt;!-- mail subject line --&gt; &lt;/appSettings&gt; &lt;startup&gt;&lt;supportedRuntime
version=<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"v2.0.50727"</span>/&gt;&lt;/startup&gt;&lt;/configuration&gt; </span>
            </pre>
            <br />
 </span>
        </p>
        <p class="MsoNormal">
          <span style="font-family: Tahoma;">
            <b>Running the application:</b>
            <br />
            <br />
Once you configuration is setup. Run the application.<br />
You will be prompted to set the maximum concurrent SMTP connections the program can
use.<br />
The benchmark will run for approximately 30 seconds after which you are presented
with statistics covering the total mails that where sent per second, minute and hour
along with the estimated network bandwidth consumption.</span>
        </p>
        <p class="MsoNormal">
          <span style="font-family: Tahoma;">
            <br />
            <a href="http://www.know24.net/downloads/app/MAPS/MAPSMailer102.zip">Download MAPSMailer</a>.<br /><br /><br /><br />
Enjoy.</span>
        </p>
        <p class="MsoNormal">
          <br />
          <span style="font-family: Tahoma;">
          </span>
        </p>
        <p class="MsoNormal">
          <span style="font-family: Tahoma;">
            <br />
          </span>
        </p>
        <p>
        </p>
        <img width="0" height="0" src="http://www.know24.net/blog/aggbug.ashx?id=a8295b8e-8cae-45ef-984e-2a3523e064da" />
      </div>
    </content>
  </entry>
  <entry>
    <title>myBB 1.6 Thread Tooltip Preview</title>
    <link rel="alternate" type="text/html" href="http://www.know24.net/blog/myBB+16+Thread+Tooltip+Preview.aspx" />
    <id>http://www.know24.net/blog/PermaLink,guid,7c3ba6a8-53c4-414a-a693-18a6d924f1a7.aspx</id>
    <published>2011-08-18T12:46:13.083+02:00</published>
    <updated>2011-08-18T12:51:19.3645+02:00</updated>
    <category term="Php" label="Php" scheme="http://www.know24.net/blog/CategoryView,category,Php.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">I have modified a version of the thread
tooltip preview plugin I found to work in myBB 1.6.3. 
<br />
My php skills and knowledge of myBB's architecture is limited, but I was able to get
it working and stable.<br />
It has been running for a few months on a very busy forum (100k+ page requests per
day) without any problems, so I am comfortable sharing the code now.<br /><br /><br /><font color="#ffa500">Note: Before proceeding with the installation, first backup
your myBB database and uninstall any plugins which also provide thread tooltip support.</font><br /><br /><br /><b>myBB Thread Tooltip Installation:</b><br /><br />
Step 1. Download the plugin <a href="http://www.know24.net/downloads/source/myBB/Plugins/myBBThreadTooltip.zip">here</a>.<br /><br />
Step 2. Place the plugin in your ./inc/plugins directory.<br />
 <br />
Step 3. Login to your Admin CP and install the plugin. (Admin CP --&gt; Home --&gt;
Plugins --&gt; [Locate plugin] --&gt; Click Install)<br /><br />
Step 4. Recount and Rebuild the thread tooltips cache. 
<br /><br />
Installation is complete.<br /><br /><br /><b>Special Notes:</b><br /><br />
1. When when logged in as a Administrator or Moderator, you need to hover over the
thread body to view the thread tooltip preview. This is because myBB allows admins
and moderators to perform one click editing of the thread title.<br /><br />
2. When recounting and rebuilding the thread tooltip cache on large forums, it can
take quite long to complete and puts the DB server under high load. If you receive
an "Internal Server Error", start the rebuilding and recounting process again.<br /><br /><br /><font size="2"><i>Credit: This version of the tooltip was originally made available
by "ZiNgA BuRgA" for use on myBB 1.4.</i></font><br /><br /><br /><br /><br /><p></p><img width="0" height="0" src="http://www.know24.net/blog/aggbug.ashx?id=7c3ba6a8-53c4-414a-a693-18a6d924f1a7" /></div>
    </content>
  </entry>
  <entry>
    <title>myBB Updates</title>
    <link rel="alternate" type="text/html" href="http://www.know24.net/blog/myBB+Updates.aspx" />
    <id>http://www.know24.net/blog/PermaLink,guid,5da23f0d-738f-48e5-bc79-33ae6dbd1645.aspx</id>
    <published>2011-08-18T10:58:06.083+02:00</published>
    <updated>2011-08-18T12:53:51.177+02:00</updated>
    <category term="Php" label="Php" scheme="http://www.know24.net/blog/CategoryView,category,Php.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">Recently I assisted a mate of mine with
making some custom modifications to he's myBB forum (php) and I've decided to post
some of these solutions here here on my blog. 
<br /><br />
The following two solutions I came up with are coming soon.<br /><br />
1. <a href="http://www.know24.net/blog/myBB+16+Thread+Tooltip+Preview.aspx">myBB 1.6
Thread Tooltip Preview</a>.<br />
2. Hiding birthdays of users who are banned or who are waiting activation.<br /><br /><br /><br /><p></p><img width="0" height="0" src="http://www.know24.net/blog/aggbug.ashx?id=5da23f0d-738f-48e5-bc79-33ae6dbd1645" /></div>
    </content>
  </entry>
  <entry>
    <title>AppFabric, Static Content Not Loading</title>
    <link rel="alternate" type="text/html" href="http://www.know24.net/blog/AppFabric+Static+Content+Not+Loading.aspx" />
    <id>http://www.know24.net/blog/PermaLink,guid,f8c751aa-58f9-4bce-b9e7-349e1c007a2a.aspx</id>
    <published>2011-03-12T17:57:00.34+02:00</published>
    <updated>2011-03-12T18:04:12.949625+02:00</updated>
    <category term="App Fabric" label="App Fabric" scheme="http://www.know24.net/blog/CategoryView,category,App%2BFabric.aspx" />
    <category term="Azure" label="Azure" scheme="http://www.know24.net/blog/CategoryView,category,Azure.aspx" />
    <category term="IIS" label="IIS" scheme="http://www.know24.net/blog/CategoryView,category,IIS.aspx" />
    <category term="Visual Studio 2010" label="Visual Studio 2010" scheme="http://www.know24.net/blog/CategoryView,category,Visual%2BStudio%2B2010.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">I ran into a problem where my static images,
css, js and html content in my local Azure Web Application was not loading. 
<br />
Fiddler revealed that the requests where being served with full headers yet with no
content (0 bytes).<br /><br /><img src="http://www.know24.net/blog/images/Articles/21_fiddler.png" alt="21_fiddler.png" height="569" border="0" width="1019" /><br /><br />
Locally developed Azure applications when tested run on IIS not your visual studio
integrated web server.<br />
The problem was that IIS7.5 was not set to serve static content and enabling the feature
solved the problem.<br /><br /><img src="http://www.know24.net/blog/images/Articles/21_add_remove_IIS_features.png" alt="21_add_remove_IIS_features.png" height="375" border="0" width="429" /><br /><br /><br /><p></p><img width="0" height="0" src="http://www.know24.net/blog/aggbug.ashx?id=f8c751aa-58f9-4bce-b9e7-349e1c007a2a" /></div>
    </content>
  </entry>
  <entry>
    <title>Redirect all pages to WWW</title>
    <link rel="alternate" type="text/html" href="http://www.know24.net/blog/Redirect+All+Pages+To+WWW.aspx" />
    <id>http://www.know24.net/blog/PermaLink,guid,4da87677-009b-479c-8b9a-f12245479dea.aspx</id>
    <published>2011-03-09T11:42:21.293375+02:00</published>
    <updated>2011-03-09T11:42:21.293375+02:00</updated>
    <category term="Code Snippets" label="Code Snippets" scheme="http://www.know24.net/blog/CategoryView,category,Code%2BSnippets.aspx" />
    <category term="CSharp / C#" label="CSharp / C#" scheme="http://www.know24.net/blog/CategoryView,category,CSharp%2B%2f%2BC%23.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Here is a simple method of ensure all requests to your application domain include
the WWW subdomain prefix. 
<br />
Place the following code in your Global.asax file.<br /><br />
Note: Uncomment the code in the RedirectToWWW method should you need to prevent redirects
while testing locally.
</p>
        <pre dir="ltr">
          <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: black; FONT-SIZE: 11px">
            <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">//
global.asax</span>
            <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">protected</span>
            <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">void</span> Application_BeginRequest(Object
sender, EventArgs e) { RedirectToWWW(); } <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">private</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">static</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">void</span> RedirectToWWW()
    { <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">      //
prevent adding www. when testing</span>       <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">//
if (HttpContext.Current.Request.Url.ToString().ToLower().Contains("localhost"))</span>       <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">//
return;</span>             <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: green; FONT-SIZE: 11px">//
Redirect to www.clienturl.com if the user types in clienturl.com.</span>             <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">if</span> (HttpContext.Current.Request.Url
!<span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">=</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: blue; FONT-SIZE: 11px">null</span>                 &amp;&amp;
!String.IsNullOrEmpty(HttpContext.Current.Request.Url.Host)                
                &amp;&amp;
!HttpContext.Current.Request.Url.Host.ToLower().StartsWith(<span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"www"</span>))
            {                 HttpContext.Current.Response.Redirect(<span style="BACKGROUND-COLOR: #e4e4e4; FONT-FAMILY: Courier New; COLOR: #666666; FONT-SIZE: 11px">"http://www."</span><span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">+</span> HttpContext.Current.Request.Url.Host <span style="BACKGROUND-COLOR: transparent; FONT-FAMILY: Courier New; COLOR: red; FONT-SIZE: 11px">+</span> HttpContext.Current.Request.Url.AbsolutePath);
            }      }<br /></span>
        </pre>
        <img width="0" height="0" src="http://www.know24.net/blog/aggbug.ashx?id=4da87677-009b-479c-8b9a-f12245479dea" />
      </div>
    </content>
  </entry>
  <entry>
    <title>[FIXED] Could not load file or assembly Telerik.Web.UI</title>
    <link rel="alternate" type="text/html" href="http://www.know24.net/blog/FIXED+Could+Not+Load+File+Or+Assembly+TelerikWebUI.aspx" />
    <id>http://www.know24.net/blog/PermaLink,guid,2450073f-8335-45ec-9f09-f031f64c2d9f.aspx</id>
    <published>2010-12-10T13:45:46.734+02:00</published>
    <updated>2010-12-10T14:55:05.4373125+02:00</updated>
    <category term="Telerik" label="Telerik" scheme="http://www.know24.net/blog/CategoryView,category,Telerik.aspx" />
    <category term="Visual Studio 2010" label="Visual Studio 2010" scheme="http://www.know24.net/blog/CategoryView,category,Visual%2BStudio%2B2010.aspx" />
    <category term="VS2008" label="VS2008" scheme="http://www.know24.net/blog/CategoryView,category,VS2008.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <i>Could not load file or assembly 'Telerik.Web.UI,
Version=, Culture=neutral, PublicKeyToken=' or one of its dependencies. 
<br />
The located assembly's manifest definition does not match the assembly reference.
(Exception from HRESULT: 0x80131040)</i>
        <br />
        <br />
When using Telerik Rad Controls for asp.net you may encounter assembly reference exceptions
when using a more recent version of RadControls against a website compiled using an
older version of Rad Controls.<br />
Traditionally to resolve this problem one would download the latest Rad Controls and
re-compile the project and publish this to the live environment. 
<br />
There is a simpler fix however, one that bypasses the need to recompile each website
and its done be specifying a runtime configuration element in your web.config file. 
<br /><br />
Here is the code. Remember to set the newVersion attribute to the version of Rad Controls
for ASP.NET that you are using.<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"><br /><br />
&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(163, 21, 21);">runtime</span>&gt;<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"><br />
    &lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(163, 21, 21);">assemblyBinding</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">xmlns</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">=</span>"<span style="color: blue;">urn:schemas-microsoft-com:asm.v1</span>"<span style="color: blue;">&gt;</span><br /><p class="MsoNormal"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">     
&lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(163, 21, 21);">probing</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">privatePath</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">=</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">"<span style="color: blue;">bin;</span>"<span style="color: blue;"> /&gt;</span><br />
      &lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(163, 21, 21);">dependentAssembly</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;<br />
        &lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(163, 21, 21);">assemblyIdentity</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">name</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">=</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">"<span style="color: blue;">Telerik.Web.UI</span>"<span style="color: blue;"></span><span style="color: red;">culture</span><span style="color: blue;">=</span>"<span style="color: blue;">neutral</span>"<span style="color: blue;"></span><span style="color: red;">publicKeyToken</span><span style="color: blue;">=</span>"<span style="color: blue;">121fae78165ba3d4</span>"<span style="color: blue;"> /&gt;</span><br />
        &lt;</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(163, 21, 21);">bindingRedirect</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;"></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">oldVersion</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">=</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">"<span style="color: blue;">0.0.0.0-65535.65535.65535.65535</span>"<span style="color: blue;"></span><span style="color: red;">newVersion</span><span style="color: blue;">=</span>"<span style="color: blue;">2010.1.519.35</span>"<span style="color: blue;">/&gt;</span><br />
      &lt;/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(163, 21, 21);">dependentAssembly</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;<br />
    &lt;/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(163, 21, 21);">assemblyBinding</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;<br />
&lt;/</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(163, 21, 21);">runtime</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: blue;">&gt;</span></p>
This web.config configuration informs the asp.net runtime to use your latest version
of Rad Controls even if the project was compiled against an older version.<br /><p></p><img width="0" height="0" src="http://www.know24.net/blog/aggbug.ashx?id=2450073f-8335-45ec-9f09-f031f64c2d9f" /></div>
    </content>
  </entry>
  <entry>
    <title>Object Cloning in Silverlight</title>
    <link rel="alternate" type="text/html" href="http://www.know24.net/blog/Object+Cloning+In+Silverlight.aspx" />
    <id>http://www.know24.net/blog/PermaLink,guid,88e2d0c7-289d-4b2d-8aa5-b539faf682eb.aspx</id>
    <published>2010-10-06T19:41:41.364+02:00</published>
    <updated>2010-10-06T19:42:30.382346+02:00</updated>
    <category term="Silverlight" label="Silverlight" scheme="http://www.know24.net/blog/CategoryView,category,Silverlight.aspx" />
    <category term="Visual Studio 2010" label="Visual Studio 2010" scheme="http://www.know24.net/blog/CategoryView,category,Visual%2BStudio%2B2010.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">I ran into a small problem in Silverlight
today where I was quering a static list via linq and populating another custom list
with the result. 
<br />
When I proceeded to modify the values of the second list, the first list's values
changed as well. 
<br />
This is when I realised my mistake. LinQ never returns a copy/clone of a queried list,
it returns the pointer/reference to the list.<br /><br />
So, the obvious solution was to clone/copy my object list and perform any changes
I needed to on the cloned list.<br />
The simplest approach to achieving this is to serialise our object list and deserialise
it again. This will cause a copy of it be made in memory which we cast back to a new
object list. 
<br /><br /><b>Here is how:</b><br /><br />
Firstly you will need to include Rockford Lhotka's Silverlight Serializer, you can
download the class file <a href="http://www.know24.net/downloads/source/SilverlightSerializer.cs">here</a>.<br />
As Silverlight is running a slightly modified/minified version of .net, its missing
a serialisation feature which this class file provides.<br /><br />
Next we write our object Clone method as follows:<br /><pre><span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;"><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">public</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">static</span> T
Clone&lt;T&gt;(T obj) { <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">using</span> (MemoryStream
stream <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">new</span> MemoryStream())
{ SilverlightSerializer.Serialize(obj, stream); stream.Position <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span> 0; <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">return</span> (T)
SilverlightSerializer.Deserialize(stream); } }</span></pre><br />
And lastly here is an example of how to call the Clone method.<br /><br /><pre><span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;"><span style="color: Green; background-color: Transparent; font-family: Courier New; font-size: 11px;">//
get records matching year and month</span> var iEnumSales <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span> dsc.Where(x
=&gt; x.YearMonth.Year == year &amp;&amp; x.YearMonth.Month == month).ToList(); 
<br />
var salesList <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">new</span> DailySalesCollection(); <span style="color: Green; background-color: Transparent; font-family: Courier New; font-size: 11px;">//
to prevent modifying the static collection later, we clone/copy the iEnumSales linq
query results</span><span style="color: Green; background-color: Transparent; font-family: Courier New; font-size: 11px;"></span> salesList.AddRange(ObjectHelper.Clone(iEnumSales));</span></pre><br />
Thats it for today. 
<br /><br /><br /><p></p><img width="0" height="0" src="http://www.know24.net/blog/aggbug.ashx?id=88e2d0c7-289d-4b2d-8aa5-b539faf682eb" /></div>
    </content>
  </entry>
  <entry>
    <title>Visual Studio 2010 - Performance Profiler</title>
    <link rel="alternate" type="text/html" href="http://www.know24.net/blog/Visual+Studio+2010+Performance+Profiler.aspx" />
    <id>http://www.know24.net/blog/PermaLink,guid,a319a07e-af1b-4d33-8887-4f9eb2ef1f09.aspx</id>
    <published>2010-08-16T20:47:01.829+02:00</published>
    <updated>2010-08-16T20:53:55.079875+02:00</updated>
    <category term="Visual Studio 2010" label="Visual Studio 2010" scheme="http://www.know24.net/blog/CategoryView,category,Visual%2BStudio%2B2010.aspx" />
    <content type="html">&lt;link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml"&gt;
&lt;link rel="Edit-Time-Data" href="file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_editdata.mso"&gt;
&lt;!--[if !mso]&gt;
&lt;style&gt;
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
&lt;/style&gt;
&lt;![endif]--&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:WordDocument&gt;
  &lt;w:View&gt;Normal&lt;/w:View&gt;
  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
  &lt;w:PunctuationKerning/&gt;
  &lt;w:ValidateAgainstSchemas/&gt;
  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
  &lt;w:Compatibility&gt;
   &lt;w:BreakWrappedTables/&gt;
   &lt;w:SnapToGridInCell/&gt;
   &lt;w:WrapTextWithPunct/&gt;
   &lt;w:UseAsianBreakRules/&gt;
   &lt;w:DontGrowAutofit/&gt;
  &lt;/w:Compatibility&gt;
  &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
 &lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:LatentStyles DefLockedState="false" LatentStyleCount="156"&gt;
 &lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt;
&lt;!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0cm;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
@page Section1
	{size:612.0pt 792.0pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;
	mso-header-margin:36.0pt;
	mso-footer-margin:36.0pt;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
--&gt;
&lt;/style&gt;
&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
	mso-para-margin:0cm;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";
	mso-ansi-language:#0400;
	mso-fareast-language:#0400;
	mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;
&lt;link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml"&gt;
&lt;link rel="Edit-Time-Data" href="file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_editdata.mso"&gt;
&lt;!--[if !mso]&gt;
&lt;style&gt;
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
&lt;/style&gt;
&lt;![endif]--&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:WordDocument&gt;
  &lt;w:View&gt;Normal&lt;/w:View&gt;
  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
  &lt;w:PunctuationKerning/&gt;
  &lt;w:ValidateAgainstSchemas/&gt;
  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
  &lt;w:Compatibility&gt;
   &lt;w:BreakWrappedTables/&gt;
   &lt;w:SnapToGridInCell/&gt;
   &lt;w:WrapTextWithPunct/&gt;
   &lt;w:UseAsianBreakRules/&gt;
   &lt;w:DontGrowAutofit/&gt;
  &lt;/w:Compatibility&gt;
  &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
 &lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:LatentStyles DefLockedState="false" LatentStyleCount="156"&gt;
 &lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt;
&lt;!--
 /* Font Definitions */
 @font-face
	{font-family:Wingdings;
	panose-1:5 0 0 0 0 0 0 0 0 0;
	mso-font-charset:2;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:0 268435456 0 0 -2147483648 0;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:-1610611985 1073750139 0 0 159 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0cm;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
@page Section1
	{size:612.0pt 792.0pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;
	mso-header-margin:35.4pt;
	mso-footer-margin:35.4pt;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
--&gt;
&lt;/style&gt;
&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
	mso-para-margin:0cm;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";
	mso-ansi-language:#0400;
	mso-fareast-language:#0400;
	mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;
&lt;p class="MsoNormal" style="margin-bottom: 10pt; line-height: 115%;"&gt;
&lt;span style="font-size: 11pt; line-height: 115%; font-family: Calibri;" lang="EN"&gt;The
VS 2010 Profiler allows you to analyse your running application to identify code-performance
bottlenecks and correct them. 
&lt;br&gt;
The Profiler also gives a good overview on how efficient an application is.&lt;br&gt;
&lt;br&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: 10pt; line-height: 115%;"&gt;
&lt;span style="font-size: 11pt; line-height: 115%; font-family: Calibri;" lang="EN"&gt;&lt;img src="http://www.know24.net/blog/images/performancereport.jpg"&gt;
&lt;br&gt;
&lt;br&gt;
&lt;/span&gt;
&lt;!--[if gte vml 1]&gt;&lt;v:shapetype id="_x0000_t75" coordsize="21600,21600"
 o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f"
 stroked="f"&gt;
 &lt;v:stroke joinstyle="miter"/&gt;
 &lt;v:formulas&gt;
  &lt;v:f eqn="if lineDrawn pixelLineWidth 0"/&gt;
  &lt;v:f eqn="sum @0 1 0"/&gt;
  &lt;v:f eqn="sum 0 0 @1"/&gt;
  &lt;v:f eqn="prod @2 1 2"/&gt;
  &lt;v:f eqn="prod @3 21600 pixelWidth"/&gt;
  &lt;v:f eqn="prod @3 21600 pixelHeight"/&gt;
  &lt;v:f eqn="sum @0 0 1"/&gt;
  &lt;v:f eqn="prod @6 1 2"/&gt;
  &lt;v:f eqn="prod @7 21600 pixelWidth"/&gt;
  &lt;v:f eqn="sum @8 21600 0"/&gt;
  &lt;v:f eqn="prod @7 21600 pixelHeight"/&gt;
  &lt;v:f eqn="sum @10 21600 0"/&gt;
 &lt;/v:formulas&gt;
 &lt;v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/&gt;
 &lt;o:lock v:ext="edit" aspectratio="t"/&gt;
&lt;/v:shapetype&gt;&lt;v:shape id="_x0000_i1025" type="#_x0000_t75" style='width:664.5pt;
 height:465.75pt'&gt;
 &lt;v:imagedata src="file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\msohtml1\01\clip_image001.png"
  o:title=""/&gt;
&lt;/v:shape&gt;&lt;![endif]--&gt;
&lt;!--[if !vml]--&gt;
&lt;!--[endif]--&gt;&lt;span style="font-size: 11pt; line-height: 115%; font-family: Calibri;" lang="EN"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: 10pt; line-height: 115%;"&gt;
&lt;span style="font-size: 11pt; line-height: 115%; font-family: Calibri;" lang="EN"&gt;After
running the profiler on your application it provides you with a report composed of
a line Chart displaying the CPU usage, a Hot Path displaying the most expensive calls
and a list of functions which are consuming the most processor time in your app.&lt;br&gt;
The line-chart allows you to identify CPU-Application spikes and drill down into it
to uncover what code caused that spike.&lt;br&gt;
Additionally, something useful for us is the ability to enable recording of all ADO
calls to DB stored procedures to get a good understanding on how often in our app
we are hitting the DB.&lt;br style=""&gt;
&lt;!--[if !supportLineBreakNewLine]--&gt;
&lt;br style=""&gt;
&lt;!--[endif]--&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: 10pt; line-height: 115%;"&gt;
&lt;b style=""&gt;&lt;span style="font-size: 11pt; line-height: 115%; font-family: Calibri;" lang="EN"&gt;Getting
Started&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: 10pt; line-height: 115%;"&gt;
&lt;span style="font-size: 11pt; line-height: 115%; font-family: Calibri;" lang="EN"&gt;To
get started is straight forward. 
&lt;br&gt;
1. Open your application in VS2010, Select Debug &lt;/span&gt;&lt;span style="font-size: 11pt; line-height: 115%; font-family: Wingdings;" lang="EN"&gt;&lt;span style=""&gt;à&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt; line-height: 115%; font-family: Calibri;" lang="EN"&gt; Start
Performance Analysis. 
&lt;br&gt;
2. A configuration wizard will open, click Next, Next Finish. 
&lt;br&gt;
3. The Profiler will now run in the background, in the meantime begin making use of
your application to allow the Profiler to record the apps resource usage.&lt;br&gt;
&lt;span style=""&gt;&amp;nbsp;&lt;/span&gt;
&lt;br&gt;
Once you are done, stop debugging or stop your application which will lead to the
performance report being generated and displayed for you. 
&lt;br&gt;
To change what the profiler tests, see the performance profiler properties to enable
features like ADO logging and more.&lt;br&gt;
&lt;!--[endif]--&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.know24.net/blog/aggbug.ashx?id=a319a07e-af1b-4d33-8887-4f9eb2ef1f09" /&gt;</content>
  </entry>
  <entry>
    <title>ASP.NET HTTP 301 Redirect</title>
    <link rel="alternate" type="text/html" href="http://www.know24.net/blog/ASPNET+HTTP+301+Redirect.aspx" />
    <id>http://www.know24.net/blog/PermaLink,guid,82c577c9-7b6f-4eff-9702-f8e48dd5025a.aspx</id>
    <published>2010-04-26T19:26:24.603875+02:00</published>
    <updated>2010-04-26T19:26:24.603875+02:00</updated>
    <category term="ASP.NET 2" label="ASP.NET 2" scheme="http://www.know24.net/blog/CategoryView,category,ASP.NET%2B2.aspx" />
    <category term="CSharp / C#" label="CSharp / C#" scheme="http://www.know24.net/blog/CategoryView,category,CSharp%2B%2f%2BC%23.aspx" />
    <category term="VS2008" label="VS2008" scheme="http://www.know24.net/blog/CategoryView,category,VS2008.aspx" />
    <content type="html">We recently migrated a clients domain from domainA.com to domainB.com.&lt;br&gt;
If you are familiar with search engines and indexing, migrated domains that do not
have proper 301 redirects pointing from the old domain to the new will cause the new
domain to miss a lot of search engine traffic. The new domain will in fact have to
start all over again and get re-indexed by search engines which can take months.&lt;br&gt;
&lt;br&gt;
&lt;b&gt;How do you prevent this? &lt;/b&gt;
&lt;br&gt;
Simple, setup a global HTTP 301 url redirect on your old domain.&lt;br&gt;
Any requests to the old domain will be redirected permanently to the new domain, including
the path and query so that your new domain gets all the traffic the new domain would.&lt;br&gt;
&lt;br&gt;
&lt;b&gt;Why use a HTTP 301 redirect?&lt;/b&gt;
&lt;br&gt;
Well, by doing a 301 redirect, any search engines following the redirect would remember
that you want to permanently update your link. This way the SE will update its records
and by doing this your domain's current rankings will be better maintained.&lt;br&gt;
&lt;br&gt;
&lt;b&gt;How do you implement a global HTTP 301 redirect?&lt;/b&gt;
&lt;br&gt;
In ASP.NET, it requires editing the global.asax's application_beginrequest event. 
&lt;br&gt;
See the code sample below:&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
&lt;meta name="ProgId" content="Word.Document"&gt;
&lt;meta name="Generator" content="Microsoft Word 11"&gt;
&lt;meta name="Originator" content="Microsoft Word 11"&gt;
&lt;link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml"&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:WordDocument&gt;
  &lt;w:View&gt;Normal&lt;/w:View&gt;
  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
  &lt;w:PunctuationKerning/&gt;
  &lt;w:ValidateAgainstSchemas/&gt;
  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
  &lt;w:Compatibility&gt;
   &lt;w:BreakWrappedTables/&gt;
   &lt;w:SnapToGridInCell/&gt;
   &lt;w:WrapTextWithPunct/&gt;
   &lt;w:UseAsianBreakRules/&gt;
   &lt;w:DontGrowAutofit/&gt;
  &lt;/w:Compatibility&gt;
  &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
 &lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:LatentStyles DefLockedState="false" LatentStyleCount="156"&gt;
 &lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt;
&lt;!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0cm;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
@page Section1
	{size:612.0pt 792.0pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;
	mso-header-margin:35.4pt;
	mso-footer-margin:35.4pt;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
--&gt;
&lt;/style&gt;
&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
	mso-para-margin:0cm;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";
	mso-ansi-language:#0400;
	mso-fareast-language:#0400;
	mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;
&lt;p class="MsoNormal" style=""&gt;
&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;protected&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Application_BeginRequest(Object
sender, EventArgs e)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style=""&gt;
&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style=""&gt;
&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: green;"&gt;//
url exists?&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style=""&gt;
&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;if&lt;/span&gt; (Request.Url
!= &lt;span style="color: blue;"&gt;null&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style=""&gt;
&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style=""&gt;
&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&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&gt;&lt;span style="color: green;"&gt;//
301-redirect for domainA.com to DomainB.com&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style=""&gt;
&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&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&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt; key
= &lt;span style="color: rgb(163, 21, 21);"&gt;"domainA.com"&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style=""&gt;
&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&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&gt;&lt;span style="color: blue;"&gt;if&lt;/span&gt; (Request.Url.Host.ToLower().Contains(key)
== &lt;span style="color: blue;"&gt;true&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style=""&gt;
&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&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&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style=""&gt;
&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Response.ClearHeaders();&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style=""&gt;
&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Response.Status
= &lt;span style="color: rgb(163, 21, 21);"&gt;"301 Moved Permanently"&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style=""&gt;
&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Response.AddHeader(&lt;span style="color: rgb(163, 21, 21);"&gt;"Location"&lt;/span&gt;, &lt;span style="color: rgb(163, 21, 21);"&gt;"http://www.domainB.com"&lt;/span&gt; +
Request.Url.PathAndQuery);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style=""&gt;
&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style=""&gt;
&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&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&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style=""&gt;
&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/span&gt;
&lt;/p&gt;
&lt;br&gt;
So for example if we receive an incoming url on http://domainA.com/product.aspx?id=5
, this will redirected to 
&lt;br&gt;
http://domainB.com/product.aspx?id=5. 
&lt;br&gt;
Search engine's will update their links and your site will benefit from a good amount
of traffic from your old domain.&lt;br&gt;
&lt;br&gt;
Hope this helps you!&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.know24.net/blog/aggbug.ashx?id=82c577c9-7b6f-4eff-9702-f8e48dd5025a" /&gt;</content>
  </entry>
  <entry>
    <title>HTTP Compression</title>
    <link rel="alternate" type="text/html" href="http://www.know24.net/blog/HTTP+Compression.aspx" />
    <id>http://www.know24.net/blog/PermaLink,guid,9d0deb4a-fbd1-4d3e-b34c-1459aff66a6a.aspx</id>
    <published>2010-04-19T01:05:00.493875+02:00</published>
    <updated>2010-04-19T01:05:00.493875+02:00</updated>
    <category term="IIS" label="IIS" scheme="http://www.know24.net/blog/CategoryView,category,IIS.aspx" />
    <content type="html">&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
&lt;meta name="ProgId" content="Word.Document"&gt;
&lt;meta name="Generator" content="Microsoft Word 11"&gt;
&lt;meta name="Originator" content="Microsoft Word 11"&gt;
&lt;link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml"&gt;
&lt;link rel="Edit-Time-Data" href="file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_editdata.mso"&gt;
&lt;!--[if !mso]&gt;
&lt;style&gt;
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
&lt;/style&gt;
&lt;![endif]--&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:WordDocument&gt;
  &lt;w:View&gt;Normal&lt;/w:View&gt;
  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
  &lt;w:PunctuationKerning/&gt;
  &lt;w:ValidateAgainstSchemas/&gt;
  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
  &lt;w:Compatibility&gt;
   &lt;w:BreakWrappedTables/&gt;
   &lt;w:SnapToGridInCell/&gt;
   &lt;w:WrapTextWithPunct/&gt;
   &lt;w:UseAsianBreakRules/&gt;
   &lt;w:DontGrowAutofit/&gt;
  &lt;/w:Compatibility&gt;
  &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
 &lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:LatentStyles DefLockedState="false" LatentStyleCount="156"&gt;
 &lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt;
&lt;!--
 /* Font Definitions */
 @font-face
	{font-family:Wingdings;
	panose-1:5 0 0 0 0 0 0 0 0 0;
	mso-font-charset:2;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:0 268435456 0 0 -2147483648 0;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:1627421319 -2147483648 8 0 66047 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0cm;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;
	text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;
	text-underline:single;}
p
	{mso-margin-top-alt:auto;
	margin-right:0cm;
	mso-margin-bottom-alt:auto;
	margin-left:0cm;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
@page Section1
	{size:612.0pt 792.0pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;
	mso-header-margin:35.4pt;
	mso-footer-margin:35.4pt;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
 /* List Definitions */
 @list l0
	{mso-list-id:265773248;
	mso-list-template-ids:1727045154;}
@list l0:level1
	{mso-level-tab-stop:36.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
ol
	{margin-bottom:0cm;}
ul
	{margin-bottom:0cm;}
--&gt;
&lt;/style&gt;
&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
	mso-para-margin:0cm;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";
	mso-ansi-language:#0400;
	mso-fareast-language:#0400;
	mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;
&lt;p class="MsoNormal"&gt;
&lt;b style=""&gt;&lt;span style="font-family: Tahoma;"&gt;HTTP Compression: &lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Tahoma;"&gt;
&lt;br&gt;
&lt;br&gt;
HTTP compression is a capability that is built into web servers and web browsers to
make better use of available bandwidth, and provide faster transmission speeds between
both. 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-family: Tahoma;"&gt;HTTP data is compressed before it is sent from
the server: compliant browsers will announce what methods are supported to the server
before downloading the correct format; unsupported browsers will download uncompressed
data so enabling HTTP compression does not prevent older browsers from viewing the
Html content. 
&lt;br&gt;
&lt;br&gt;
&lt;b style=""&gt;Benefits of HTTP Compression:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/b&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-family: Tahoma;"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-family: Tahoma;"&gt;Let’s say we are working with a 100KByte Html page. 
&lt;br&gt;
This page is hosted on our clients website and when it’s served to a browser, the
browser downloads 100BKytes.&lt;br&gt;
If our upstream bandwidth is limited to 100Kbytes a second, this means that we can
serve 1 of these pages to a 1 browser every second. 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-family: Tahoma;"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-family: Tahoma;"&gt;If we use HTTP Compression, we can compress the
page to 30Kbytes and what this means is that we can now serve 3 compressed pages to
three browsers in 1 second. 
&lt;br&gt;
Not only that, users downloading compressed Html will experience a smoother/faster
user experience.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-family: Tahoma;"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-family: Tahoma;"&gt;The final benefit is that your monthly bandwidth
costs are reduced by around 60%. 
&lt;br style=""&gt;
&lt;!--[if !supportLineBreakNewLine]--&gt;
&lt;br style=""&gt;
&lt;!--[endif]--&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;b style=""&gt;&lt;span style="font-family: Tahoma;"&gt;Server Impact:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-family: Tahoma;"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-family: Tahoma;"&gt;When configuring HTTP Compression on any server
one needs to keep in mind that compressing anything adds to the server load. 
&lt;br&gt;
If the server is already running at a high average load then it is not recommended
to enable HTTP compression.&lt;br style=""&gt;
&lt;!--[if !supportLineBreakNewLine]--&gt;
&lt;br style=""&gt;
&lt;!--[endif]--&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-family: Tahoma;"&gt;After enabling compression one must monitor the
server and if the load and depending on the server OS you are running, configure the
HTTP Compression settings to adjust to the load. 
&lt;br&gt;
In Windows Server 2003 you can fine tune your compression settings so that at times
of high load the server will stop serving compressed content. 
&lt;br style=""&gt;
&lt;!--[if !supportLineBreakNewLine]--&gt;
&lt;br style=""&gt;
&lt;!--[endif]--&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;b style=""&gt;&lt;span style="font-family: Tahoma;"&gt;Types of HTTP Compression:&lt;br&gt;
&lt;br&gt;
&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: Tahoma;"&gt;There are two forms of compression;
Static and Dynamic.&lt;br&gt;
&lt;br&gt;
Static compression is the compression of static web pages such as .Html, .Js and cascading
style sheets.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-family: Tahoma;"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-family: Tahoma;"&gt;Static compression only compresses static content
once and then it moves the statically compressed file to a cache folder and serves
it from there. 
&lt;br&gt;
Even if your server is under high load, compressing static content will not increase
your server load as it just compresses static content once.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-family: Tahoma;"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-family: Tahoma;"&gt;Dynamic compression is the compression of dynamically
generated web pages such as those served by ASP, PHP enabled servers. 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-family: Tahoma;"&gt;Unlike static compression, dynamic compression
needs to compress each and every page each time the page is served; hence dynamic
compression can increase the server load, especially on very busy servers.&lt;b style=""&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/b&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-family: Tahoma;"&gt;
&lt;br&gt;
&lt;b style=""&gt;Configuring HTTP Compression on Windows 2003 Server:&lt;br&gt;
&lt;br&gt;
&lt;/b&gt;Microsoft never completed their GUI for IIS to enable dynamic compression.&lt;br&gt;
Microsoft instead requires you to edit the IIS meta-base file which is rather dangerous
for the average user to do.&lt;br&gt;
Fortunately there is a good tool by a company called Port80 that I’ve used with success
that allows the configuration of Windows 2003 Server.&lt;br style=""&gt;
&lt;!--[if !supportLineBreakNewLine]--&gt;
&lt;br style=""&gt;
&lt;!--[endif]--&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-family: Tahoma;"&gt;The name of the tool is ZipEnable for IIS. 
&lt;br&gt;
This tool allows you to configure static and dynamic compression site server wide
or on the website level.&lt;br&gt;
Further you can set the compression strength and define a CPU load value where compression
will no longer be performed along with a host of other features.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;b style=""&gt;Configuring HTTP Compression on Windows 2008 Server:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/b&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-family: Tahoma;"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-family: Tahoma;"&gt;HTTP Compression support was adequately integrated
into a GUI within Windows Server 2008.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-family: Tahoma;"&gt;
&lt;br&gt;
To enable support for dynamic and static compression, do the following:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;ol start="1" type="1"&gt;
&lt;li class="MsoNormal" style=""&gt;
&lt;span style="font-size: 10pt; font-family: Tahoma;"&gt;On the taskbar, click &lt;b&gt;Start&lt;/b&gt;,
point to &lt;b&gt;Administrative Tools&lt;/b&gt;, and then click &lt;b&gt;Server Manager&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/li&gt;
&lt;li class="MsoNormal" style=""&gt;
&lt;span style="font-size: 10pt; font-family: Tahoma;"&gt;In the &lt;b&gt;Server Manager&lt;/b&gt; hierarchy
pane, expand &lt;b&gt;Roles&lt;/b&gt;, and then click &lt;b&gt;Web Server (IIS)&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/li&gt;
&lt;li class="MsoNormal" style=""&gt;
&lt;span style="font-size: 10pt; font-family: Tahoma;"&gt;In the &lt;b&gt;Web Server (IIS)&lt;/b&gt; pane,
scroll to the &lt;b&gt;Role Services&lt;/b&gt; section, and then click &lt;b&gt;Add Role Services&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/li&gt;
&lt;li class="MsoNormal" style=""&gt;
&lt;span style="font-size: 10pt; font-family: Tahoma;"&gt;On the &lt;b&gt;Select Role Services&lt;/b&gt; page
of the &lt;b&gt;Add Role Services Wizard&lt;/b&gt;, select &lt;b&gt;Dynamic&lt;/b&gt; &lt;b&gt;Content Compression&lt;/b&gt; if
you want to install dynamic compression and &lt;b&gt;Static Content Compression&lt;/b&gt; if you
want to install static compression, and then click &lt;b&gt;Next&lt;/b&gt;.&lt;/span&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;ol start="5" type="1"&gt;
&lt;li class="MsoNormal" style=""&gt;
&lt;span style="font-size: 10pt; font-family: Tahoma;"&gt;On the &lt;b&gt;Confirm Installation
Selections&lt;/b&gt; page, click &lt;b&gt;Install&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/li&gt;
&lt;li class="MsoNormal" style=""&gt;
&lt;span style="font-size: 10pt; font-family: Tahoma;"&gt;On the &lt;b&gt;Results&lt;/b&gt; page, click &lt;b&gt;Close&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-family: Tahoma;"&gt;
&lt;br&gt;
Once the HTTP compression features have been installed you can now open IIS Manager
(Start &lt;/span&gt;&lt;span style="font-family: Wingdings;"&gt;&lt;span style=""&gt;à&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Tahoma;"&gt; Run &lt;/span&gt;&lt;span style="font-family: Wingdings;"&gt;&lt;span style=""&gt;à&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Tahoma;"&gt; inetmgr)
and browse to the website you have decided to test HTTP compression on.&lt;br&gt;
&lt;br&gt;
Select your website and double click the Compression icon under the IIS heading.&lt;br&gt;
The Compression page will display check boxes next to Static and Dynamic compression.
Check both these boxes and click apply.&lt;br&gt;
&lt;br&gt;
Finally, to test if your web pages are being served as compressed test them on this
webpage &lt;/span&gt;&lt;span style="font-family: Wingdings;"&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Tahoma;"&gt;&lt;a href="http://www.port80software.com/products/zipenable/compresscheck.asp"&gt;http://www.port80software.com/products/zipenable/compresscheck.asp&lt;/a&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-family: Tahoma;"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-family: Tahoma;"&gt;This website will read the HTTP headers and determine
if your webpage is compressed and give you the exact compressed and uncompressed HTML
values.&lt;br&gt;
&lt;br&gt;
&lt;br style=""&gt;
&lt;!--[if !supportLineBreakNewLine]--&gt;
&lt;br style=""&gt;
&lt;!--[endif]--&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-family: Tahoma;"&gt;
&lt;br&gt;
&lt;br style=""&gt;
&lt;!--[if !supportLineBreakNewLine]--&gt;
&lt;br style=""&gt;
&lt;!--[endif]--&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;
&lt;span style="font-family: Tahoma;"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.know24.net/blog/aggbug.ashx?id=9d0deb4a-fbd1-4d3e-b34c-1459aff66a6a" /&gt;</content>
  </entry>
  <entry>
    <title>ASP.NET Google Product Feed</title>
    <link rel="alternate" type="text/html" href="http://www.know24.net/blog/ASPNET+Google+Product+Feed.aspx" />
    <id>http://www.know24.net/blog/PermaLink,guid,ba7a894d-fd7c-4550-aa2b-d56a6358d65f.aspx</id>
    <published>2010-02-11T17:33:28.865375+02:00</published>
    <updated>2010-02-11T17:33:28.865375+02:00</updated>
    <category term="CSharp / C#" label="CSharp / C#" scheme="http://www.know24.net/blog/CategoryView,category,CSharp%2B%2f%2BC%23.aspx" />
    <category term="VS2008" label="VS2008" scheme="http://www.know24.net/blog/CategoryView,category,VS2008.aspx" />
    <category term="Linq" label="Linq" scheme="http://www.know24.net/blog/CategoryView,category,Linq.aspx" />
    <category term="Xml" label="Xml" scheme="http://www.know24.net/blog/CategoryView,category,Xml.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">My client required a google product feed
representing their store products, so I decided to make use of Linq-to-Xml to generate
the Xml markup and Linq-to-Objects to retrieve my product data.<br />
Initially I had my doubts about using Linq, however, since seeing how efficient and
clean the code was compared to using XPath, I'm now a believer ;)<br /><br />
Here is the code. Copy and paste this into a Test.aspx page.<br />
Note that you'll need an object collection of your products to quickly re-use this
code. This can be a generic List&lt;Product&gt; too.<br />
I've loaded my product collection at the top of the Page_Load event. Replace this
with your own and update the elements with your product collection properties.<br /><br /><pre style="font-size: 11px; font-family: Courier New;"><span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;">&lt;%@
Page Language=<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"C#"</span> AutoEventWireup=<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"true"</span>%&gt;<br />
&lt;%@ Import Namespace=<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"System.Xml"</span>%&gt;<br />
&lt;%@ Import Namespace=<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"System.Linq"</span>%&gt;<br />
&lt;%@ Import Namespace=<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"System.Xml.Linq"</span>%&gt;<br /><br />
&lt;script runat=<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"server"</span>&gt;<br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">protected</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">void</span> Page_Load(<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">object</span> sender,
EventArgs e)<br />
{<br /></span><span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;"><span style="color: Green; background-color: Transparent; font-family: Courier New; font-size: 11px;"> //
load your product collection here</span></span><span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;"><br />
ProductCollection pc <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span> ProductCollection.Load(<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">false</span>);<br /><br />
XNamespace g <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span><span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"http://base.google.com/ns/1.0"</span>;<br /><br />
XDocument doc <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">new</span> XDocument(<br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">new</span> XDeclaration(<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"1.0"</span>, <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">null</span>, <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">null</span>), 
<br /><span style="color: Green; background-color: Transparent; font-family: Courier New; font-size: 11px;">//new
XComment("Sample RSS Feed"),</span><br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">new</span> XElement(<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"rss"</span>,<br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">new</span> XAttribute(<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"version"</span>, <span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"2.0"</span>),<br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">new</span> XAttribute(XNamespace.Xmlns <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">+</span><span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"g"</span>,
g), <span style="color: Green; background-color: Transparent; font-family: Courier New; font-size: 11px;">//"http://base.google.com/ns/1.0"</span><br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">new</span> XElement(<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"channel"</span>,<br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">new</span> XElement(<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"title"</span>,
"eStore Products for XYZ"),<br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">new</span> XElement(<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"link"</span>, <span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"http://"</span><span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">+</span> Request.Url.Host),<br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">new</span> XElement(<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"description"</span>, <span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"Products
available at our store."</span>),<br />
from product <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">in</span> pc<br />
orderby product.Name ascending<br />
select <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">new</span> XElement(<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"item"</span>,<br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">new</span> XElement(<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"title"</span>,
product.Name),<br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">new</span> XElement(<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"link"</span>, <span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"http://"</span><span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">+</span> Request.Url.Host <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">+</span> RouteHelper.Parse(<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"/product.aspx?ProductID="</span><span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">+</span> product.ID)),<br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">new</span> XElement(<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"description"</span>,
product.Description),<br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">new</span> XElement(g <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">+</span><span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"image_link"</span>, <span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"http://"</span><span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">+</span> Request.Url.Host <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">+</span> product.DefaultImage <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">+</span> CustomImage.Get80x80), 
<br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">new</span> XElement(g <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">+</span><span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"price"</span>,
product.Price) 
<br />
) 
<br />
)<br />
)<br />
);<br /><br /></span><span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;"><span style="color: Green; background-color: Transparent; font-family: Courier New; font-size: 11px;"> //
save Xml output to website/app root folder</span></span><br /><span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;"> doc.Save(Server.MapPath(<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"~/"</span>) <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">+</span><span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"products.xml"</span>,
SaveOptions.None);<br /><br /><span style="color: Green; background-color: Transparent; font-family: Courier New; font-size: 11px;">//
debug to html</span><br /><span style="color: Green; background-color: Transparent; font-family: Courier New; font-size: 11px;">//
Response.Write(new XDeclaration("1.0", null, null).ToString() + "\r\n" + doc.ToString());</span><br />
} 
<br />
&lt;/script&gt;</span><br /></pre><br />
Call your Test.aspx page and your Xml will get generated. 
<br />
In case you're confused about the XNamespace, basically we are using this to create
special Google Product Feed Xml element name, but that is a topic for another article.
All we need to know is that its necessary to build elements that contain the colon
(:) character.<br /><br />
Happy coding.<br /><br /><br /><p></p><img width="0" height="0" src="http://www.know24.net/blog/aggbug.ashx?id=ba7a894d-fd7c-4550-aa2b-d56a6358d65f" /></div>
    </content>
  </entry>
</feed>
