<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>DotNet Friends</title>
	<atom:link href="http://amitpatriwala.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://amitpatriwala.wordpress.com</link>
	<description>Amit Patriwala</description>
	<lastBuildDate>Fri, 23 Oct 2009 11:29:38 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='amitpatriwala.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/44c446cc3b78325e084c6ab6861a8b20?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>DotNet Friends</title>
		<link>http://amitpatriwala.wordpress.com</link>
	</image>
			<item>
		<title>HierarchyId Data Type</title>
		<link>http://amitpatriwala.wordpress.com/2009/10/23/hierarchyid-data-type/</link>
		<comments>http://amitpatriwala.wordpress.com/2009/10/23/hierarchyid-data-type/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 11:26:06 +0000</pubDate>
		<dc:creator>patriwala</dc:creator>
				<category><![CDATA[SqlServer]]></category>
		<category><![CDATA[HIERARCHYID Data Type]]></category>
		<category><![CDATA[HIERARCHYID Data Type In Sql Server 2008]]></category>
		<category><![CDATA[How to use SQL Server 2008 hierarchyid data type]]></category>
		<category><![CDATA[new data types in sql server 2008]]></category>
		<category><![CDATA[Working with hierarchyid Data]]></category>

		<guid isPermaLink="false">http://amitpatriwala.wordpress.com/2009/10/23/hierarchyid-data-type/</guid>
		<description><![CDATA[Here I Explained the New Data Type in Sqlserver 2008.
What is HierarchIyd Data Type?&#160; 
HierarchyId data type is a variable length System Data Type.
What is the use of HierarchyId Data Type?
Represent position in a hierarchy manner.
HierarchyId does not automatically represent a tree, it is depend on how to application generate and assign HierarchyId values.
HierarchyId have [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amitpatriwala.wordpress.com&blog=2616360&post=480&subd=amitpatriwala&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><font size="3" face="Times New Roman">Here I Explained the New Data Type in Sqlserver 2008.</font></p>
<p><strong><font size="3" face="Times New Roman">What is HierarchIyd Data Type?&#160; </font></strong></p>
<p><font size="3" face="Times New Roman">HierarchyId data type is a variable length System Data Type.</font></p>
<p><strong><font size="3" face="Times New Roman">What is the use of HierarchyId Data Type?</font></strong></p>
<p><font size="3" face="Times New Roman">Represent position in a hierarchy manner.</font></p>
<p><font size="3" face="Times New Roman">HierarchyId does not automatically represent a tree, it is depend on how to application generate and assign HierarchyId values.</font></p>
<p><strong><font size="3" face="Times New Roman">HierarchyId have following properties:</font></strong></p>
<p><font size="3" face="Times New Roman">1) Extremely Compact</font></p>
<p><font size="3" face="Times New Roman">2) Comparison is in depth-first-order.</font></p>
<p><font size="3" face="Times New Roman">3) Support for arbitrary insertions and deletions.</font></p>
<p><strong><font size="3" face="Times New Roman">Limitation Of HierarchyId :</font></strong></p>
<p><font size="3" face="Times New Roman">1)&#160; Does not automatically represent a Tree</font></p>
<p><font size="3" face="Times New Roman">2) It is up to Application to manage concurrency in generating and assigning HierarchyId Values.</font></p>
<p><font size="3" face="Times New Roman">3) There is no any dependency on HierarchyId relationship.</font></p>
<p>&#160;</p>
<p><font size="3" face="Times New Roman"><strong>See more about HierarchyId example refer :</strong></font></p>
<p><a title="http://amitpatriwala.wordpress.com/2009/10/23/sql-server-2008-feature-part1/" href="http://amitpatriwala.wordpress.com/2009/10/23/sql-server-2008-feature-part1/"><font size="3" face="Times New Roman">http://amitpatriwala.wordpress.com/2009/10/23/sql-server-2008-feature-part1/</font></a></p>
<p><font size="3" face="Times New Roman"><strong>Reference Site :</strong></font></p>
<p><a title="http://technet.microsoft.com/en-us/library/bb677290.aspx" href="http://technet.microsoft.com/en-us/library/bb677290.aspx" target="_blank"><font size="3" face="Times New Roman">http://technet.microsoft.com/en-us/library/bb677290.aspx</font></a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amitpatriwala.wordpress.com/480/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amitpatriwala.wordpress.com/480/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/amitpatriwala.wordpress.com/480/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/amitpatriwala.wordpress.com/480/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/amitpatriwala.wordpress.com/480/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/amitpatriwala.wordpress.com/480/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/amitpatriwala.wordpress.com/480/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/amitpatriwala.wordpress.com/480/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/amitpatriwala.wordpress.com/480/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/amitpatriwala.wordpress.com/480/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amitpatriwala.wordpress.com&blog=2616360&post=480&subd=amitpatriwala&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://amitpatriwala.wordpress.com/2009/10/23/hierarchyid-data-type/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c12ba624e5155b632d14a31227425a46?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">patriwala</media:title>
		</media:content>
	</item>
		<item>
		<title>Sql Server 2008 Feature &#8211; Part1</title>
		<link>http://amitpatriwala.wordpress.com/2009/10/23/sql-server-2008-feature-part1/</link>
		<comments>http://amitpatriwala.wordpress.com/2009/10/23/sql-server-2008-feature-part1/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 09:30:41 +0000</pubDate>
		<dc:creator>patriwala</dc:creator>
				<category><![CDATA[SqlServer]]></category>
		<category><![CDATA[Sql Server 2008]]></category>
		<category><![CDATA[New Features in SQL Server 2008]]></category>
		<category><![CDATA[SQL Server 2008 Overview]]></category>
		<category><![CDATA[Programmability Features in SQL Server 2008]]></category>
		<category><![CDATA[new data types in sql server 2008]]></category>
		<category><![CDATA[New Built-in Data Types in SQL Server 2008]]></category>
		<category><![CDATA[Data Types in SQL Server 2008]]></category>
		<category><![CDATA[HIERARCHYID Data Type]]></category>
		<category><![CDATA[HIERARCHYID Data Type In Sql Server 2008]]></category>

		<guid isPermaLink="false">http://amitpatriwala.wordpress.com/2009/10/23/sql-server-2008-feature-part1/</guid>
		<description><![CDATA[Here I am explaining Sql Server 2008 Key Features.
1) Initializing variable when you declare
declare @val as int =0         declare @currentdate as datetime = getdate()          print @val         print @currentdate
 
2) Compound [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amitpatriwala.wordpress.com&blog=2616360&post=479&subd=amitpatriwala&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><font size="3" face="ar">Here I am explaining Sql Server 2008 Key Features.</font></p>
<p><strong><font size="3" face="ar">1) Initializing variable when you declare</font></strong></p>
<p><font size="3"><font face="ar"><span style="color:blue;">declare </span>@val <span style="color:blue;">as int </span><span style="color:gray;">=</span>0         <br /><span style="color:blue;">declare </span>@currentdate <span style="color:blue;">as datetime </span><span style="color:gray;">= </span><span style="color:magenta;">getdate</span></font></font><font size="3"><font face="ar"><span style="color:gray;">()          <br /></span><span style="color:blue;">print </span>@val         <br /><span style="color:blue;">print </span>@currentdate</font></font></p>
<p> <a href="http://11011.net/software/vspaste"></a>
<p><font size="3"><font face="ar"><strong>2) Compound assignment operators</strong> </font></font></p>
<p><font size="3"><font face="ar"><span style="color:green;">&#8211;operator like +=,-=,/=,*/,%=          <br /></span><span style="color:blue;">declare </span>@val <span style="color:blue;">as int </span><span style="color:gray;">= </span>0         <br /><span style="color:blue;">set </span>@val <span style="color:gray;">+= </span>10</font></font><font size="3"><font face="ar"><span style="color:gray;">;          <br /></span><span style="color:blue;">print </span>@val</font></font></p>
<p><strong><font size="3" face="ar">3) Add multiple row in single Insert Statement </font></strong></p>
<p> <a href="http://11011.net/software/vspaste"></a>
<pre class="code"><font size="3"><font face="ar"><span style="color:blue;">CREATE TABLE </span>Employee
</font></font><font size="3"><font face="ar"><span style="color:gray;">(
</span>EmpId <span style="color:blue;">int</span></font></font><font size="3"><font face="ar"><span style="color:gray;">,
</span>EmpCode <span style="color:blue;">varchar</span><span style="color:gray;">(</span>50</font></font><font size="3"><font face="ar"><span style="color:gray;">),
</span>EmpName <span style="color:blue;">varchar</span><span style="color:gray;">(</span>50</font></font><font size="3"><font face="ar"><span style="color:gray;">)
);

</span><span style="color:blue;">INSERT INTO </span>Employee<span style="color:gray;">(</span>EmpId<span style="color:gray;">, </span>EmpCode<span style="color:gray;">,</span>EmpName</font></font><span style="color:gray;"><font size="3" face="ar">)
  </font></span><font size="3"><font face="ar"><span style="color:blue;">VALUES
  </span><span style="color:gray;">(</span>1<span style="color:gray;">, </span><span style="color:red;">'emp1'</span><span style="color:gray;">,</span><span style="color:red;">'emp1'</span></font></font><font size="3"><font face="ar"><span style="color:gray;">),
  (</span>2<span style="color:gray;">, </span><span style="color:red;">'emp1'</span><span style="color:gray;">,</span><span style="color:red;">'emp1'</span></font></font><font size="3"><font face="ar"><span style="color:gray;">),
  (</span>3<span style="color:gray;">, </span><span style="color:red;">'emp1'</span><span style="color:gray;">,</span><span style="color:red;">'emp1'</span></font></font><font size="3"><font face="ar"><span style="color:gray;">);

</span><span style="color:blue;">select </span><span style="color:gray;">* </span><span style="color:blue;">from </span>Employee</font></font></pre>
<pre class="code"><strong><font size="3" face="ar">4) <font face="Arial">New Data Types</font></font></strong></pre>
<table border="1" cellspacing="0" cellpadding="2" width="475">
<tbody>
<tr>
<td valign="top" width="100"><font size="3">Data Type</font></td>
<td valign="top" width="373"><font size="3">Data Type Use</font></td>
</tr>
<tr>
<td valign="top" width="100"><font size="3">Date</font></td>
<td valign="top" width="373"><font size="3">The Date property returns a Date data type.</font></td>
</tr>
<tr>
<td valign="top" width="100"><font size="3">Time </font></td>
<td valign="top" width="373"><font size="3">Returns values for any valid time of day between 00:00:00 and 23:59:59:9999999. It has a length of at least 8 positions and contains the time in hours,minutes, seconds and fractional seconds.</font></td>
</tr>
<tr>
<td valign="top" width="100"><font size="3">DateTime2</font></td>
<td valign="top" width="373"><font size="3">DateTime2 is an extension of the existing DATETIME type. It has a large date range and large default fractional precision. It has a length of at least 19 positions.</font></td>
</tr>
<tr>
<td valign="top" width="100"><font size="3">DateTimeOffSet</font></td>
<td valign="top" width="373"><font size="3">Returns values for year, month, day, valid time of day between 00:00:00 and 23:59:59:9999999 and offset, in hours, from UTC. It has a length of at least 25 positions.</font></td>
</tr>
<tr>
<td valign="top" width="100"><font size="3">Hierarchyid</font></td>
<td valign="top" width="373"><font size="3">The HierarchyId property is used to identify a position in a hierarchy.</font></td>
</tr>
<tr>
<td valign="top" width="100"><font size="3">Geography</font></td>
<td valign="top" width="373"><font size="3">The SQL Server geography data type stores ellipsoidal (round-earth) data, such as GPS latitude and longitude coordinates</font></td>
</tr>
<tr>
<td valign="top" width="100"><font size="3">Geometry</font></td>
<td valign="top" width="373"><font size="3">The Geometry property contains spatial data that represents information about the physical location and shape of geometric objects.</font></td>
</tr>
</tbody>
</table>
<pre class="code"><strong><font size="3" face="Arial">HierarchyId Data Type</font></strong></pre>
<div id="codeSnippetWrapper">
<div style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0;" id="codeSnippet">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum1">   1:</span> --<span style="color:#0000ff;">Create</span> <span style="color:#0000ff;">Table</span> Employee</font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum2">   2:</span> <span style="color:#0000ff;">CREATE</span> <span style="color:#0000ff;">TABLE</span> Employee</font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum3">   3:</span> (</font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum4">   4:</span> EmpId <span style="color:#0000ff;">int</span>,</font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum5">   5:</span> EmpBossId HIERARCHYID,</font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum6">   6:</span> --GetLevel --&gt; <span style="color:#0000ff;">returns</span> the <span style="color:#0000ff;">level</span> <span style="color:#0000ff;">of</span> the <span style="color:#0000ff;">current</span> node <span style="color:#0000ff;">in</span> the hierarchy</font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum7">   7:</span> EmpLevel <span style="color:#0000ff;">as</span> EmpBossId.GetLevel() PERSISTED,</font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum8">   8:</span> EmpCode <span style="color:#0000ff;">varchar</span>(50),</font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum9">   9:</span> EmpName <span style="color:#0000ff;">varchar</span>(50)</font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum10">  10:</span> );</font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum11">  11:</span> <span style="color:#0000ff;">Go</span></font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum12">  12:</span> <span style="color:#008000;">-- Create Insert Store Procedure</span></font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum13">  13:</span> <span style="color:#0000ff;">Alter</span> <span style="color:#0000ff;">PROCEDURE</span> Employee_isp</font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum14">  14:</span>     @empid <span style="color:#0000ff;">int</span>,</font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum15">  15:</span>     @empbossid <span style="color:#0000ff;">int</span>,</font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum16">  16:</span>     @empcode <span style="color:#0000ff;">varchar</span>(50),</font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum17">  17:</span>     @empname <span style="color:#0000ff;">varchar</span>(50)</font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum18">  18:</span> <span style="color:#0000ff;">AS</span></font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum19">  19:</span> <span style="color:#0000ff;">BEGIN</span></font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum20">  20:</span> <span style="color:#0000ff;">declare</span> @hid HIERARCHYID,@empboss_hid HIERARCHYID,@last_hid HIERARCHYID</font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum21">  21:</span>&#160; </font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum22">  22:</span> <span style="color:#0000ff;">if</span> @empbossid = 0 </font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum23">  23:</span> <span style="color:#0000ff;">begin</span></font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum24">  24:</span>     <span style="color:#0000ff;">set</span> @hid = HIERARCHYID::GetRoot();</font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum25">  25:</span> <span style="color:#0000ff;">end</span> </font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum26">  26:</span> <span style="color:#0000ff;">else</span> </font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum27">  27:</span> <span style="color:#0000ff;">begin</span></font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum28">  28:</span>   </font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum29">  29:</span>   <span style="color:#0000ff;">SET</span> @empboss_hid = (<span style="color:#0000ff;">SELECT</span> EmpBossId <span style="color:#0000ff;">FROM</span> Employee  <span style="color:#0000ff;">WHERE</span> empid = @empbossid);</font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum30">  30:</span>   <span style="color:#0000ff;">SET</span> @last_hid = (<span style="color:#0000ff;">SELECT</span> <span style="color:#0000ff;">MAX</span>(EmpBossId) <span style="color:#0000ff;">FROM</span> Employee <span style="color:#0000ff;">WHERE</span> EmpBossId.GetAncestor(1)= @empboss_hid);</font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum31">  31:</span>   <span style="color:#0000ff;">SET</span> @hid = @empboss_hid.GetDescendant(@last_hid, <span style="color:#0000ff;">NULL</span>);</font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum32">  32:</span> <span style="color:#0000ff;">end</span></font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum33">  33:</span> INSERT <span style="color:#0000ff;">INTO</span> Employee(empid, EmpBossId, EmpCode, EmpName)</font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum34">  34:</span>             <span style="color:#0000ff;">VALUES</span>(@empid, @hid, @empcode, @empname);</font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum35">  35:</span> <span style="color:#0000ff;">END</span></font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum36">  36:</span> <span style="color:#0000ff;">GO</span></font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum37">  37:</span> --insert <span style="color:#0000ff;">data</span></font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum38">  38:</span> <span style="color:#008000;">--                     A1</span></font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum39">  39:</span> <span style="color:#008000;">--                AL1           AR1</span></font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum40">  40:</span> <span style="color:#008000;">--           AL1L     AL1R  AR1L   AR1R  </span></font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum41">  41:</span> <span style="color:#008000;">--</span></font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum42">  42:</span> <span style="color:#008000;">--</span></font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum43">  43:</span> <span style="color:#0000ff;">EXEC</span> Employee_isp @empid =  1, @empbossid = 0, @empcode = <span style="color:#006080;">'A1'</span> ,@empname = <span style="color:#006080;">'A1'</span>;</font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum44">  44:</span> <span style="color:#0000ff;">EXEC</span> Employee_isp @empid =  2, @empbossid = 1, @empcode = <span style="color:#006080;">'AL1'</span> ,@empname = <span style="color:#006080;">'AL1'</span>;</font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum45">  45:</span> <span style="color:#0000ff;">EXEC</span> Employee_isp @empid =  3, @empbossid = 1, @empcode = <span style="color:#006080;">'AR1'</span> ,@empname = <span style="color:#006080;">'AR1'</span>;</font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum46">  46:</span> <span style="color:#0000ff;">EXEC</span> Employee_isp @empid =  4, @empbossid = 2, @empcode = <span style="color:#006080;">'AL1L'</span> ,@empname = <span style="color:#006080;">'AL1L'</span>;</font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum47">  47:</span> <span style="color:#0000ff;">EXEC</span> Employee_isp @empid =  5, @empbossid = 2, @empcode = <span style="color:#006080;">'AL1R'</span> ,@empname = <span style="color:#006080;">'AL1R'</span>;</font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum48">  48:</span> <span style="color:#0000ff;">EXEC</span> Employee_isp @empid =  6, @empbossid = 3, @empcode = <span style="color:#006080;">'AR1L'</span> ,@empname = <span style="color:#006080;">'AR1L'</span>;</font></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="3"><font face="ar"><span style="color:#606060;" id="lnum49">  49:</span> <span style="color:#0000ff;">EXEC</span> Employee_isp @empid =  7, @empbossid = 3, @empcode = <span style="color:#006080;">'AR1R'</span> ,@empname = <span style="color:#006080;">'AR1R'</span>;</font></font></pre>
<p><!--CRLF--></div>
</div>
<pre class="code"><strong><font size="3" face="ar"></font></strong></pre>
<pre class="code"><strong><font size="3" face="ar">Inserted Data Into Table </font></strong></pre>
<pre class="code"><a href="http://amitpatriwala.files.wordpress.com/2009/10/hierarchyid.jpg"><font size="3" face="ar"><img style="display:inline;border-width:0;" title="HIERARCHYID" border="0" alt="HIERARCHYID" src="http://amitpatriwala.files.wordpress.com/2009/10/hierarchyid_thumb.jpg?w=644&#038;h=232" width="644" height="232" /></font></a><font size="3" face="ar"> </font></pre>
<pre class="code"><strong><font size="3" face="ar">Different Selection Criteria :</font></strong></pre>
<pre class="code"><strong><font size="3" face="ar">1) Find Employee As Per their Level means Grade </font></strong></pre>
<pre class="code"><font size="3"><font face="ar"><span style="color:blue;">   select </span><span style="color:gray;">* </span><span style="color:blue;">from </span>Employee <span style="color:blue;">where </span>Emplevel <span style="color:gray;">= </span>2</font></font></pre>
<pre class="code"><font size="3" face="ar">2) Get Child Node </font></pre>
<div align="center">
<pre class="code"><font size="3"><font face="ar"><span style="color:blue;">   SELECT </span>Child<span style="color:gray;">.</span>empid<span style="color:gray;">, </span>Child<span style="color:gray;">.</span>empname <span style="color:blue;">FROM </span>Employee <span style="color:blue;">AS </span>Parent <span style="color:gray;">JOIN </span>Employee <span style="color:blue;">AS </span>Child
          <span style="color:blue;">ON </span>Parent<span style="color:gray;">.</span>empid <span style="color:gray;">= </span>2 <span style="color:gray;">AND </span>child<span style="color:gray;">.</span>empbossid<span style="color:gray;">.</span>IsDescendantOf<span style="color:gray;">(</span>Parent<span style="color:gray;">.</span>empbossid<span style="color:gray;">) = </span>1<span style="color:gray;">;</span></font></font></pre>
</div>
<div align="left">
<pre class="code"><span style="color:gray;"><font size="3" face="ar">3) Get Parent Node</font></span></pre>
</div>
<pre class="code"><font size="3"><font face="ar"><span style="color:blue;">SELECT </span>parent<span style="color:gray;">.</span>empid<span style="color:gray;">, </span>parent<span style="color:gray;">.</span>empname
<span style="color:blue;">  FROM </span>Employee <span style="color:blue;">AS </span>Parent <span style="color:gray;">JOIN </span>Employee <span style="color:blue;">AS </span>Child
    <span style="color:blue;">ON </span>child<span style="color:gray;">.</span>empid <span style="color:gray;">= </span>4 <span style="color:gray;">AND </span>child<span style="color:gray;">.</span>empbossid<span style="color:gray;">.</span>IsDescendantOf<span style="color:gray;">(</span>Parent<span style="color:gray;">.</span>empbossid<span style="color:gray;">) = </span>1<span style="color:gray;">;</span></font></font></pre>
<pre class="code"><font color="#000000" size="3" face="Times New Roman"><span style="color:black;"><strong>more on HierarchyId Data Types refer:</strong></span></font></pre>
<pre class="code"><font size="3" face="Times New Roman"><a title="http://amitpatriwala.wordpress.com/2009/10/23/hierarchyid-data-type/" href="http://amitpatriwala.wordpress.com/2009/10/23/hierarchyid-data-type/" target="_blank">http://amitpatriwala.wordpress.com/2009/10/23/hierarchyid-data-type/</a></font></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<pre class="code"><strong><font size="3" face="Arial"><strong><font size="3" face="ar">5) Introduced New Functions</font></strong></font></strong></pre>
<table border="1" cellspacing="0" cellpadding="2" width="472">
<tbody>
<tr>
<td valign="top" width="139"><font size="3">Function Name</font></td>
<td valign="top" width="331"><font size="3">Function Use</font></td>
</tr>
<tr>
<td valign="top" width="139"><font size="3">SYSDATETIME</font></td>
<td valign="top" width="331"><font size="3">Returns current date and time as <strong>DateTime2</strong> value. </font></td>
</tr>
<tr>
<td valign="top" width="139"><font size="3">SYSUTCDATETIME</font></td>
<td valign="top" width="331"><font size="3">Returns current date and time in UTC as <strong>DateTime2</strong> value</font></td>
</tr>
<tr>
<td valign="top" width="139"><font size="3">SYSDATETIMEOFFSET</font></td>
<td valign="top" width="331"><font size="3">Returns current date and time along with the system time zone as a DATETIMEOFFSET value</font></td>
</tr>
<tr>
<td valign="top" width="139"><font size="3">SWITCHOFFSET</font></td>
<td valign="top" width="331"><font size="3">Adjusts an input DATETIMEOFFSET value to a specified time zone, while preserving the UTC value. </font></p>
<p><font size="3">For example, the following code adjusts the current system datetimeoffset value to time zone GMT +05:00: </font></p>
<p><strong><font size="3">SELECT SWITCHOFFSET(SYSDATETIMEOFFSET(), &#8216;-05:00&#8242;);</font></strong></p>
</td>
</tr>
<tr>
<td valign="top" width="139"><font size="3">TODATETIMEOFFSET</font></td>
<td valign="top" width="331"><font size="3">sets the time zone offset of an input date and time value</font></td>
</tr>
</tbody>
</table>
<pre class="code"><strong><font size="3" face="Arial"><strong><font size="3" face="ar">6) Support Large User Define Types [UDT]</font></strong></font></strong></pre>
<pre class="code"><font size="3"><font face="ar"><strong>Sql Server 2008 supports large UDT,large UDTs can now reach up to </strong><strong>2 GB in size.</strong></font></font></pre>
<pre class="code"><font size="3" face="ar">&#160;</font></pre>
<pre class="code"><strong><font size="3" face="ar">Reference Sites: </font></strong></pre>
<pre class="code"><a title="http://technet.microsoft.com/en-us/library/cc721270.aspx" href="http://technet.microsoft.com/en-us/library/cc721270.aspx" target="_blank"><font size="3" face="ar">http://technet.microsoft.com/en-us/library/cc721270.aspx</font></a></pre>
<p><font size="3" face="ar"></font></p>
<p><font size="3" face="ar"></font></p>
<p><font size="3" face="ar"></font></p>
<p><font size="3" face="ar"></font></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amitpatriwala.wordpress.com/479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amitpatriwala.wordpress.com/479/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/amitpatriwala.wordpress.com/479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/amitpatriwala.wordpress.com/479/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/amitpatriwala.wordpress.com/479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/amitpatriwala.wordpress.com/479/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/amitpatriwala.wordpress.com/479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/amitpatriwala.wordpress.com/479/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/amitpatriwala.wordpress.com/479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/amitpatriwala.wordpress.com/479/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amitpatriwala.wordpress.com&blog=2616360&post=479&subd=amitpatriwala&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://amitpatriwala.wordpress.com/2009/10/23/sql-server-2008-feature-part1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c12ba624e5155b632d14a31227425a46?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">patriwala</media:title>
		</media:content>

		<media:content url="http://amitpatriwala.files.wordpress.com/2009/10/hierarchyid_thumb.jpg" medium="image">
			<media:title type="html">HIERARCHYID</media:title>
		</media:content>
	</item>
		<item>
		<title>URL rewriting in asp.net</title>
		<link>http://amitpatriwala.wordpress.com/2009/10/02/url-rewriting-in-asp-net/</link>
		<comments>http://amitpatriwala.wordpress.com/2009/10/02/url-rewriting-in-asp-net/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 13:28:13 +0000</pubDate>
		<dc:creator>patriwala</dc:creator>
				<category><![CDATA[Asp.Net 2.0]]></category>
		<category><![CDATA[dotnet]]></category>
		<category><![CDATA[BrowserFile in asp.net]]></category>
		<category><![CDATA[ControlAdapter]]></category>
		<category><![CDATA[Handling ASP.NET PostBacks with URL Rewriting]]></category>
		<category><![CDATA[IHttpModule]]></category>
		<category><![CDATA[Rewrite URL in asp.net]]></category>
		<category><![CDATA[Use of BrowserFile.browser in asp.net]]></category>
		<category><![CDATA[what is URL rewriting ?]]></category>
		<category><![CDATA[why URL rewriting?]]></category>

		<guid isPermaLink="false">http://amitpatriwala.wordpress.com/2009/10/02/url-rewriting-in-asp-net/</guid>
		<description><![CDATA[what is URL rewriting ?
URL rewriting is the process of intercepting an incoming Web request and redirecting the request to a different resource. When performing URL rewriting, typically the URL being requested is checked and, based on its value, the request is redirected to a different URL.
http://msdn.microsoft.com/en-us/library/ms972974.aspx&#160;
why URL rewriting?
1) Make User Friendly and Secure URL
Example [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amitpatriwala.wordpress.com&blog=2616360&post=474&subd=amitpatriwala&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><strong><font size="2">what is URL rewriting ?</font></strong></p>
<p><font size="2">URL rewriting is the process of intercepting an incoming Web request and redirecting the request to a different resource. When performing URL rewriting, typically the URL being requested is checked and, based on its value, the request is redirected to a different URL.</font></p>
<p><a title="http://msdn.microsoft.com/en-us/library/ms972974.aspx" href="http://msdn.microsoft.com/en-us/library/ms972974.aspx" target="_blank"><font size="2">http://msdn.microsoft.com/en-us/library/ms972974.aspx</font></a><font size="2">&#160;</font></p>
<p><strong><font size="2">why URL rewriting?</font></strong></p>
<p><font size="2">1) Make User Friendly and Secure URL</font></p>
<p><font size="2">Example :&#160; In your application, you create a page which display category information and it’s relevant category. At that time we normally passing a value via query string,</font></p>
<p><a href="http://Site.com/category.aspx?categoryid=1" target="_blank"><font size="2">http://Site.com/category.aspx?categoryid=1</font></a><font size="2">. Any user play with URL, you can also do the URL Encryption. but sometime case is complex at that time it is not possible.</font></p>
<p><font size="2">2) Make SEO Friendly URL</font></p>
<p><font size="2">3) Usability &amp; Maintainability</font></p>
<p><strong><font size="2">Use Of Browser file?</font></strong></p>
<p><font size="2">ASP.NET uses .browser files to determine the capabilities of the browser, and how to render markup to that browser.</font></p>
<p><font size="2">Browser files are used to reduce the load of the page made by the view state by storing it in a server side session variable.</font></p>
<p><font size="2">In particular Rewriting Module: <strong>Handling Post back with URL Rewriting.</strong></font></p>
<p><strong><font size="2">what is ControlAdapter?</font></strong></p>
<p><strong><font size="2">for more detail please check :</font></strong></p>
<h6><a title="http://msdn.microsoft.com/en-us/library/system.web.ui.adapters.controladapter.aspx" href="http://msdn.microsoft.com/en-us/library/system.web.ui.adapters.controladapter.aspx" target="_blank"><font size="2">http://msdn.microsoft.com/en-us/library/system.web.ui.adapters.controladapter.aspx</font></a></h6>
<p><font size="2">Create demo project for URL Rewriting:</font></p>
<p><font size="2">Step 1: </font></p>
<p><font size="2">Create Web application with (Asp.net 2.0 with c#)</font></p>
<p><font size="2">Step 2:</font></p>
<p><font size="2">Put two button in the form (default.aspx)</font></p>
<p><font size="2">Put Below code for Button1_Click Event :</font></p>
<p><font size="2">Response.Redirect(&quot;Default.aspx?id=1&quot;);</font></p>
<p><font size="2">Put Below code for Button2 _Click Event:</font></p>
<p><font size="2">Response.Redirect(&quot;/urlrewriting/FirstSection/Default.html&quot;);</font></p>
<p><font size="2">Step 3: Run Application</font></p>
<p><font size="2">once you press Button2 it give Error page.</font></p>
<p><font size="2">Step 4: </font></p>
<p><font size="2">Create Class FormRewriterControlAdapter.cs</font></p>
<div style="border-bottom:silver 1px solid;text-align:left;border-left:silver 1px solid;line-height:12pt;background-color:#f4f4f4;width:97.5%;font-family:&#39;direction:ltr;max-height:200px;font-size:8pt;overflow:auto;border-top:silver 1px solid;cursor:text;border-right:silver 1px solid;margin:20px 0 10px;padding:4px;" id="codeSnippetWrapper">
<div style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0;" id="codeSnippet">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum1">   1:</span> <span style="color:#0000ff;">using</span> System;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum2">   2:</span> <span style="color:#0000ff;">using</span> System.Data;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum3">   3:</span> <span style="color:#0000ff;">using</span> System.Configuration;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum4">   4:</span> <span style="color:#0000ff;">using</span> System.Web;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum5">   5:</span> <span style="color:#0000ff;">using</span> System.Web.Security;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum6">   6:</span> <span style="color:#0000ff;">using</span> System.Web.UI;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum7">   7:</span> <span style="color:#0000ff;">using</span> System.Web.UI.WebControls;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum8">   8:</span> <span style="color:#0000ff;">using</span> System.Web.UI.WebControls.WebParts;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum9">   9:</span> <span style="color:#0000ff;">using</span> System.Web.UI.HtmlControls;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum10">  10:</span>&#160; </font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum11">  11:</span> <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">class</span> FormRewriterControlAdapter : System.Web.UI.Adapters.ControlAdapter</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum12">  12:</span> {</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum13">  13:</span>     <span style="color:#0000ff;">protected</span> <span style="color:#0000ff;">override</span> <span style="color:#0000ff;">void</span> Render(HtmlTextWriter writer)</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum14">  14:</span>     {</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum15">  15:</span>         <span style="color:#0000ff;">base</span>.Render(<span style="color:#0000ff;">new</span> RewriteFormHtmlTextWriter(writer));</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum16">  16:</span>     }</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum17">  17:</span> }</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum18">  18:</span>&#160; </font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum19">  19:</span> <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">class</span> RewriteFormHtmlTextWriter : HtmlTextWriter</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum20">  20:</span> {</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum21">  21:</span>     <span style="color:#0000ff;">public</span> RewriteFormHtmlTextWriter(HtmlTextWriter writer)</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum22">  22:</span>         : <span style="color:#0000ff;">base</span>(writer)</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum23">  23:</span>     {</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum24">  24:</span>         <span style="color:#0000ff;">this</span>.InnerWriter = writer.InnerWriter;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum25">  25:</span>     }</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum26">  26:</span>&#160; </font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum27">  27:</span>     <span style="color:#0000ff;">public</span> RewriteFormHtmlTextWriter(System.IO.TextWriter writer)</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum28">  28:</span>         : <span style="color:#0000ff;">base</span>(writer)</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum29">  29:</span>     {</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum30">  30:</span>         <span style="color:#0000ff;">base</span>.InnerWriter = writer;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum31">  31:</span>     }</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum32">  32:</span>&#160; </font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum33">  33:</span>     <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">override</span> <span style="color:#0000ff;">void</span> WriteAttribute(<span style="color:#0000ff;">string</span> name, <span style="color:#0000ff;">string</span> <span style="color:#0000ff;">value</span>, <span style="color:#0000ff;">bool</span> fEncode)</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum34">  34:</span>     {</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum35">  35:</span>         <span style="color:#0000ff;">if</span> (name == <span style="color:#006080;">&quot;action&quot;</span>)</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum36">  36:</span>         {</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum37">  37:</span>             HttpContext Context = HttpContext.Current;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum38">  38:</span>             <span style="color:#0000ff;">if</span> (Context.Items[<span style="color:#006080;">&quot;ActionAlreadyWritten&quot;</span>] == <span style="color:#0000ff;">null</span>)</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum39">  39:</span>             {</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum40">  40:</span>                 <span style="color:#0000ff;">value</span> = Context.Request.RawUrl;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum41">  41:</span>                 Context.Items[<span style="color:#006080;">&quot;ActionAlreadyWritten&quot;</span>] = <span style="color:#0000ff;">true</span>;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum42">  42:</span>             }</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum43">  43:</span>         }</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum44">  44:</span>         <span style="color:#0000ff;">base</span>.WriteAttribute(name, <span style="color:#0000ff;">value</span>, fEncode);</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum45">  45:</span>     }</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum46">  46:</span> } </font></pre>
<p><!--CRLF--></div>
</div>
<p><font size="2">&#160;</font></p>
<p><font size="2">Create Class MyHttpHandler.cs</font></p>
<div style="border-bottom:silver 1px solid;text-align:left;border-left:silver 1px solid;line-height:12pt;background-color:#f4f4f4;width:97.5%;font-family:&#39;direction:ltr;max-height:200px;font-size:8pt;overflow:auto;border-top:silver 1px solid;cursor:text;border-right:silver 1px solid;margin:20px 0 10px;padding:4px;" id="codeSnippetWrapper">
<div style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0;" id="codeSnippet">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum1">   1:</span> <span style="color:#0000ff;">using</span> System;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum2">   2:</span> <span style="color:#0000ff;">using</span> System.Data;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum3">   3:</span> <span style="color:#0000ff;">using</span> System.Configuration;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum4">   4:</span> <span style="color:#0000ff;">using</span> System.Web;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum5">   5:</span> <span style="color:#0000ff;">using</span> System.Web.Security;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum6">   6:</span> <span style="color:#0000ff;">using</span> System.Web.UI;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum7">   7:</span> <span style="color:#0000ff;">using</span> System.Web.UI.WebControls;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum8">   8:</span> <span style="color:#0000ff;">using</span> System.Web.UI.WebControls.WebParts;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum9">   9:</span> <span style="color:#0000ff;">using</span> System.Web.UI.HtmlControls;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum10">  10:</span>&#160; </font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum11">  11:</span> <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">class</span> MyHttpHandler : IHttpModule</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum12">  12:</span>&#160; </font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum13">  13:</span> {</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum14">  14:</span>     <span style="color:#0000ff;">public</span> MyHttpHandler()</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum15">  15:</span>     {</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum16">  16:</span>         <span style="color:#008000;">//</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum17">  17:</span>         <span style="color:#008000;">// TODO: Add constructor logic here</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum18">  18:</span>         <span style="color:#008000;">//</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum19">  19:</span>     }</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum20">  20:</span>&#160; </font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum21">  21:</span>     <span style="color:#cc6633;">#region</span> IHttpModule Members</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum22">  22:</span>&#160; </font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum23">  23:</span>     <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">void</span> Dispose()</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum24">  24:</span>     {</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum25">  25:</span>        </font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum26">  26:</span>     }</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum27">  27:</span>&#160; </font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum28">  28:</span>     <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">void</span> Init(HttpApplication app)</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum29">  29:</span>     {</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum30">  30:</span>         app.BeginRequest += <span style="color:#0000ff;">new</span> EventHandler(Application_BeginRequest);</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum31">  31:</span>     }</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum32">  32:</span>&#160; </font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum33">  33:</span>     <span style="color:#0000ff;">private</span> <span style="color:#0000ff;">void</span> Application_BeginRequest(<span style="color:#0000ff;">object</span> sender, EventArgs e)</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum34">  34:</span>     {</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum35">  35:</span>         System.Web.HttpApplication app = (System.Web.HttpApplication)sender;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum36">  36:</span>         <span style="color:#0000ff;">string</span> requestedUrl = app.Request.Path.ToLower();</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum37">  37:</span>         <span style="color:#0000ff;">string</span> realUrl = GetRealUrl(requestedUrl);</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum38">  38:</span>         <span style="color:#0000ff;">if</span> (!String.IsNullOrEmpty(realUrl))</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum39">  39:</span>             app.Context.RewritePath(realUrl, <span style="color:#0000ff;">false</span>);</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum40">  40:</span>     }</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum41">  41:</span>&#160; </font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum42">  42:</span>     <span style="color:#0000ff;">private</span> <span style="color:#0000ff;">string</span> GetRealUrl(<span style="color:#0000ff;">string</span> requestedUrl)</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum43">  43:</span>     {</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum44">  44:</span>         <span style="color:#008000;">// Implement your own logic here</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum45">  45:</span>         MyURL obj = <span style="color:#0000ff;">new</span> MyURL();</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum46">  46:</span>         <span style="color:#0000ff;">return</span> obj.GetRealPath(requestedUrl);</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum47">  47:</span>     } </font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum48">  48:</span>     <span style="color:#cc6633;">#endregion</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum49">  49:</span> }</font></pre>
<p><!--CRLF--></div>
</div>
<p><font size="2">&#160;</font></p>
<p><font size="2">create Class MyURL.cs</font></p>
<div style="border-bottom:silver 1px solid;text-align:left;border-left:silver 1px solid;line-height:12pt;background-color:#f4f4f4;width:97.5%;font-family:&#39;direction:ltr;max-height:200px;font-size:8pt;overflow:auto;border-top:silver 1px solid;cursor:text;border-right:silver 1px solid;margin:20px 0 10px;padding:4px;" id="codeSnippetWrapper">
<div style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0;" id="codeSnippet">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum1">   1:</span>&#160; </font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum2">   2:</span> <span style="color:#0000ff;">using</span> System;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum3">   3:</span> <span style="color:#0000ff;">using</span> System.Data;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum4">   4:</span> <span style="color:#0000ff;">using</span> System.Configuration;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum5">   5:</span> <span style="color:#0000ff;">using</span> System.Web;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum6">   6:</span> <span style="color:#0000ff;">using</span> System.Web.Security;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum7">   7:</span> <span style="color:#0000ff;">using</span> System.Web.UI;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum8">   8:</span> <span style="color:#0000ff;">using</span> System.Web.UI.WebControls;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum9">   9:</span> <span style="color:#0000ff;">using</span> System.Web.UI.WebControls.WebParts;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum10">  10:</span> <span style="color:#0000ff;">using</span> System.Web.UI.HtmlControls;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum11">  11:</span> <span style="color:#0000ff;">using</span> System.Collections.Generic;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum12">  12:</span>&#160; </font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum13">  13:</span> <span style="color:#008000;">/// &lt;summary&gt;</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum14">  14:</span> <span style="color:#008000;">/// Summary description for MyURL</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum15">  15:</span> <span style="color:#008000;">/// &lt;/summary&gt;</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum16">  16:</span> <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">class</span> MyURL</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum17">  17:</span> {</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum18">  18:</span>     <span style="color:#0000ff;">public</span> MyURL()</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum19">  19:</span>     {</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum20">  20:</span>         <span style="color:#008000;">//</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum21">  21:</span>         <span style="color:#008000;">// TODO: Add constructor logic here</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum22">  22:</span>         <span style="color:#008000;">//</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum23">  23:</span>     }</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum24">  24:</span>&#160; </font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum25">  25:</span>     <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">string</span> GetRealPath(<span style="color:#0000ff;">string</span> requestedUrl)</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum26">  26:</span>     {</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum27">  27:</span>         <span style="color:#0000ff;">string</span> path = <span style="color:#006080;">&quot;&quot;</span>;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum28">  28:</span>         Dictionary&lt;<span style="color:#0000ff;">string</span>, <span style="color:#0000ff;">string</span>&gt; paths = GetPathsFromDatabase();</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum29">  29:</span>         <span style="color:#0000ff;">if</span> (paths.ContainsKey(requestedUrl))</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum30">  30:</span>             paths.TryGetValue(requestedUrl, <span style="color:#0000ff;">out</span> path);</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum31">  31:</span>         <span style="color:#0000ff;">return</span> path;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum32">  32:</span>     }</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum33">  33:</span>&#160; </font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum34">  34:</span>     <span style="color:#0000ff;">private</span> <span style="color:#0000ff;">static</span> Dictionary&lt;<span style="color:#0000ff;">string</span>, <span style="color:#0000ff;">string</span>&gt; GetPathsFromDatabase()</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum35">  35:</span>     {</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum36">  36:</span>         Dictionary&lt;<span style="color:#0000ff;">string</span>, <span style="color:#0000ff;">string</span>&gt; paths = <span style="color:#0000ff;">new</span> Dictionary&lt;<span style="color:#0000ff;">string</span>, <span style="color:#0000ff;">string</span>&gt;();</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum37">  37:</span>         paths.Add(<span style="color:#006080;">&quot;/urlrewriting/FirstSection/Default.html&quot;</span>.ToLower(), <span style="color:#006080;">&quot;/urlrewriting/Default.aspx?SectionID=1&quot;</span>);</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum38">  38:</span>         paths.Add(<span style="color:#006080;">&quot;/urlrewriting/SecondSection/Default.aspx&quot;</span>.ToLower(), <span style="color:#006080;">&quot;/urlrewriting/Default.aspx?SectionID=2&quot;</span>);</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum39">  39:</span>         paths.Add(<span style="color:#006080;">&quot;/urlrewriting/FirstSection/Page1.aspx&quot;</span>.ToLower(), <span style="color:#006080;">&quot;/urlrewriting/Default.aspx?SectionID=1&amp;Item=1&quot;</span>);</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum40">  40:</span>         paths.Add(<span style="color:#006080;">&quot;/urlrewriting/FirstSection/Page2.aspx&quot;</span>.ToLower(), <span style="color:#006080;">&quot;/urlrewriting/Default.aspx?SectionID=1&amp;Item=2&quot;</span>);</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum41">  41:</span>         paths.Add(<span style="color:#006080;">&quot;/urlrewriting/SecondSection/Page1.aspx&quot;</span>.ToLower(), <span style="color:#006080;">&quot;/urlrewriting/Default.aspx?SectionID=2&amp;Item=1&quot;</span>);</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum42">  42:</span>         paths.Add(<span style="color:#006080;">&quot;/urlrewriting/SecondSection/SubSection/AnotherOne/Page5.aspx&quot;</span>.ToLower(), <span style="color:#006080;">&quot;/urlrewriting/Default.aspx?SectionID=2&amp;Item=5&quot;</span>);</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum43">  43:</span>         paths.Add(<span style="color:#006080;">&quot;/urlrewriting/Default.aspx&quot;</span>.ToLower(), <span style="color:#006080;">&quot;/urlrewriting/Default.aspx&quot;</span>);</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum44">  44:</span>         <span style="color:#0000ff;">return</span> paths;</font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum45">  45:</span>     } </font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum46">  46:</span> }</font></pre>
<p><!--CRLF--></div>
</div>
<p><font size="2">Register Http Handler in to Web.Config </font></p>
<div style="border-bottom:silver 1px solid;text-align:left;border-left:silver 1px solid;line-height:12pt;background-color:#f4f4f4;width:97.5%;font-family:&#39;direction:ltr;max-height:200px;font-size:8pt;overflow:auto;border-top:silver 1px solid;cursor:text;border-right:silver 1px solid;margin:20px 0 10px;padding:4px;" id="codeSnippetWrapper">
<div style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0;" id="codeSnippet">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum1">   1:</span> <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">system.web</span><span style="color:#0000ff;">&gt;</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum2">   2:</span>         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">httpModules</span><span style="color:#0000ff;">&gt;</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum3">   3:</span>             <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">add</span> <span style="color:#ff0000;">name</span><span style="color:#0000ff;">=&quot;MyHttpHandler&quot;</span> <span style="color:#ff0000;">type</span><span style="color:#0000ff;">=&quot;MyHttpHandler&quot;</span><span style="color:#0000ff;">/&gt;</span></font></pre>
<p><!--CRLF--></div>
</div>
<p><font size="2">.Browser File</font></p>
<p><font size="2">Add New .browser file from Add New Item.</font></p>
<div style="border-bottom:silver 1px solid;text-align:left;border-left:silver 1px solid;line-height:12pt;background-color:#f4f4f4;width:97.5%;font-family:&#39;direction:ltr;max-height:200px;font-size:8pt;overflow:auto;border-top:silver 1px solid;cursor:text;border-right:silver 1px solid;margin:20px 0 10px;padding:4px;" id="codeSnippetWrapper">
<div style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0;" id="codeSnippet">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum1">   1:</span> <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">browsers</span><span style="color:#0000ff;">&gt;</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum2">   2:</span>     <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">browser</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">=&quot;NewBrowser&quot;</span> <span style="color:#ff0000;">parentID</span><span style="color:#0000ff;">=&quot;Mozilla&quot;</span><span style="color:#0000ff;">&gt;</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum3">   3:</span>         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">identification</span><span style="color:#0000ff;">&gt;</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum4">   4:</span>             <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">userAgent</span> <span style="color:#ff0000;">match</span><span style="color:#0000ff;">=&quot;Unique User Agent Regular Expression&quot;</span> <span style="color:#0000ff;">/&gt;</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum5">   5:</span>         <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">identification</span><span style="color:#0000ff;">&gt;</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum6">   6:</span>&#160; </font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum7">   7:</span>         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">capture</span><span style="color:#0000ff;">&gt;</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum8">   8:</span>             <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">userAgent</span> <span style="color:#ff0000;">match</span><span style="color:#0000ff;">=&quot;NewBrowser (?'version'\d+\.\d+)&quot;</span> <span style="color:#0000ff;">/&gt;</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum9">   9:</span>         <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">capture</span><span style="color:#0000ff;">&gt;</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum10">  10:</span>&#160; </font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum11">  11:</span>         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">capabilities</span><span style="color:#0000ff;">&gt;</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum12">  12:</span>             <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">capability</span> <span style="color:#ff0000;">name</span><span style="color:#0000ff;">=&quot;browser&quot;</span> <span style="color:#ff0000;">value</span><span style="color:#0000ff;">=&quot;My New Browser&quot;</span> <span style="color:#0000ff;">/&gt;</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum13">  13:</span>             <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">capability</span> <span style="color:#ff0000;">name</span><span style="color:#0000ff;">=&quot;version&quot;</span> <span style="color:#ff0000;">value</span><span style="color:#0000ff;">=&quot;${version}&quot;</span> <span style="color:#0000ff;">/&gt;</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum14">  14:</span>         <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">capabilities</span><span style="color:#0000ff;">&gt;</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum15">  15:</span>     <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">browser</span><span style="color:#0000ff;">&gt;</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum16">  16:</span>&#160; </font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum17">  17:</span>     <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">browser</span> <span style="color:#ff0000;">refID</span><span style="color:#0000ff;">=&quot;Mozilla&quot;</span><span style="color:#0000ff;">&gt;</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum18">  18:</span>         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">capabilities</span><span style="color:#0000ff;">&gt;</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum19">  19:</span>             <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">capability</span> <span style="color:#ff0000;">name</span><span style="color:#0000ff;">=&quot;xml&quot;</span> <span style="color:#ff0000;">value</span><span style="color:#0000ff;">=&quot;true&quot;</span> <span style="color:#0000ff;">/&gt;</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum20">  20:</span>         <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">capabilities</span><span style="color:#0000ff;">&gt;</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum21">  21:</span>     <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">browser</span><span style="color:#0000ff;">&gt;</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum22">  22:</span> <span style="color:#008000;">&lt;!--FormRewrite Control Adapter--&gt;</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum23">  23:</span>     <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">browser</span> <span style="color:#ff0000;">refID</span><span style="color:#0000ff;">=&quot;Default&quot;</span><span style="color:#0000ff;">&gt;</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum24">  24:</span>         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">controlAdapters</span><span style="color:#0000ff;">&gt;</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum25">  25:</span>             <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">adapter</span> <span style="color:#ff0000;">controlType</span><span style="color:#0000ff;">=&quot;System.Web.UI.HtmlControls.HtmlForm&quot;</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum26">  26:</span>                 <span style="color:#ff0000;">adapterType</span><span style="color:#0000ff;">=&quot;FormRewriterControlAdapter&quot;</span> <span style="color:#0000ff;">/&gt;</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum27">  27:</span>         <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">controlAdapters</span><span style="color:#0000ff;">&gt;</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum28">  28:</span>     <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">browser</span><span style="color:#0000ff;">&gt;</span></font></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><font size="2"><span style="color:#606060;" id="lnum29">  29:</span> <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">browsers</span><span style="color:#0000ff;">&gt;</span></font></pre>
<p><!--CRLF--></div>
</div>
<p><font size="2">step 5: Run Application</font></p>
<p><font size="2">Now Press Button 2: </font></p>
<p><a title="http://localhost:2696/urlrewriting/FirstSection/Default.html" href="http://localhost:2696/urlrewriting/FirstSection/Default.html"><font size="2">http://localhost:2696/urlrewriting/FirstSection/Default.html</font></a><font size="2"> and it is run.</font></p>
<p><font size="2">&#160;</font></p>
<p><font size="2">Now made some change in to system. Remove browser file and click button2, after that made postback at that time above URL is change to original URL.</font></p>
<p><font size="2">Reference Site :</font></p>
<p><font size="2">For Detail Example :</font></p>
<p><a title="http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx" href="http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx" target="_blank"><font size="2">http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx</font></a></p>
<p><font size="2">&#160;</font></p>
<p><font size="2">Hope this help you.</font></p>
<p><font size="2">Thnx</font></p>
<p><font size="2">&#160;</font></p>
<p><font size="2"></font></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amitpatriwala.wordpress.com/474/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amitpatriwala.wordpress.com/474/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/amitpatriwala.wordpress.com/474/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/amitpatriwala.wordpress.com/474/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/amitpatriwala.wordpress.com/474/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/amitpatriwala.wordpress.com/474/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/amitpatriwala.wordpress.com/474/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/amitpatriwala.wordpress.com/474/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/amitpatriwala.wordpress.com/474/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/amitpatriwala.wordpress.com/474/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amitpatriwala.wordpress.com&blog=2616360&post=474&subd=amitpatriwala&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://amitpatriwala.wordpress.com/2009/10/02/url-rewriting-in-asp-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c12ba624e5155b632d14a31227425a46?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">patriwala</media:title>
		</media:content>
	</item>
		<item>
		<title>Crystal report with multiple sub report navigation problem in asp.net</title>
		<link>http://amitpatriwala.wordpress.com/2009/09/16/crystal-report-with-multiple-sub-report-navigation-problem-in-asp-net/</link>
		<comments>http://amitpatriwala.wordpress.com/2009/09/16/crystal-report-with-multiple-sub-report-navigation-problem-in-asp-net/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 14:22:53 +0000</pubDate>
		<dc:creator>patriwala</dc:creator>
				<category><![CDATA[Asp.Net 2.0]]></category>
		<category><![CDATA[C#.net]]></category>
		<category><![CDATA[Crystal Report]]></category>
		<category><![CDATA[Crystal Report In Asp.net]]></category>
		<category><![CDATA[Crystal Report Navigation Problem]]></category>
		<category><![CDATA[Crystal Report with multiple sub report]]></category>
		<category><![CDATA[Crystal Reports Navigation ShowNthPage]]></category>
		<category><![CDATA[problem with paging in crystal report]]></category>

		<guid isPermaLink="false">http://amitpatriwala.wordpress.com/2009/09/16/crystal-report-with-multiple-sub-report-navigation-problem-in-asp-net/</guid>
		<description><![CDATA[Here I am explain the crystal report problem during the development. 
I want to create Main report which having three sub reports. I create that report and call that report using asp.net but I have phase navigation problem.
Problem :
When Clicking the “Next” navigation button while on page 1 of Report Page 2 is appear, when [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amitpatriwala.wordpress.com&blog=2616360&post=405&subd=amitpatriwala&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><font size="2">Here I am explain the crystal report problem during the development. </font></p>
<p><font size="2">I want to create Main report which having three sub reports. I create that report and call that report using asp.net but I have phase navigation problem.</font></p>
<p><strong><font size="2">Problem :</font></strong></p>
<p><font size="2">When Clicking the “Next” navigation button while on page 1 of Report Page 2 is appear, when clicking the “Next” navigation button while on page 2 , page 2 is repeated.</font></p>
<p><strong><font size="2">Solution :</font></strong></p>
<p><font size="2">Initially we write a Crystal report viewer code in to Page_Load event we move that code to Page_Init event and the Report navigation work.</font></p>
<p><font size="2">Hope this help you.</font></p>
<p><font size="2"></font></p>
<p><font size="2">thnx</font></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amitpatriwala.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amitpatriwala.wordpress.com/405/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/amitpatriwala.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/amitpatriwala.wordpress.com/405/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/amitpatriwala.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/amitpatriwala.wordpress.com/405/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/amitpatriwala.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/amitpatriwala.wordpress.com/405/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/amitpatriwala.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/amitpatriwala.wordpress.com/405/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amitpatriwala.wordpress.com&blog=2616360&post=405&subd=amitpatriwala&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://amitpatriwala.wordpress.com/2009/09/16/crystal-report-with-multiple-sub-report-navigation-problem-in-asp-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c12ba624e5155b632d14a31227425a46?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">patriwala</media:title>
		</media:content>
	</item>
		<item>
		<title>PDF Viewer in asp.net</title>
		<link>http://amitpatriwala.wordpress.com/2009/08/28/pdf-viewer-in-asp-net/</link>
		<comments>http://amitpatriwala.wordpress.com/2009/08/28/pdf-viewer-in-asp-net/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 13:49:52 +0000</pubDate>
		<dc:creator>patriwala</dc:creator>
				<category><![CDATA[Asp.Net 2.0]]></category>
		<category><![CDATA[C#.net]]></category>
		<category><![CDATA[dotnet]]></category>
		<category><![CDATA[iPaper in asp.net]]></category>
		<category><![CDATA[PDF View In asp.net]]></category>

		<guid isPermaLink="false">http://amitpatriwala.wordpress.com/2009/08/28/pdf-viewer-in-asp-net/</guid>
		<description><![CDATA[Here I am explaining how to create PDF Viewer in asp.net.
 
Steps:
1) create Class Library Project Here I am give name OnlinePdfViewer. Here I am using c#.net. Write below code in to file.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace OnlinePdfViewer
{
    public class DisplayPdf : WebControl
    {
   [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amitpatriwala.wordpress.com&blog=2616360&post=402&subd=amitpatriwala&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Here I am explaining how to create PDF Viewer in asp.net.</p>
<p><a href="http://amitpatriwala.files.wordpress.com/2009/08/1.jpg"><img style="display:inline;border-width:0;" title="iPaper in asp.net" border="0" alt="iPaper in asp.net" src="http://amitpatriwala.files.wordpress.com/2009/08/1_thumb.jpg?w=445&#038;h=254" width="445" height="254" /></a> </p>
<p>Steps:</p>
<p>1) create Class Library Project Here I am give name OnlinePdfViewer. Here I am using c#.net. Write below code in to file.</p>
<pre class="code"><span style="color:blue;">using </span>System;
<span style="color:blue;">using </span>System.Collections.Generic;
<span style="color:blue;">using </span>System.ComponentModel;
<span style="color:blue;">using </span>System.Text;
<span style="color:blue;">using </span>System.Web;
<span style="color:blue;">using </span>System.Web.UI;
<span style="color:blue;">using </span>System.Web.UI.WebControls;

<span style="color:blue;">namespace </span>OnlinePdfViewer
{
    <span style="color:blue;">public class </span><span style="color:#2b91af;">DisplayPdf </span>: <span style="color:#2b91af;">WebControl
    </span>{
        <span style="color:blue;">private string </span>_filepath;
        <span style="color:blue;">public string </span>FilePath
        {
            <span style="color:blue;">get
            </span>{
                <span style="color:blue;">return </span>_filepath;
            }
            <span style="color:blue;">set
            </span>{
                <span style="color:blue;">if </span>(<span style="color:blue;">string</span>.IsNullOrEmpty(<span style="color:blue;">value</span>))
                {
                    _filepath = <span style="color:blue;">string</span>.Empty;
                }
                <span style="color:blue;">else
                </span>{
                    <span style="color:blue;">int </span>tild = -1;
                    <span style="color:green;">//check ~ symbol including in pdf path then remove
                    </span>tild = <span style="color:blue;">value</span>.IndexOf(<span style="color:#a31515;">'~'</span>);
                    <span style="color:blue;">if </span>(tild != -1)
                    {
                        _filepath = <span style="color:blue;">value</span>.Substring((tild + 2)).Trim();
                    }
                    <span style="color:blue;">else
                    </span>{
                        _filepath = <span style="color:blue;">value</span>;
                    }
                }
            }
        }   

        <span style="color:blue;">protected override void </span>RenderContents(<span style="color:#2b91af;">HtmlTextWriter </span>writer)
        {
            <span style="color:blue;">try
            </span>{
                <span style="color:#2b91af;">StringBuilder </span>sb = <span style="color:blue;">new </span><span style="color:#2b91af;">StringBuilder</span>();
                sb.Append(<span style="color:#a31515;">&quot;&lt;iframe src=&quot; </span>+ <span style="color:#2b91af;">Convert</span>.ToString(FilePath) + <span style="color:#a31515;">&quot; &quot;</span>);
                <span style="color:green;">//fix height and width
                </span>sb.Append(<span style="color:#a31515;">&quot;width=800px height=500px&quot;</span>);
                sb.Append(<span style="color:#a31515;">&quot;&lt;View PDF: &lt;a href=&quot; </span>+ <span style="color:#2b91af;">Convert</span>.ToString(FilePath) + <span style="color:#a31515;">&quot;&lt;/a&gt;&lt;/p&gt; &quot;</span>);
                sb.Append(<span style="color:#a31515;">&quot;&lt;/iframe&gt;&quot;</span>);
                writer.RenderBeginTag(<span style="color:#2b91af;">HtmlTextWriterTag</span>.Div);
                writer.Write(<span style="color:#2b91af;">Convert</span>.ToString(sb));
                writer.RenderEndTag();
            }
            <span style="color:blue;">catch
            </span>{
                <span style="color:green;">//If any problem in the PDF at that time display below information
                </span>writer.RenderBeginTag(<span style="color:#2b91af;">HtmlTextWriterTag</span>.Div);
                writer.Write(<span style="color:#a31515;">&quot;PDF Control...&quot;</span>);
                writer.RenderEndTag();
            }
        }
    }
}      </pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>2) Run the project it generate dll –&gt; OnlinePdfViewer.dll.</p>
<p>3) Create New Web Application give name – DemoPDFViewer.I have create application in asp.net with c#.</p>
<p>&#160;&#160;&#160; Here I have create demo application In application User can upload PDF and View uploaded PDF in PDF viewer. </p>
<p>3.1) Add the Reference of OnlinePdfViewer.dll into Site.</p>
<p>3.2) Make PDF folder into Site.</p>
<p>3.3) Upload PDF Functionality</p>
<p>ASPX Code :</p>
<pre class="code"><span style="background:yellow;">&lt;%</span><span style="color:blue;">@ </span><span style="color:maroon;">Page </span><span style="color:red;">Language</span><span style="color:blue;">=&quot;C#&quot; </span><span style="color:red;">AutoEventWireup</span><span style="color:blue;">=&quot;true&quot; </span><span style="color:red;">CodeFile</span><span style="color:blue;">=&quot;Default.aspx.cs&quot; </span><span style="color:red;">Inherits</span><span style="color:blue;">=&quot;_Default&quot; </span><span style="background:yellow;">%&gt;

&lt;%</span><span style="color:blue;">@ </span><span style="color:maroon;">Register </span><span style="color:red;">Assembly</span><span style="color:blue;">=&quot;OnlinePdfViewer&quot; </span><span style="color:red;">Namespace</span><span style="color:blue;">=&quot;OnlinePdfViewer&quot; </span><span style="color:red;">TagPrefix</span><span style="color:blue;">=&quot;PdfViewer&quot; </span><span style="background:yellow;">%&gt;
</span><span style="color:blue;">&lt;!</span><span style="color:maroon;">DOCTYPE </span><span style="color:red;">html PUBLIC </span><span style="color:blue;">&quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;</span><span style="color:maroon;">html </span><span style="color:red;">xmlns</span><span style="color:blue;">=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;</span><span style="color:maroon;">head </span><span style="color:red;">runat</span><span style="color:blue;">=&quot;server&quot;&gt;
    &lt;</span><span style="color:maroon;">title</span><span style="color:blue;">&gt;</span>PDF View Online<span style="color:blue;">&lt;/</span><span style="color:maroon;">title</span><span style="color:blue;">&gt;
&lt;/</span><span style="color:maroon;">head</span><span style="color:blue;">&gt;
&lt;</span><span style="color:maroon;">body</span><span style="color:blue;">&gt;
    &lt;</span><span style="color:maroon;">form </span><span style="color:red;">id</span><span style="color:blue;">=&quot;form1&quot; </span><span style="color:red;">runat</span><span style="color:blue;">=&quot;server&quot;&gt;
    &lt;</span><span style="color:maroon;">div</span><span style="color:blue;">&gt;
        &lt;</span><span style="color:maroon;">center</span><span style="color:blue;">&gt;
            &lt;</span><span style="color:maroon;">table</span><span style="color:blue;">&gt;
                &lt;</span><span style="color:maroon;">tr</span><span style="color:blue;">&gt;
                    &lt;</span><span style="color:maroon;">td </span><span style="color:red;">colspan</span><span style="color:blue;">=&quot;2&quot; </span><span style="color:red;">align</span><span style="color:blue;">=&quot;center&quot; </span><span style="color:red;">style</span><span style="color:blue;">=&quot;</span><span style="color:red;">font-family</span><span style="color:blue;">: Verdana; </span><span style="color:red;">font-size</span><span style="color:blue;">: larger&quot;&gt;
                        </span>Online PDF Viewer
                    <span style="color:blue;">&lt;/</span><span style="color:maroon;">td</span><span style="color:blue;">&gt;
                &lt;/</span><span style="color:maroon;">tr</span><span style="color:blue;">&gt;
                &lt;</span><span style="color:maroon;">tr</span><span style="color:blue;">&gt;
                    &lt;</span><span style="color:maroon;">td</span><span style="color:blue;">&gt;
                        </span>Upload PDF File
                    <span style="color:blue;">&lt;/</span><span style="color:maroon;">td</span><span style="color:blue;">&gt;
                    &lt;</span><span style="color:maroon;">td</span><span style="color:blue;">&gt;
                        &lt;</span><span style="color:maroon;">asp</span><span style="color:blue;">:</span><span style="color:maroon;">FileUpload </span><span style="color:red;">ID</span><span style="color:blue;">=&quot;fup&quot; </span><span style="color:red;">runat</span><span style="color:blue;">=&quot;server&quot; /&gt;
                    &lt;/</span><span style="color:maroon;">td</span><span style="color:blue;">&gt;
                &lt;/</span><span style="color:maroon;">tr</span><span style="color:blue;">&gt;
                &lt;</span><span style="color:maroon;">tr</span><span style="color:blue;">&gt;
                    &lt;</span><span style="color:maroon;">td </span><span style="color:red;">colspan</span><span style="color:blue;">=&quot;2&quot;&gt;
                        &lt;</span><span style="color:maroon;">asp</span><span style="color:blue;">:</span><span style="color:maroon;">Button </span><span style="color:red;">ID</span><span style="color:blue;">=&quot;btnUpload&quot; </span><span style="color:red;">runat</span><span style="color:blue;">=&quot;server&quot; </span><span style="color:red;">Text</span><span style="color:blue;">=&quot;Upload&quot; </span><span style="color:red;">OnClick</span><span style="color:blue;">=&quot;btnUpload_Click&quot; /&gt;
                    &lt;/</span><span style="color:maroon;">td</span><span style="color:blue;">&gt;
                &lt;/</span><span style="color:maroon;">tr</span><span style="color:blue;">&gt;
                &lt;</span><span style="color:maroon;">tr</span><span style="color:blue;">&gt;
                    &lt;</span><span style="color:maroon;">td</span><span style="color:blue;">&gt;
                        &lt;</span><span style="color:maroon;">asp</span><span style="color:blue;">:</span><span style="color:maroon;">Label </span><span style="color:red;">ID</span><span style="color:blue;">=&quot;lblMsg&quot; </span><span style="color:red;">runat</span><span style="color:blue;">=&quot;server&quot; </span><span style="color:red;">ViewStateMode</span><span style="color:blue;">=&quot;Disabled&quot; </span><span style="color:red;">Font-Bold</span><span style="color:blue;">=&quot;true&quot; </span><span style="color:red;">ForeColor</span><span style="color:blue;">=&quot;Red&quot;&gt;&lt;/</span><span style="color:maroon;">asp</span><span style="color:blue;">:</span><span style="color:maroon;">Label</span><span style="color:blue;">&gt;
                    &lt;/</span><span style="color:maroon;">td</span><span style="color:blue;">&gt;
                &lt;/</span><span style="color:maroon;">tr</span><span style="color:blue;">&gt;
                &lt;</span><span style="color:maroon;">tr</span><span style="color:blue;">&gt;
                    &lt;</span><span style="color:maroon;">td </span><span style="color:red;">colspan</span><span style="color:blue;">=&quot;2&quot; </span><span style="color:red;">align</span><span style="color:blue;">=&quot;center&quot;&gt;
                        &lt;</span><span style="color:maroon;">asp</span><span style="color:blue;">:</span><span style="color:maroon;">Button </span><span style="color:red;">ID</span><span style="color:blue;">=&quot;btnView&quot; </span><span style="color:red;">Text</span><span style="color:blue;">=&quot;View PDF&quot; </span><span style="color:red;">runat</span><span style="color:blue;">=&quot;server&quot; </span><span style="color:red;">Visible</span><span style="color:blue;">=&quot;false&quot; </span><span style="color:red;">OnClick</span><span style="color:blue;">=&quot;btnView_Click&quot; /&gt;
                    &lt;/</span><span style="color:maroon;">td</span><span style="color:blue;">&gt;
                &lt;/</span><span style="color:maroon;">tr</span><span style="color:blue;">&gt;
                &lt;</span><span style="color:maroon;">tr</span><span style="color:blue;">&gt;
                    &lt;</span><span style="color:maroon;">td </span><span style="color:red;">colspan</span><span style="color:blue;">=&quot;2&quot; </span><span style="color:red;">id</span><span style="color:blue;">=&quot;pnlPDFViewer&quot; </span><span style="color:red;">visible</span><span style="color:blue;">=&quot;false&quot; </span><span style="color:red;">runat</span><span style="color:blue;">=&quot;server&quot;&gt;
                        &lt;</span><span style="color:maroon;">asp</span><span style="color:blue;">:</span><span style="color:maroon;">HyperLink </span><span style="color:red;">ID</span><span style="color:blue;">=&quot;HyperLink1&quot; </span><span style="color:red;">runat</span><span style="color:blue;">=&quot;server&quot;&gt;</span>Open PDF into New Page<span style="color:blue;">&lt;/</span><span style="color:maroon;">asp</span><span style="color:blue;">:</span><span style="color:maroon;">HyperLink</span><span style="color:blue;">&gt;
                        &lt;</span><span style="color:maroon;">br </span><span style="color:blue;">/&gt;
                        &lt;</span><span style="color:maroon;">PdfViewer</span><span style="color:blue;">:</span><span style="color:maroon;">DisplayPdf </span><span style="color:red;">ID</span><span style="color:blue;">=&quot;displaypdf1&quot; </span><span style="color:red;">runat</span><span style="color:blue;">=&quot;server&quot; </span><span style="color:red;">BorderStyle</span><span style="color:blue;">=&quot;Inset&quot; </span><span style="color:red;">BorderWidth</span><span style="color:blue;">=&quot;2px&quot;
                            </span><span style="color:red;">Style</span><span style="color:blue;">=&quot;</span><span style="color:red;">height</span><span style="color:blue;">: 500px;&quot; </span><span style="color:red;">Width</span><span style="color:blue;">=&quot;800px&quot; /&gt;
                    &lt;/</span><span style="color:maroon;">td</span><span style="color:blue;">&gt;
                &lt;/</span><span style="color:maroon;">tr</span><span style="color:blue;">&gt;
            &lt;/</span><span style="color:maroon;">table</span><span style="color:blue;">&gt;
        &lt;/</span><span style="color:maroon;">center</span><span style="color:blue;">&gt;
    &lt;/</span><span style="color:maroon;">div</span><span style="color:blue;">&gt;
    &lt;/</span><span style="color:maroon;">form</span><span style="color:blue;">&gt;
&lt;/</span><span style="color:maroon;">body</span><span style="color:blue;">&gt;
&lt;/</span><span style="color:maroon;">html</span><span style="color:blue;">&gt;
</span></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>CS Code:</p>
<pre class="code"><span style="color:blue;">using </span>System;
<span style="color:blue;">using </span>System.Data;
<span style="color:blue;">using </span>System.Configuration;
<span style="color:blue;">using </span>System.Web;
<span style="color:blue;">using </span>System.Web.Security;
<span style="color:blue;">using </span>System.Web.UI;
<span style="color:blue;">using </span>System.Web.UI.WebControls;
<span style="color:blue;">using </span>System.Web.UI.WebControls.WebParts;
<span style="color:blue;">using </span>System.Web.UI.HtmlControls;
<span style="color:blue;">using </span>System.Drawing;

<span style="color:blue;">public partial class </span><span style="color:#2b91af;">_Default </span>: System.Web.UI.<span style="color:#2b91af;">Page
</span>{
    <span style="color:blue;">protected void </span>Page_Load(<span style="color:blue;">object </span>sender, <span style="color:#2b91af;">EventArgs </span>e)
    {

    }

    <span style="color:blue;">public string </span>Uploadedfilename { <span style="color:blue;">get </span>{ <span style="color:blue;">return </span><span style="color:#2b91af;">Convert</span>.ToString(ViewState[<span style="color:#a31515;">&quot;filename&quot;</span>]); } <span style="color:blue;">set </span>{ ViewState[<span style="color:#a31515;">&quot;filename&quot;</span>] = <span style="color:blue;">value</span>; } }

    <span style="color:blue;">protected void </span>btnUpload_Click(<span style="color:blue;">object </span>sender, <span style="color:#2b91af;">EventArgs </span>e)
    {
        <span style="color:blue;">if </span>(fup.HasFile)
        {
            <span style="color:blue;">string </span>strFilePath = Server.MapPath(<span style="color:#a31515;">&quot;PDF&quot;</span>) + <span style="color:#a31515;">&quot;\\&quot;</span>;
            Uploadedfilename = <span style="color:#2b91af;">Convert</span>.ToString(<span style="color:#2b91af;">Guid</span>.NewGuid()) + <span style="color:#a31515;">&quot;.pdf&quot;</span>;
            strFilePath = strFilePath + Uploadedfilename;
            fup.SaveAs(strFilePath);
            lblMsg.ForeColor = <span style="color:#2b91af;">Color</span>.Blue;
            lblMsg.Text = <span style="color:#a31515;">&quot;PDF File Upload Successfully&quot;</span>;
            btnView.Visible = <span style="color:blue;">true</span>;
        }
        <span style="color:blue;">else
        </span>{
            lblMsg.Text = <span style="color:#a31515;">&quot;Please Upload PDF File&quot;</span>;
        }
    }
    <span style="color:blue;">protected void </span>btnView_Click(<span style="color:blue;">object </span>sender, <span style="color:#2b91af;">EventArgs </span>e)
    {
        pnlPDFViewer.Visible = <span style="color:blue;">true</span>;
        displaypdf1.FilePath = <span style="color:#a31515;">@&quot;~/pdf/&quot; </span>+ Uploadedfilename;
        HyperLink1.NavigateUrl = <span style="color:#a31515;">@&quot;~/pdf/&quot; </span>+ Uploadedfilename;
    }
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>4) compile code and run application.</p>
<p>&#160;</p>
<p>thnx</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amitpatriwala.wordpress.com/402/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amitpatriwala.wordpress.com/402/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/amitpatriwala.wordpress.com/402/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/amitpatriwala.wordpress.com/402/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/amitpatriwala.wordpress.com/402/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/amitpatriwala.wordpress.com/402/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/amitpatriwala.wordpress.com/402/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/amitpatriwala.wordpress.com/402/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/amitpatriwala.wordpress.com/402/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/amitpatriwala.wordpress.com/402/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amitpatriwala.wordpress.com&blog=2616360&post=402&subd=amitpatriwala&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://amitpatriwala.wordpress.com/2009/08/28/pdf-viewer-in-asp-net/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c12ba624e5155b632d14a31227425a46?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">patriwala</media:title>
		</media:content>

		<media:content url="http://amitpatriwala.files.wordpress.com/2009/08/1_thumb.jpg" medium="image">
			<media:title type="html">iPaper in asp.net</media:title>
		</media:content>
	</item>
		<item>
		<title>Change Browser Setting In Flex Application</title>
		<link>http://amitpatriwala.wordpress.com/2009/07/13/change-browser-setting-in-flex-application/</link>
		<comments>http://amitpatriwala.wordpress.com/2009/07/13/change-browser-setting-in-flex-application/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 17:21:00 +0000</pubDate>
		<dc:creator>patriwala</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Flex Applicaiton]]></category>
		<category><![CDATA[Flex 3.0]]></category>
		<category><![CDATA[Flex Application]]></category>

		<guid isPermaLink="false">http://amitpatriwala.wordpress.com/2009/07/13/change-browser-setting-in-flex-application/</guid>
		<description><![CDATA[I have used the Flex Application with IE. Now I have change Browser and make it Firefox. 
There are two steps.
1) First Select Menu—&#62; windows –&#62; Preferences –&#62; General&#160; &#8211;&#62; Web Browser…
After that you may able to change the browser.

&#160;
2) Go to Command Prompt and type
-–&#62; ftype http=”c:\Program Files\Mozilla Firefox\firefox.exe”
Reopen Flex Application. 

Now run your [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amitpatriwala.wordpress.com&blog=2616360&post=397&subd=amitpatriwala&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I have used the Flex Application with IE. Now I have change Browser and make it Firefox. </p>
<p>There are two steps.</p>
<p>1) First Select Menu—&gt; windows –&gt; Preferences –&gt; General&#160; &#8211;&gt; Web Browser…</p>
<blockquote><p><font color="#333333">After that you may able to change the browser.</font></p>
</blockquote>
<p>&#160;</p>
<p>2) Go to Command Prompt and type</p>
<blockquote><p><font color="#333333">-</font>–&gt; ftype http=”c:\Program Files\Mozilla Firefox\firefox.exe”</p>
<p>Reopen Flex Application. </p>
</blockquote>
<p>Now run your application then browser is changed.</p>
<p>&#160;</p>
<p>&#160;</p>
<p>thnx</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amitpatriwala.wordpress.com/397/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amitpatriwala.wordpress.com/397/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/amitpatriwala.wordpress.com/397/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/amitpatriwala.wordpress.com/397/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/amitpatriwala.wordpress.com/397/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/amitpatriwala.wordpress.com/397/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/amitpatriwala.wordpress.com/397/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/amitpatriwala.wordpress.com/397/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/amitpatriwala.wordpress.com/397/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/amitpatriwala.wordpress.com/397/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amitpatriwala.wordpress.com&blog=2616360&post=397&subd=amitpatriwala&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://amitpatriwala.wordpress.com/2009/07/13/change-browser-setting-in-flex-application/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c12ba624e5155b632d14a31227425a46?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">patriwala</media:title>
		</media:content>
	</item>
		<item>
		<title>Calling Web service from Flex – Part 1</title>
		<link>http://amitpatriwala.wordpress.com/2009/06/23/calling-web-service-from-flex-part-1/</link>
		<comments>http://amitpatriwala.wordpress.com/2009/06/23/calling-web-service-from-flex-part-1/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 14:02:19 +0000</pubDate>
		<dc:creator>patriwala</dc:creator>
				<category><![CDATA[Asp.Net 2.0]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[call web service from flex]]></category>
		<category><![CDATA[WebService]]></category>

		<guid isPermaLink="false">http://amitpatriwala.wordpress.com/2009/06/23/calling-web-service-from-flex-part-1/</guid>
		<description><![CDATA[Here I am Explain how to use Web Services in Flex Application.
Steps:
1) First we create web service in Asp.net with C#. create new Web method in Web service is GetName.
[WebMethod]
    public string GetName(string UserName)
    {
        return &#34;WelCome  &#34; + UserName;
  [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amitpatriwala.wordpress.com&blog=2616360&post=391&subd=amitpatriwala&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Here I am Explain how to use Web Services in Flex Application.</p>
<p>Steps:</p>
<p>1) First we create web service in Asp.net with C#. create new Web method in Web service is GetName.</p>
<pre class="code">[<span style="color:teal;">WebMethod</span>]
    <span style="color:blue;">public string </span>GetName(<span style="color:blue;">string </span>UserName)
    {
        <span style="color:blue;">return </span><span style="color:maroon;">&quot;WelCome  &quot; </span>+ UserName;
    }</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>My web service name is WebServices. </p>
<pre class="code"><span style="color:blue;">using </span>System;
<span style="color:blue;">using </span>System.Web;
<span style="color:blue;">using </span>System.Collections;
<span style="color:blue;">using </span>System.Web.Services;
<span style="color:blue;">using </span>System.Web.Services.Protocols;
<span style="color:gray;">/// &lt;summary&gt;
/// </span><span style="color:green;">Summary description for WebService
</span><span style="color:gray;">/// &lt;/summary&gt;
</span>[<span style="color:teal;">WebService</span>(Namespace = <span style="color:maroon;">&quot;http://tempuri.org/&quot;</span>)]
[<span style="color:teal;">WebServiceBinding</span>(ConformsTo = <span style="color:teal;">WsiProfiles</span>.BasicProfile1_1)]
<span style="color:blue;">public class </span><span style="color:teal;">WebService </span>: System.Web.Services.<span style="color:teal;">WebService </span>{

    <span style="color:blue;">public </span>WebService () {

        <span style="color:green;">//Uncomment the following line if using designed components
        //InitializeComponent();
    </span>}
    [<span style="color:teal;">WebMethod</span>]
    <span style="color:blue;">public string </span>HelloWorld() {
        <span style="color:blue;">return </span><span style="color:maroon;">&quot;Hello World&quot;</span>;
    }
    [<span style="color:teal;">WebMethod</span>]
    <span style="color:blue;">public string </span>GetName(<span style="color:blue;">string </span>UserName) {
        <span style="color:blue;">return </span><span style="color:maroon;">&quot;WelCome  &quot; </span>+ UserName;
    }
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>2) Open Flex Application.</p>
<p>3) Put below control in to application.</p>
<p>&#160;&#160;&#160; 3.1)&#160; WebService (ID =MyWebService)</p>
<p>&#160;&#160;&#160; 3.2) Label for display Information</p>
<p>&#160;&#160;&#160; 3.3) TextArea (ID=txtUserName) – get value and pass value in to WebService</p>
<p>&#160;&#160;&#160; 3.4) Button (ID=btnSubmit) – Call Web service</p>
<p>&#160;&#160;&#160; 3.5) TextArea (ID=txtResult) – Display result from Web service</p>
<p>Application Page Info.</p>
<pre class="code">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
<span style="color:blue;">&lt;mx:Application </span>xmlns:mx=&quot;<span style="color:#990000;">http://www.adobe.com/2006/mxml</span>&quot; layout=&quot;<span style="color:#990000;">absolute</span>&quot;<span style="color:blue;">&gt;
</span><span style="color:maroon;">&lt;!--Web Service Information
wsdl  URL of Web Service
fault  if any error loading web service
operation  method name in Webservices
request  pass the parameter to Webservices
*here I get the TextBox Value
--&gt;
</span><span style="color:blue;">&lt;mx:WebService </span>id=&quot;<span style="color:#990000;">MyWebService</span>&quot; wsdl=&quot;<span style="color:#990000;">http://localhost:3549/ChangeWebConfigFile/WebService.asmx?WSDL</span>&quot;
    fault=&quot;mx.controls.Alert.show(event.fault.faultString)&quot; <span style="color:blue;">&gt;
    &lt;mx:operation </span>name=&quot;<span style="color:#990000;">GetName</span>&quot;<span style="color:blue;">&gt;
        &lt;mx:request&gt;
        &lt;UserName&gt;</span>{txtUserName.text}<span style="color:blue;">&lt;/UserName&gt;
        &lt;/mx:request&gt;
    &lt;/mx:operation&gt;
&lt;/mx:WebService&gt;
&lt;mx:VBox&gt;

    &lt;mx:Label </span>text=&quot;<span style="color:#990000;">Enter User Name</span>&quot;<span style="color:blue;">&gt;
    &lt;/mx:Label&gt;
    &lt;mx:TextArea </span>id=&quot;<span style="color:#990000;">txtUserName</span>&quot; text=&quot;<span style="color:#990000;">test</span>&quot;<span style="color:blue;">&gt;
    &lt;/mx:TextArea&gt;

    &lt;mx:Button </span>id=&quot;<span style="color:#990000;">btnSubmit</span>&quot; label=&quot;<span style="color:#990000;">Submit..</span>&quot; click=&quot;checkUserName();&quot;<span style="color:blue;">&gt;
    &lt;/mx:Button&gt;
    &lt;mx:TextArea </span>id=&quot;<span style="color:#990000;">txtResult</span>&quot;<span style="color:blue;">/&gt;
&lt;/mx:VBox&gt;
</span><span style="color:#006633;">&lt;mx:Script&gt;
    </span>&lt;![CDATA[
      <span style="color:#0033ff;">private </span><span style="color:#339966;">function </span>checkUserName():<span style="color:#0033ff;">void
    </span>{
        MyWebService.GetName.send();
        txtResult.text= MyWebService.GetName.lastResult;
    }
    ]]&gt;
<span style="color:#006633;">&lt;/mx:Script&gt;
</span><span style="color:blue;">&lt;/mx:Application&gt;
</span></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>4) Run Flex Application. </p>
<p>&#160;</p>
<p><a href="http://amitpatriwala.files.wordpress.com/2009/06/image.png"><img title="image" style="display:inline;border-width:0;" height="388" alt="image" src="http://amitpatriwala.files.wordpress.com/2009/06/image_thumb.png?w=644&#038;h=388" width="644" border="0" /></a> </p>
<p>&#160;</p>
<p>&#160;</p>
<p>thnx</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amitpatriwala.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amitpatriwala.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/amitpatriwala.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/amitpatriwala.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/amitpatriwala.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/amitpatriwala.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/amitpatriwala.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/amitpatriwala.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/amitpatriwala.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/amitpatriwala.wordpress.com/391/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amitpatriwala.wordpress.com&blog=2616360&post=391&subd=amitpatriwala&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://amitpatriwala.wordpress.com/2009/06/23/calling-web-service-from-flex-part-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c12ba624e5155b632d14a31227425a46?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">patriwala</media:title>
		</media:content>

		<media:content url="http://amitpatriwala.files.wordpress.com/2009/06/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Error #1085: The element type &#8220;p&#8221; must be terminated by the matching end-tag &#8220;&#8221; in Flex</title>
		<link>http://amitpatriwala.wordpress.com/2009/06/23/error-1085-the-element-type-p-must-be-terminated-by-the-matching-end-tag-p-in-flex/</link>
		<comments>http://amitpatriwala.wordpress.com/2009/06/23/error-1085-the-element-type-p-must-be-terminated-by-the-matching-end-tag-p-in-flex/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 13:37:16 +0000</pubDate>
		<dc:creator>patriwala</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[error 1085 flex]]></category>

		<guid isPermaLink="false">http://amitpatriwala.wordpress.com/2009/06/23/error-1085-the-element-type-p-must-be-terminated-by-the-matching-end-tag-p-in-flex/</guid>
		<description><![CDATA[I have got this Error when I used asp.net web services in FLEX. I found Solution which is mention below.
Steps:
1) Check the URL of your Web Services
&#160;&#160;&#160; you can put direct URL of Web services here I am used URL is&#160; http://localhost:3549/ChangeWebConfigFile/WebService.asmx and got Error. 
2) 
change in URL http://localhost:3549/ChangeWebConfigFile/WebService.asmx?WSDL and solve the Error.
thnx
  [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amitpatriwala.wordpress.com&blog=2616360&post=387&subd=amitpatriwala&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I have got this Error when I used asp.net web services in FLEX. I found Solution which is mention below.</p>
<p>Steps:</p>
<p>1) Check the URL of your Web Services</p>
<p>&#160;&#160;&#160; you can put direct URL of Web services here I am used URL is&#160; <a title="http://localhost:3549/ChangeWebConfigFile/WebService.asmx" href="http://localhost:3549/ChangeWebConfigFile/WebService.asmx">http://localhost:3549/ChangeWebConfigFile/WebService.asmx</a> and got Error. </p>
<p>2) </p>
<p>change in URL <a title="http://localhost:3549/ChangeWebConfigFile/WebService.asmx?WSDL" href="http://localhost:3549/ChangeWebConfigFile/WebService.asmx?WSDL">http://localhost:3549/ChangeWebConfigFile/WebService.asmx?WSDL</a> and solve the Error.</p>
<p>thnx</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amitpatriwala.wordpress.com/387/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amitpatriwala.wordpress.com/387/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/amitpatriwala.wordpress.com/387/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/amitpatriwala.wordpress.com/387/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/amitpatriwala.wordpress.com/387/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/amitpatriwala.wordpress.com/387/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/amitpatriwala.wordpress.com/387/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/amitpatriwala.wordpress.com/387/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/amitpatriwala.wordpress.com/387/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/amitpatriwala.wordpress.com/387/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amitpatriwala.wordpress.com&blog=2616360&post=387&subd=amitpatriwala&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://amitpatriwala.wordpress.com/2009/06/23/error-1085-the-element-type-p-must-be-terminated-by-the-matching-end-tag-p-in-flex/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c12ba624e5155b632d14a31227425a46?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">patriwala</media:title>
		</media:content>
	</item>
		<item>
		<title>Convert Generic List In To DataTable</title>
		<link>http://amitpatriwala.wordpress.com/2008/12/03/convert-generic-list-in-to-datatable/</link>
		<comments>http://amitpatriwala.wordpress.com/2008/12/03/convert-generic-list-in-to-datatable/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 15:20:18 +0000</pubDate>
		<dc:creator>patriwala</dc:creator>
				<category><![CDATA[Asp.Net 2.0]]></category>
		<category><![CDATA[C#.net]]></category>
		<category><![CDATA[WindowsApplication]]></category>
		<category><![CDATA[dotnet]]></category>
		<category><![CDATA[Converting Generic Lists or Collections to a DataSet]]></category>
		<category><![CDATA[DataTable]]></category>
		<category><![CDATA[GenericList]]></category>
		<category><![CDATA[How do you convert a DataTable into a generic list]]></category>
		<category><![CDATA[How to convert a generic list to a datatable]]></category>

		<guid isPermaLink="false">http://amitpatriwala.wordpress.com/?p=379</guid>
		<description><![CDATA[ 
Create simple asp.net application with C#. Add new class (GenericToDataTable).

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Collections.Generic;
using System.ComponentModel;
using System.Reflection;
public class GenericToDataTable
{
/// &#60;summary&#62;
/// Default Constructor
/// &#60;/summary&#62;
private GenericToDataTable()
{ }
/// &#60;summary&#62;
///
/// &#60;/summary&#62;
/// &#60;typeparam name=&#8221;T&#8221;&#62;Custome Class &#60;/typeparam&#62;
/// &#60;param name=&#8221;lst&#8221;&#62;List Of The Custome Class&#60;/param&#62;
/// &#60;returns&#62; Return the class datatbl &#60;/returns&#62;
public static DataTable ConvertTo&#60;T&#62;(IList&#60;T&#62; lst)
{
//create DataTable Structure
DataTable [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amitpatriwala.wordpress.com&blog=2616360&post=379&subd=amitpatriwala&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><!--[if gte mso 9]&gt;  Normal 0   false false false        MicrosoftInternetExplorer4  &lt;![endif]--><!--[if gte mso 9]&gt;   &lt;![endif]--><!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:""; 	margin:0in; 	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:8.5in 11.0in; 	margin:1.0in 1.25in 1.0in 1.25in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --><!--[if gte mso 10]&gt; &lt;!   /* 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:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	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;} --> <!--[endif]--></p>
<p class="MsoNormal">Create simple asp.net application with C#. Add new class (<span style="font-size:10pt;font-family:&quot;color:teal;">GenericToDataTable</span><span style="font-size:10pt;font-family:&quot;color:black;">).</span></p>
<p class="MsoNormal">
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:black;">using System;<br />
using System.Data;<br />
using System.Configuration;<br />
using System.Web;<br />
using System.Web.Security;<br />
using System.Web.UI;<br />
using System.Web.UI.HtmlControls;<br />
using System.Web.UI.WebControls;<br />
using System.Web.UI.WebControls.WebParts;<br />
using System.Collections.Generic;<br />
using System.ComponentModel;<br />
using System.Reflection;</p>
<p>public class GenericToDataTable<br />
{<br />
/// &lt;summary&gt;<br />
/// Default Constructor<br />
/// &lt;/summary&gt;<br />
private GenericToDataTable()<br />
{ }<br />
/// &lt;summary&gt;<br />
///<br />
/// &lt;/summary&gt;<br />
/// &lt;typeparam name=&#8221;T&#8221;&gt;Custome Class &lt;/typeparam&gt;<br />
/// &lt;param name=&#8221;lst&#8221;&gt;List Of The Custome Class&lt;/param&gt;<br />
/// &lt;returns&gt; Return the class datatbl &lt;/returns&gt;<br />
public static DataTable ConvertTo&lt;T&gt;(IList&lt;T&gt; lst)<br />
{<br />
//create DataTable Structure<br />
DataTable tbl = CreateTable&lt;T&gt;();<br />
Type entType = typeof(T);</p>
<p>PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(entType);<br />
//get the list item and add into the list<br />
foreach (T item in lst)<br />
{<br />
DataRow row = tbl.NewRow();<br />
foreach (PropertyDescriptor prop in properties)<br />
{<br />
row[prop.Name] = prop.GetValue(item);<br />
}<br />
tbl.Rows.Add(row);<br />
}</p>
<p>return tbl;<br />
}</p>
<p>/// &lt;summary&gt;<br />
///<br />
/// &lt;/summary&gt;<br />
/// &lt;typeparam name=&#8221;T&#8221;&gt;Custome Class&lt;/typeparam&gt;<br />
/// &lt;returns&gt;&lt;/returns&gt;<br />
public static DataTable CreateTable&lt;T&gt;()<br />
{<br />
//T &#8211;&gt; ClassName<br />
Type entType = typeof(T);<br />
//set the datatable name as class name<br />
DataTable tbl = new DataTable(entType.Name);<br />
//get the property list<br />
PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(entType);<br />
foreach (PropertyDescriptor prop in properties)<br />
{<br />
//add property as column<br />
tbl.Columns.Add(prop.Name, prop.PropertyType);<br />
}<br />
return tbl;<br />
}<br />
}<br />
</span></p>
<p class="MsoNormal">
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:black;">after add above class compile the code.</span></p>
<p class="MsoNormal">
<p><span style="font-size:10pt;font-family:&quot;color:black;">after compilation add new class into project (Class Name:</span><!--[if gte mso 9]&gt;  Normal 0   false false false        MicrosoftInternetExplorer4  &lt;![endif]--><!--[if gte mso 9]&gt;   &lt;![endif]--><!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:""; 	margin:0in; 	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:8.5in 11.0in; 	margin:1.0in 1.25in 1.0in 1.25in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --><!--[if gte mso 10]&gt; &lt;!   /* 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:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	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;} --> <!--[endif]--><span style="font-size:10pt;font-family:&quot;color:teal;">clsUser</span><span></span><span style="font-size:10pt;font-family:&quot;color:black;">).</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:black;">using System;<br />
using System.Data;<br />
using System.Configuration;<br />
using System.Web;<br />
using System.Web.Security;<br />
using System.Web.UI;<br />
using System.Web.UI.WebControls;<br />
using System.Web.UI.WebControls.WebParts;<br />
using System.Web.UI.HtmlControls;</p>
<p>/// &lt;summary&gt;<br />
/// Summary description for clsUser<br />
/// &lt;/summary&gt;<br />
public class clsUser<br />
{<br />
//create property userid<br />
private int _UserId;<br />
public int UserID<br />
{<br />
get { return _UserId; }<br />
set { _UserId = value; }<br />
}<br />
//create property username<br />
private string _UserName;<br />
public string UserName<br />
{<br />
get { return _UserName; }<br />
set { _UserName = value; }<br />
}<br />
/// &lt;summary&gt;<br />
/// Default Constructor<br />
/// &lt;/summary&gt;<br />
public clsUser()<br />
{ }</p>
<p>public clsUser(int userid,string username)<br />
{<br />
this.UserID = userid;<br />
this.UserName = username;<br />
}<br />
}<br />
</span></p>
<p class="MsoNormal">
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:black;">After adding this class into project go to Default.aspx page in this page type below code on Page Load event.</span></p>
<p class="MsoNormal">
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:black;"> //create generic list of class clsUser<br />
System.Collections.Generic.List&lt;clsUser&gt; obj = new<br />
System.Collections.Generic.List&lt;clsUser&gt;();<br />
//add data into list<br />
for (int i = 0; i &lt; 10; i++)<br />
{<br />
obj.Add(new clsUser(i,&#8221;a&#8221;+i.ToString()));<br />
}<br />
//convert list to datatable<br />
DataTable dt= GenericToDataTable.ConvertTo&lt;clsUser&gt;(obj);</span></p>
<p class="MsoNormal">
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:black;">now check the DataTable(dt).</span></p>
<p class="MsoNormal">
<p class="MsoNormal">
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:black;">thnx<br />
</span></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amitpatriwala.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amitpatriwala.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/amitpatriwala.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/amitpatriwala.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/amitpatriwala.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/amitpatriwala.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/amitpatriwala.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/amitpatriwala.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/amitpatriwala.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/amitpatriwala.wordpress.com/379/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amitpatriwala.wordpress.com&blog=2616360&post=379&subd=amitpatriwala&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://amitpatriwala.wordpress.com/2008/12/03/convert-generic-list-in-to-datatable/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c12ba624e5155b632d14a31227425a46?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">patriwala</media:title>
		</media:content>
	</item>
		<item>
		<title>Get Parameter List from StoreProcedure or Function in SqlServer 2005</title>
		<link>http://amitpatriwala.wordpress.com/2008/10/11/get-parameter-list-from-storeprocedure-or-function-in-sqlserver-2005/</link>
		<comments>http://amitpatriwala.wordpress.com/2008/10/11/get-parameter-list-from-storeprocedure-or-function-in-sqlserver-2005/#comments</comments>
		<pubDate>Sat, 11 Oct 2008 12:33:23 +0000</pubDate>
		<dc:creator>patriwala</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[SqlServer]]></category>
		<category><![CDATA[Get Parameter from StoredProcedure in SqlServer 2005]]></category>
		<category><![CDATA[sql server 2005 stored procedure]]></category>

		<guid isPermaLink="false">http://amitpatriwala.wordpress.com/?p=371</guid>
		<description><![CDATA[&#8211;get all storeprocedure and function
SELECT * FROM INFORMATION_SCHEMA.PARAMETERS 
&#8211;pass storeprocedure name or function name
&#8211;get the relavent columns ParameterName,DataType,Length,ParameterType
SELECT Parameter_name as ParameterName,Data_type as DataType,coalesce(Character_Maximum_Length,0) as Length,Parameter_Mode as ParameterType FROM INFORMATION_SCHEMA.PARAMETERS 
WHERE SPECIFIC_NAME=&#8217;sp_InsertOrder&#8217;
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amitpatriwala.wordpress.com&blog=2616360&post=371&subd=amitpatriwala&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:green;">&#8211;get all storeprocedure and function</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:blue;">SELECT</span><span style="font-size:10pt;font-family:&quot;"> <span style="color:gray;">*</span> <span style="color:blue;">FROM</span> <span style="color:green;">INFORMATION_SCHEMA.PARAMETERS</span> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:green;">&#8211;pass storeprocedure name or function name</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:green;">&#8211;get the relavent columns ParameterName,DataType,Length,ParameterType</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:blue;">SELECT</span><span style="font-size:10pt;font-family:&quot;"> Parameter_name <span style="color:blue;">as</span> ParameterName<span style="color:gray;">,</span>Data_type <span style="color:blue;">as</span> DataType<span style="color:gray;">,</span><span style="color:fuchsia;">coalesce</span><span style="color:gray;">(</span>Character_Maximum_Length<span style="color:gray;">,</span>0<span style="color:gray;">)</span> <span style="color:blue;">as</span> Length<span style="color:gray;">,</span>Parameter_Mode <span style="color:blue;">as</span> ParameterType <span style="color:blue;">FROM</span> <span style="color:green;">INFORMATION_SCHEMA.PARAMETERS</span> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span style="color:blue;">WHERE</span> SPECIFIC_NAME<span style="color:gray;">=</span><span style="color:red;">&#8217;sp_InsertOrder&#8217;</span></span></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/amitpatriwala.wordpress.com/371/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/amitpatriwala.wordpress.com/371/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/amitpatriwala.wordpress.com/371/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/amitpatriwala.wordpress.com/371/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/amitpatriwala.wordpress.com/371/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/amitpatriwala.wordpress.com/371/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/amitpatriwala.wordpress.com/371/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/amitpatriwala.wordpress.com/371/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/amitpatriwala.wordpress.com/371/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/amitpatriwala.wordpress.com/371/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=amitpatriwala.wordpress.com&blog=2616360&post=371&subd=amitpatriwala&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://amitpatriwala.wordpress.com/2008/10/11/get-parameter-list-from-storeprocedure-or-function-in-sqlserver-2005/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c12ba624e5155b632d14a31227425a46?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">patriwala</media:title>
		</media:content>
	</item>
	</channel>
</rss>