<?xml version="1.0" encoding="iso-8859-1"?><!-- generator="b2evolution/2.4.5" -->
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>LessThanDot - All Blogs</title>
		<link>http://blogs.lessthandot.com/index.php/All/</link>
		<description></description>
		<language>en-GB</language>
		<docs>http://blogs.law.harvard.edu/tech/rss</docs>
		<admin:generatorAgent rdf:resource="http://b2evolution.net/?v=2.4.5"/>
		<ttl>60</ttl>
				<item>
			<title>Display Monthly Totals Going Across in SSRS 2005</title>
			<link>http://blogs.lessthandot.com/index.php/DataMgmt/DBProgramming/ssrs-2005-matrix</link>
			<pubDate>Wed, 28 Jul 2010 15:15:59 +0000</pubDate>			<dc:creator>rwaters</dc:creator>
			<category domain="alt">Data Modelling &amp; Design</category>
<category domain="main">Database Programming</category>
<category domain="alt">Microsoft SQL Server</category>			<guid isPermaLink="false">908@http://blogs.lessthandot.com/</guid>
						<description>&lt;h3&gt;by &lt;a href=&quot;http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;amp;author=458&quot;&gt; rwaters &lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Do you need an SSRS 2005 report that displays totals for the previous 3 months going horizontally across ?  Well, I did, and my first approach involved using derived tables, each with a separate date range, to get each month&amp;#8217;s total to appear in its own column.  While I achieved my goal, performance was lousy because the query needed to execute 3 times (once for each date range).&lt;/p&gt;
&lt;p&gt;I shaved 2 minutes off the query execution time with a second approach.  This alternate approach involves using a single query for the entire, 3-month date range, along with a GROUP BY clause including year and month.  For the SSRS piece, I use a matrix format to get the months to display horizontally across.  Since I have additional columns to display besides the total, I have to do some extra maneuvering, but more on that, later.&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s a look at the T-SQL code:&lt;/p&gt;
&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;tsql&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;tsql&quot; id=&quot;cb6486&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;USE&lt;/span&gt; &lt;span style=&quot;color: #808080;&quot;&gt;&amp;#91;&lt;/span&gt;AdventureWorks&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;br /&gt;GO&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;IF&lt;/span&gt; &lt;span style=&quot;color: #FF00FF;&quot;&gt;OBJECT_ID&lt;/span&gt; &lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;'dbo.usp_AdventureWorks_matrix'&lt;/span&gt;, &lt;span style=&quot;color: #FF0000;&quot;&gt;'P'&lt;/span&gt; &lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;IS&lt;/span&gt; NOT NULL &lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000FF;&quot;&gt;DROP&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;PROCEDURE&lt;/span&gt; dbo.&lt;span style=&quot;color: #202020;&quot;&gt;usp_AdventureWorks_matrix&lt;/span&gt;;&lt;br /&gt;GO&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;CREATE&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;PROCEDURE&lt;/span&gt; dbo.&lt;span style=&quot;color: #202020;&quot;&gt;usp_AdventureWorks_matrix&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;AS&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;SET&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;NOCOUNT&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;ON&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;BEGIN&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;DECLARE&lt;/span&gt; @today &lt;span style=&quot;color: #0000FF;&quot;&gt;DATETIME&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;SET&lt;/span&gt; @today=&lt;span style=&quot;color: #FF0000;&quot;&gt;'2004-07-01 00:00:00.000'&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;SELECT&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;YEAR&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;hdr.&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#91;&lt;/span&gt;OrderDate&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;AS&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;YEAR&lt;/span&gt;&lt;br /&gt;,&lt;span style=&quot;color: #0000FF;&quot;&gt;MONTH&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;hdr.&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#91;&lt;/span&gt;OrderDate&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;AS&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;MONTH&lt;/span&gt;&lt;br /&gt;,hdr.&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#91;&lt;/span&gt;TerritoryID&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;br /&gt;,p.&lt;span style=&quot;color: #202020;&quot;&gt;ProductNumber&lt;/span&gt;&lt;br /&gt;,p.&lt;span style=&quot;color: #202020;&quot;&gt;Name&lt;/span&gt;&lt;br /&gt;,&lt;span style=&quot;color: #FF00FF;&quot;&gt;SUM&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;det.&lt;span style=&quot;color: #202020;&quot;&gt;OrderQty&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;AS&lt;/span&gt; qty&lt;br /&gt;,p.&lt;span style=&quot;color: #202020;&quot;&gt;SafetyStockLevel&lt;/span&gt;&lt;br /&gt;,p.&lt;span style=&quot;color: #202020;&quot;&gt;ReorderPoint&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;FROM&lt;/span&gt; &lt;span style=&quot;color: #808080;&quot;&gt;&amp;#91;&lt;/span&gt;AdventureWorks&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#91;&lt;/span&gt;Sales&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#91;&lt;/span&gt;SalesOrderHeader&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#93;&lt;/span&gt; hdr&lt;br /&gt;join &lt;span style=&quot;color: #808080;&quot;&gt;&amp;#91;&lt;/span&gt;AdventureWorks&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#91;&lt;/span&gt;Sales&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#91;&lt;/span&gt;SalesOrderDetail&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#93;&lt;/span&gt; det&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;ON&lt;/span&gt; hdr.&lt;span style=&quot;color: #202020;&quot;&gt;SalesOrderID&lt;/span&gt;=det.&lt;span style=&quot;color: #202020;&quot;&gt;SalesOrderID&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; join &lt;span style=&quot;color: #808080;&quot;&gt;&amp;#91;&lt;/span&gt;AdventureWorks&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#91;&lt;/span&gt;Production&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#91;&lt;/span&gt;Product&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#93;&lt;/span&gt; p&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0000FF;&quot;&gt;ON&lt;/span&gt; det.&lt;span style=&quot;color: #202020;&quot;&gt;ProductID&lt;/span&gt;=p.&lt;span style=&quot;color: #202020;&quot;&gt;ProductID&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;WHERE&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;CONVERT&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;DATETIME&lt;/span&gt;,&lt;span style=&quot;color: #0000FF;&quot;&gt;CONVERT&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;VARCHAR&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000;&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt;,hdr.&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#91;&lt;/span&gt;OrderDate&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#93;&lt;/span&gt;,&lt;span style=&quot;color: #000;&quot;&gt;121&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt;&amp;gt;=&lt;span style=&quot;color: #0000FF;&quot;&gt;CONVERT&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;DATETIME&lt;/span&gt;, &lt;span style=&quot;color: #0000FF;&quot;&gt;CONVERT&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;VARCHAR&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000;&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt;, &lt;span style=&quot;color: #FF00FF;&quot;&gt;DATEADD&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;mm,&lt;span style=&quot;color: #000;&quot;&gt;-3&lt;/span&gt;,&lt;span style=&quot;color: #FF00FF;&quot;&gt;DATEADD&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;DAY&lt;/span&gt;,&lt;span style=&quot;color: #0000FF;&quot;&gt;DAY&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;@today&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt;*&lt;span style=&quot;color: #000;&quot;&gt;-1&lt;/span&gt;,@today&lt;span style=&quot;color: #000;&quot;&gt;+1&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt;, &lt;span style=&quot;color: #000;&quot;&gt;120&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt;, &lt;span style=&quot;color: #000;&quot;&gt;120&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;and &lt;span style=&quot;color: #0000FF;&quot;&gt;CONVERT&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;DATETIME&lt;/span&gt;,&lt;span style=&quot;color: #0000FF;&quot;&gt;CONVERT&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;VARCHAR&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000;&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt;,hdr.&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#91;&lt;/span&gt;OrderDate&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#93;&lt;/span&gt;,&lt;span style=&quot;color: #000;&quot;&gt;121&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt;&amp;lt;=&lt;span style=&quot;color: #0000FF;&quot;&gt;CONVERT&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;DATETIME&lt;/span&gt;, &lt;span style=&quot;color: #0000FF;&quot;&gt;CONVERT&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;VARCHAR&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000;&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt;, &lt;span style=&quot;color: #FF00FF;&quot;&gt;DATEADD&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;mm,&lt;span style=&quot;color: #000;&quot;&gt;0&lt;/span&gt;,@today - &lt;span style=&quot;color: #0000FF;&quot;&gt;DAY&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;@today&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt;, &lt;span style=&quot;color: #000;&quot;&gt;120&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt;, &lt;span style=&quot;color: #000;&quot;&gt;120&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;GROUP&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;BY&lt;/span&gt; hdr.&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#91;&lt;/span&gt;TerritoryID&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;br /&gt;,p.&lt;span style=&quot;color: #202020;&quot;&gt;ProductNumber&lt;/span&gt;&lt;br /&gt;,p.&lt;span style=&quot;color: #202020;&quot;&gt;Name&lt;/span&gt;&lt;br /&gt;,&lt;span style=&quot;color: #0000FF;&quot;&gt;YEAR&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;hdr.&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#91;&lt;/span&gt;OrderDate&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;br /&gt;,&lt;span style=&quot;color: #0000FF;&quot;&gt;MONTH&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;hdr.&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#91;&lt;/span&gt;OrderDate&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;br /&gt;,p.&lt;span style=&quot;color: #202020;&quot;&gt;SafetyStockLevel&lt;/span&gt;&lt;br /&gt;,p.&lt;span style=&quot;color: #202020;&quot;&gt;ReorderPoint&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;END&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb85693&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;With the stored procedure written, I&amp;#8217;ll go to SSRS 2005 and add a Matrix Report Item.  I then drag the year field to the matrix cell that displays columns, the TerritoryID field (leftmost column on desired report) to the matrix cell that displays rows and the qty field to the matrix data cell (where the columns and rows intersect).&lt;/p&gt;

&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/DataMgmt/ssrs_matrix_1.gif&quot; alt=&quot;&quot; title=&quot;&quot; width=&quot;628&quot; height=&quot;456&quot; /&gt;&lt;/div&gt;

&lt;p&gt;However, this is not a simple matrix scenario as I have several additional columns I need to display, besides the totals by month.  In order to accomplish this, I&amp;#8217;ll add row groups for each additional column.&lt;/p&gt;  
&lt;p&gt;But first, I&amp;#8217;ll start with the column groups.  I right-click above the year column group and choose &amp;#8216;Add Column Group&amp;#8217; to add the month&amp;#8230;&lt;/p&gt;
&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/DataMgmt/Add_Column_Group.gif&quot; alt=&quot;&quot; title=&quot;&quot; width=&quot;147&quot; height=&quot;98&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/DataMgmt/rw_matrix3.gif&quot; alt=&quot;&quot; title=&quot;&quot; width=&quot;488&quot; height=&quot;467&quot; /&gt;&lt;/div&gt;
&lt;p&gt;&amp;#8230;and sort on the month field:&lt;/p&gt;

&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/DataMgmt/rw_matrix4.gif&quot; alt=&quot;&quot; title=&quot;&quot; width=&quot;488&quot; height=&quot;467&quot; /&gt;&lt;/div&gt;
&lt;p&gt;That takes care of my column groups.&lt;/p&gt;

&lt;p&gt;I proceed in the same fashion for my row groups.  I right-click on the first row group and choose &amp;#8216;Add Row Group&amp;#8217;:&lt;/p&gt;
&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/DataMgmt/Add_Row_Group.gif&quot; alt=&quot;&quot; title=&quot;&quot; width=&quot;147&quot; height=&quot;98&quot; /&gt;&lt;/div&gt;
&lt;p&gt;I group (and sort) on the next field I want to appear on the report, the ProductNumber:&lt;/p&gt;

&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/DataMgmt/rw_matrix6.gif&quot; alt=&quot;&quot; title=&quot;&quot; width=&quot;488&quot; height=&quot;467&quot; /&gt;&lt;/div&gt;
&lt;p&gt;I repeat this until I have all the columns I need.  &lt;/p&gt;

&lt;p&gt;As an additional step, for each column and row group I want to sort on, I make sure I&amp;#8217;m sorting on the same field I&amp;#8217;m grouping on.  To check this, I right-click on the group and choose &amp;#8216;Edit Group&amp;#8217;:&lt;/p&gt;

&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/DataMgmt/rw_matrix7.gif&quot; alt=&quot;&quot; title=&quot;&quot; width=&quot;130&quot; height=&quot;288&quot; /&gt;&lt;/div&gt;
&lt;p&gt;Now, the headings for the row group columns are missing because the Matrix Report Item has only an empty box in the upper, lefthand corner by default.  To avoid ambiguity in the report, I add a Rectangle Report Item (to the upper, lefthand corner) then textboxes, one for each column needed:&lt;/p&gt;

&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/DataMgmt/rw_matrix8.gif&quot; alt=&quot;&quot; title=&quot;&quot; width=&quot;628&quot; height=&quot;456&quot; /&gt;&lt;/div&gt;
&lt;p&gt;I then type in the row group column headings:&lt;/p&gt;

&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/DataMgmt/rw_matrix9.gif&quot; alt=&quot;&quot; title=&quot;&quot; width=&quot;628&quot; height=&quot;456&quot; /&gt;&lt;/div&gt;
&lt;p&gt;I also apply some formatting to improve the appearance of the report, including editing the expression for month so that the month name appears:&lt;/p&gt;

&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/DataMgmt/rw_matrix10.gif&quot; alt=&quot;&quot; title=&quot;&quot; width=&quot;628&quot; height=&quot;390&quot; /&gt;&lt;/div&gt;
&lt;p&gt;And voil&amp;#224; !  Below you see the finished report that is speedy and even has column headings for the extra row group columns !&lt;/p&gt;

&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/DataMgmt/rw_matrix11.gif&quot; alt=&quot;&quot; title=&quot;&quot; width=&quot;628&quot; height=&quot;456&quot; /&gt;&lt;/div&gt;&lt;a href=&quot;http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/DataMgmt/DBProgramming/ssrs-2005-matrix&quot;&gt;&lt;img src=&quot;http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/DataMgmt/DBProgramming/ssrs-2005-matrix&amp;source=LessThanDot&quot; height=&quot;61&quot; width=&quot;51&quot; /&gt;&lt;/a&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blogs.lessthandot.com/index.php/DataMgmt/DBProgramming/ssrs-2005-matrix&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://lessthandot.com/&quot;&gt;LessThanDot&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[				<h3>by <a href="http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;author=458"> rwaters </a></h3>
				<p>Do you need an SSRS 2005 report that displays totals for the previous 3 months going horizontally across ?  Well, I did, and my first approach involved using derived tables, each with a separate date range, to get each month&#8217;s total to appear in its own column.  While I achieved my goal, performance was lousy because the query needed to execute 3 times (once for each date range).</p>
<p>I shaved 2 minutes off the query execution time with a second approach.  This alternate approach involves using a single query for the entire, 3-month date range, along with a GROUP BY clause including year and month.  For the SSRS piece, I use a matrix format to get the months to display horizontally across.  Since I have additional columns to display besides the total, I have to do some extra maneuvering, but more on that, later.</p>
<p>Here&#8217;s a look at the T-SQL code:</p>
<div class="codebox"><div class="codeheader">Code: <span>tsql</span></div><div class="codeholder"><div class="tsql" id="cb49280" style="display: block; color: rgb(0, 0, 0);"><span style="color: #0000FF;">USE</span> <span style="color: #808080;">&#91;</span>AdventureWorks<span style="color: #808080;">&#93;</span><br />GO<br /><span style="color: #0000FF;">IF</span> <span style="color: #FF00FF;">OBJECT_ID</span> <span style="color: #808080;">&#40;</span> <span style="color: #FF0000;">'dbo.usp_AdventureWorks_matrix'</span>, <span style="color: #FF0000;">'P'</span> <span style="color: #808080;">&#41;</span> <span style="color: #0000FF;">IS</span> NOT NULL <br />&nbsp; &nbsp; <span style="color: #0000FF;">DROP</span> <span style="color: #0000FF;">PROCEDURE</span> dbo.<span style="color: #202020;">usp_AdventureWorks_matrix</span>;<br />GO<br /><span style="color: #0000FF;">CREATE</span> <span style="color: #0000FF;">PROCEDURE</span> dbo.<span style="color: #202020;">usp_AdventureWorks_matrix</span><br />&nbsp;<br /><span style="color: #0000FF;">AS</span><br />&nbsp;<br /><span style="color: #0000FF;">SET</span> <span style="color: #0000FF;">NOCOUNT</span> <span style="color: #0000FF;">ON</span>;<br />&nbsp;<br /><span style="color: #0000FF;">BEGIN</span><br />&nbsp;<br /><span style="color: #0000FF;">DECLARE</span> @today <span style="color: #0000FF;">DATETIME</span><br /><span style="color: #0000FF;">SET</span> @today=<span style="color: #FF0000;">'2004-07-01 00:00:00.000'</span><br />&nbsp;<br />&nbsp;<br /><span style="color: #0000FF;">SELECT</span> <span style="color: #0000FF;">YEAR</span><span style="color: #808080;">&#40;</span>hdr.<span style="color: #808080;">&#91;</span>OrderDate<span style="color: #808080;">&#93;</span><span style="color: #808080;">&#41;</span> <span style="color: #0000FF;">AS</span> <span style="color: #0000FF;">YEAR</span><br />,<span style="color: #0000FF;">MONTH</span><span style="color: #808080;">&#40;</span>hdr.<span style="color: #808080;">&#91;</span>OrderDate<span style="color: #808080;">&#93;</span><span style="color: #808080;">&#41;</span> <span style="color: #0000FF;">AS</span> <span style="color: #0000FF;">MONTH</span><br />,hdr.<span style="color: #808080;">&#91;</span>TerritoryID<span style="color: #808080;">&#93;</span><br />,p.<span style="color: #202020;">ProductNumber</span><br />,p.<span style="color: #202020;">Name</span><br />,<span style="color: #FF00FF;">SUM</span><span style="color: #808080;">&#40;</span>det.<span style="color: #202020;">OrderQty</span><span style="color: #808080;">&#41;</span> <span style="color: #0000FF;">AS</span> qty<br />,p.<span style="color: #202020;">SafetyStockLevel</span><br />,p.<span style="color: #202020;">ReorderPoint</span><br />&nbsp;<br /><span style="color: #0000FF;">FROM</span> <span style="color: #808080;">&#91;</span>AdventureWorks<span style="color: #808080;">&#93;</span>.<span style="color: #808080;">&#91;</span>Sales<span style="color: #808080;">&#93;</span>.<span style="color: #808080;">&#91;</span>SalesOrderHeader<span style="color: #808080;">&#93;</span> hdr<br />join <span style="color: #808080;">&#91;</span>AdventureWorks<span style="color: #808080;">&#93;</span>.<span style="color: #808080;">&#91;</span>Sales<span style="color: #808080;">&#93;</span>.<span style="color: #808080;">&#91;</span>SalesOrderDetail<span style="color: #808080;">&#93;</span> det<br /><span style="color: #0000FF;">ON</span> hdr.<span style="color: #202020;">SalesOrderID</span>=det.<span style="color: #202020;">SalesOrderID</span><br />&nbsp; &nbsp; join <span style="color: #808080;">&#91;</span>AdventureWorks<span style="color: #808080;">&#93;</span>.<span style="color: #808080;">&#91;</span>Production<span style="color: #808080;">&#93;</span>.<span style="color: #808080;">&#91;</span>Product<span style="color: #808080;">&#93;</span> p<br />&nbsp; &nbsp; <span style="color: #0000FF;">ON</span> det.<span style="color: #202020;">ProductID</span>=p.<span style="color: #202020;">ProductID</span><br />&nbsp; &nbsp; <br /><span style="color: #0000FF;">WHERE</span> <span style="color: #0000FF;">CONVERT</span><span style="color: #808080;">&#40;</span><span style="color: #0000FF;">DATETIME</span>,<span style="color: #0000FF;">CONVERT</span><span style="color: #808080;">&#40;</span><span style="color: #0000FF;">VARCHAR</span><span style="color: #808080;">&#40;</span><span style="color: #000;">10</span><span style="color: #808080;">&#41;</span>,hdr.<span style="color: #808080;">&#91;</span>OrderDate<span style="color: #808080;">&#93;</span>,<span style="color: #000;">121</span><span style="color: #808080;">&#41;</span><span style="color: #808080;">&#41;</span>&gt;=<span style="color: #0000FF;">CONVERT</span><span style="color: #808080;">&#40;</span><span style="color: #0000FF;">DATETIME</span>, <span style="color: #0000FF;">CONVERT</span><span style="color: #808080;">&#40;</span><span style="color: #0000FF;">VARCHAR</span><span style="color: #808080;">&#40;</span><span style="color: #000;">10</span><span style="color: #808080;">&#41;</span>, <span style="color: #FF00FF;">DATEADD</span><span style="color: #808080;">&#40;</span>mm,<span style="color: #000;">-3</span>,<span style="color: #FF00FF;">DATEADD</span><span style="color: #808080;">&#40;</span><span style="color: #0000FF;">DAY</span>,<span style="color: #0000FF;">DAY</span><span style="color: #808080;">&#40;</span>@today<span style="color: #808080;">&#41;</span>*<span style="color: #000;">-1</span>,@today<span style="color: #000;">+1</span><span style="color: #808080;">&#41;</span><span style="color: #808080;">&#41;</span>, <span style="color: #000;">120</span><span style="color: #808080;">&#41;</span>, <span style="color: #000;">120</span><span style="color: #808080;">&#41;</span><br />and <span style="color: #0000FF;">CONVERT</span><span style="color: #808080;">&#40;</span><span style="color: #0000FF;">DATETIME</span>,<span style="color: #0000FF;">CONVERT</span><span style="color: #808080;">&#40;</span><span style="color: #0000FF;">VARCHAR</span><span style="color: #808080;">&#40;</span><span style="color: #000;">10</span><span style="color: #808080;">&#41;</span>,hdr.<span style="color: #808080;">&#91;</span>OrderDate<span style="color: #808080;">&#93;</span>,<span style="color: #000;">121</span><span style="color: #808080;">&#41;</span><span style="color: #808080;">&#41;</span>&lt;=<span style="color: #0000FF;">CONVERT</span><span style="color: #808080;">&#40;</span><span style="color: #0000FF;">DATETIME</span>, <span style="color: #0000FF;">CONVERT</span><span style="color: #808080;">&#40;</span><span style="color: #0000FF;">VARCHAR</span><span style="color: #808080;">&#40;</span><span style="color: #000;">10</span><span style="color: #808080;">&#41;</span>, <span style="color: #FF00FF;">DATEADD</span><span style="color: #808080;">&#40;</span>mm,<span style="color: #000;">0</span>,@today - <span style="color: #0000FF;">DAY</span><span style="color: #808080;">&#40;</span>@today<span style="color: #808080;">&#41;</span><span style="color: #808080;">&#41;</span>, <span style="color: #000;">120</span><span style="color: #808080;">&#41;</span>, <span style="color: #000;">120</span><span style="color: #808080;">&#41;</span> <br />&nbsp;<br /><span style="color: #0000FF;">GROUP</span> <span style="color: #0000FF;">BY</span> hdr.<span style="color: #808080;">&#91;</span>TerritoryID<span style="color: #808080;">&#93;</span><br />,p.<span style="color: #202020;">ProductNumber</span><br />,p.<span style="color: #202020;">Name</span><br />,<span style="color: #0000FF;">YEAR</span><span style="color: #808080;">&#40;</span>hdr.<span style="color: #808080;">&#91;</span>OrderDate<span style="color: #808080;">&#93;</span><span style="color: #808080;">&#41;</span> <br />,<span style="color: #0000FF;">MONTH</span><span style="color: #808080;">&#40;</span>hdr.<span style="color: #808080;">&#91;</span>OrderDate<span style="color: #808080;">&#93;</span><span style="color: #808080;">&#41;</span> <br />,p.<span style="color: #202020;">SafetyStockLevel</span><br />,p.<span style="color: #202020;">ReorderPoint</span><br />&nbsp;<br /><span style="color: #0000FF;">END</span><br /><br /></div><div id="cb69554" style="display: none; color: red;"></div></div></div>
<p>With the stored procedure written, I&#8217;ll go to SSRS 2005 and add a Matrix Report Item.  I then drag the year field to the matrix cell that displays columns, the TerritoryID field (leftmost column on desired report) to the matrix cell that displays rows and the qty field to the matrix data cell (where the columns and rows intersect).</p>

<div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/DataMgmt/ssrs_matrix_1.gif" alt="" title="" width="628" height="456" /></div>

<p>However, this is not a simple matrix scenario as I have several additional columns I need to display, besides the totals by month.  In order to accomplish this, I&#8217;ll add row groups for each additional column.</p>  
<p>But first, I&#8217;ll start with the column groups.  I right-click above the year column group and choose &#8216;Add Column Group&#8217; to add the month&#8230;</p>
<div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/DataMgmt/Add_Column_Group.gif" alt="" title="" width="147" height="98" /></div>
<div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/DataMgmt/rw_matrix3.gif" alt="" title="" width="488" height="467" /></div>
<p>&#8230;and sort on the month field:</p>

<div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/DataMgmt/rw_matrix4.gif" alt="" title="" width="488" height="467" /></div>
<p>That takes care of my column groups.</p>

<p>I proceed in the same fashion for my row groups.  I right-click on the first row group and choose &#8216;Add Row Group&#8217;:</p>
<div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/DataMgmt/Add_Row_Group.gif" alt="" title="" width="147" height="98" /></div>
<p>I group (and sort) on the next field I want to appear on the report, the ProductNumber:</p>

<div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/DataMgmt/rw_matrix6.gif" alt="" title="" width="488" height="467" /></div>
<p>I repeat this until I have all the columns I need.  </p>

<p>As an additional step, for each column and row group I want to sort on, I make sure I&#8217;m sorting on the same field I&#8217;m grouping on.  To check this, I right-click on the group and choose &#8216;Edit Group&#8217;:</p>

<div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/DataMgmt/rw_matrix7.gif" alt="" title="" width="130" height="288" /></div>
<p>Now, the headings for the row group columns are missing because the Matrix Report Item has only an empty box in the upper, lefthand corner by default.  To avoid ambiguity in the report, I add a Rectangle Report Item (to the upper, lefthand corner) then textboxes, one for each column needed:</p>

<div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/DataMgmt/rw_matrix8.gif" alt="" title="" width="628" height="456" /></div>
<p>I then type in the row group column headings:</p>

<div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/DataMgmt/rw_matrix9.gif" alt="" title="" width="628" height="456" /></div>
<p>I also apply some formatting to improve the appearance of the report, including editing the expression for month so that the month name appears:</p>

<div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/DataMgmt/rw_matrix10.gif" alt="" title="" width="628" height="390" /></div>
<p>And voil&#224; !  Below you see the finished report that is speedy and even has column headings for the extra row group columns !</p>

<div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/DataMgmt/rw_matrix11.gif" alt="" title="" width="628" height="456" /></div><a href="http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/DataMgmt/DBProgramming/ssrs-2005-matrix"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/DataMgmt/DBProgramming/ssrs-2005-matrix&amp;source=LessThanDot" height="61" width="51" /></a><div class="item_footer"><p><small><a href="http://blogs.lessthandot.com/index.php/DataMgmt/DBProgramming/ssrs-2005-matrix">Original post</a> blogged on <a href="http://lessthandot.com/">LessThanDot</a>.</small></p></div>]]></content:encoded>
								<comments>http://blogs.lessthandot.com/index.php/DataMgmt/DBProgramming/ssrs-2005-matrix#comments</comments>
		</item>
				<item>
			<title>T4 template to make multiple factories</title>
			<link>http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/t4-template-to-make-multiple-factories</link>
			<pubDate>Wed, 28 Jul 2010 11:31:26 +0000</pubDate>			<dc:creator>chrissie1</dc:creator>
			<category domain="main">Microsoft Technologies</category>
<category domain="alt">VB.NET</category>
<category domain="alt">C#</category>			<guid isPermaLink="false">913@http://blogs.lessthandot.com/</guid>
						<description>&lt;h3&gt;by &lt;a href=&quot;http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;amp;author=7&quot;&gt; chrissie1 &lt;/a&gt;&lt;/h3&gt;&lt;h2&gt;Introduction&lt;/h2&gt;

&lt;p&gt;A few days ago I made a post on &lt;a href=&quot;http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/t4-template-to-make-a-factory-class&quot;&gt;how to make a factory with T4 templates&lt;/a&gt;. That version only made one factory for one namespace. So it was pretty limiting. But as you could see, in that example, we had 2 namespaces, namely Test and Test2.&lt;br /&gt;
 &lt;/p&gt;
&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/DesktopDev/T4/T4.png&quot; alt=&quot;&quot; title=&quot;&quot; width=&quot;177&quot; height=&quot;179&quot; /&gt;&lt;/div&gt;&lt;p&gt; &lt;/p&gt;

&lt;p&gt;We need a factory for both those namespaces. We can either copy/paste or change our template to produce more files. After all, these files are nearly the same.&lt;/p&gt;

&lt;h2&gt;The code&lt;/h2&gt;

&lt;p&gt;The code for this is pretty simple, once you know how. And here it is.&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;text&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;text&quot; id=&quot;cb95675&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&amp;lt;#@ template language=&amp;quot;C#&amp;quot; #&amp;gt;&lt;br /&gt;&amp;lt;#@ output extension=&amp;quot;vb&amp;quot; #&amp;gt; &lt;br /&gt;&amp;lt;#@ VolatileAssembly processor=&amp;quot;T4Toolbox.VolatileAssemblyProcessor&amp;quot; name=&amp;quot;$(SolutionDir)/ConsoleApplication1/bin/Debug/ConsoleApplication1.exe&amp;quot; #&amp;gt;&lt;br /&gt;&amp;lt;#@ assembly name=&amp;quot;System.Core&amp;quot; #&amp;gt;&lt;br /&gt;&amp;lt;#@ import namespace=&amp;quot;System&amp;quot; #&amp;gt;&lt;br /&gt;&amp;lt;#@ import namespace=&amp;quot;System.Linq&amp;quot; #&amp;gt;&lt;br /&gt;&amp;lt;#@ import namespace=&amp;quot;System.Reflection&amp;quot; #&amp;gt;&lt;br /&gt;&amp;lt;#@ import namespace=&amp;quot;ConsoleApplication1.Test&amp;quot; #&amp;gt;&lt;br /&gt;&amp;lt;#@ import namespace=&amp;quot;System.Collections.Generic&amp;quot; #&amp;gt;&lt;br /&gt;&amp;lt;# &lt;br /&gt;var namespaces = new List&amp;lt;String&amp;gt;();&lt;br /&gt;namespaces.Add(&amp;quot;Test&amp;quot;);&lt;br /&gt;namespaces.Add(&amp;quot;Test2&amp;quot;);&lt;br /&gt;&amp;nbsp;&lt;br /&gt;string relativeOutputFilePath = &amp;quot;&amp;quot;;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;foreach(String _namespace in namespaces)&lt;br /&gt;{ #&amp;gt; ' **************************************&lt;br /&gt;' Generated code, please do not change&lt;br /&gt;' This file was last generated on &amp;lt;#= DateTime.Now #&amp;gt;&lt;br /&gt;' **************************************&lt;br /&gt;&amp;nbsp;&lt;br /&gt;Namespace ConsoleApplication1.&amp;lt;#= _namespace #&amp;gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; ''' &amp;lt;summary&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; ''' &lt;br /&gt;&amp;nbsp; &amp;nbsp; ''' &amp;lt;/summary&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;CLSCompliant(True)&amp;gt; _&lt;br /&gt;&amp;nbsp; &amp;nbsp; Public Interface IFactory&lt;br /&gt;&amp;nbsp;&lt;br /&gt;#Region &amp;quot;Methods&amp;quot;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;# var ty = typeof(Interface3);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var assem = ty.Assembly;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var types = from e in assem.GetTypes() where e.IsInterface &amp;amp;&amp;amp; e.Namespace == &amp;quot;ConsoleApplication1.&amp;quot; + _namespace select e;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if( types.Count() &amp;gt; 0)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach(var cls in types)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var _FunctionName = cls.Name.Substring(1);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ''' &amp;lt;summary&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ''' &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ''' &amp;lt;/summary&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ''' &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Function &amp;lt;#=_FunctionName#&amp;gt;() As &amp;lt;#=cls.Name#&amp;gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;#&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #&amp;gt;&lt;br /&gt;#End Region&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; End Interface&lt;br /&gt;&amp;nbsp;&lt;br /&gt;End Namespace&lt;br /&gt;&amp;lt;# &lt;br /&gt;if(!System.IO.Directory.Exists(&amp;quot;.../ConsoleApplication1/&amp;quot; + _namespace + &amp;quot;/Factory&amp;quot;))&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &amp;nbsp; System.IO.Directory.CreateDirectory(&amp;quot;.../ConsoleApplication1/&amp;quot; + _namespace + &amp;quot;/Factory&amp;quot;);&lt;br /&gt;}&lt;br /&gt;relativeOutputFilePath = &amp;quot;.../ConsoleApplication1/&amp;quot; + _namespace + &amp;quot;/Factory/IFactory.cs&amp;quot;;&lt;br /&gt;WriteTemplateOutputToFile(relativeOutputFilePath);&lt;br /&gt;}&lt;br /&gt;&amp;nbsp;#&amp;gt;&lt;br /&gt;&amp;lt;#+&lt;br /&gt;&amp;nbsp; &amp;nbsp; void WriteTemplateOutputToFile(string relativeOutputFilePath)&lt;br /&gt;&amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string outputFilePath = relativeOutputFilePath;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.IO.File.WriteAllText(outputFilePath, this.GenerationEnvironment.ToString());&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; this.GenerationEnvironment.Remove(0, this.GenerationEnvironment.Length);&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp;&lt;br /&gt;#&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb85519&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;As you can see, I added a List with namespaces, I could have just gotten them from the assembly as well. And then I have a for each which makes a template for each of those namespaces. In the end of that loop, I call WriteTemplateOutputToFile with the desired path. And now comes the important bit. &lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;text&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;text&quot; id=&quot;cb67236&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;void WriteTemplateOutputToFile(string relativeOutputFilePath)&lt;br /&gt;&amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string outputFilePath = relativeOutputFilePath;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.IO.File.WriteAllText(outputFilePath, this.GenerationEnvironment.ToString());&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; this.GenerationEnvironment.Remove(0, this.GenerationEnvironment.Length);&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb25246&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The bit of code above writes the generated code to the filesystem and clears the Generated code so that you get a blank slate to generate the next file. I also added a comment at the top of the file to warn users not to change the file since it is generated and changes will get lost when regenerated.&lt;/p&gt;

&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/DesktopDev/T4/T4_4.png&quot; alt=&quot;&quot; title=&quot;&quot; width=&quot;189&quot; height=&quot;268&quot; /&gt;&lt;/div&gt; 

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;Why write code if you can have it generated? Lazy people make good programmers and even better DBA's.&lt;br /&gt;
Adding a warning to your generated code is also important so that other people don't change it just to find out they their changes don't stick.&lt;/p&gt;


&lt;h2&gt;Resources&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://www.olegsych.com/2008/03/how-to-generate-multiple-outputs-from-single-t4-template/&quot;&gt;How to generate multiple outputs from single T4 template&lt;/a&gt; by &lt;a href=&quot;http://www.olegsych.com&quot;&gt;Oleg Sych&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://damieng.com/blog/2009/11/06/multiple-outputs-from-t4-made-easy-revisited&quot;&gt;Multiple outputs from T4 made easy &amp;#8211; revisited&lt;/a&gt; by &lt;a href=&quot;http://damieng.com/blog&quot;&gt;Damian Guard&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/2223421/t4-template-to-create-multiple-html-for-example-output-files-per-table-from-d/3070406#3070406&quot;&gt;StackOverflow answer&lt;/a&gt; to question &lt;a href=&quot;http://stackoverflow.com/questions/2223421/t4-template-to-create-multiple-html-for-example-output-files-per-table-from-d&quot;&gt;T4 template to create *multiple* html (for example) output files per table from database schema&lt;/a&gt; by &lt;a href=&quot;http://stackoverflow.com/users/12712/michael-maddox&quot;&gt;Michael Maddox&lt;/a&gt;&lt;/li&gt; 
&lt;/ul&gt;&lt;a href=&quot;http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/t4-template-to-make-multiple-factories&quot;&gt;&lt;img src=&quot;http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/t4-template-to-make-multiple-factories&amp;source=LessThanDot&quot; height=&quot;61&quot; width=&quot;51&quot; /&gt;&lt;/a&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/t4-template-to-make-multiple-factories&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://lessthandot.com/&quot;&gt;LessThanDot&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[				<h3>by <a href="http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;author=7"> chrissie1 </a></h3>
				<h2>Introduction</h2>

<p>A few days ago I made a post on <a href="http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/t4-template-to-make-a-factory-class">how to make a factory with T4 templates</a>. That version only made one factory for one namespace. So it was pretty limiting. But as you could see, in that example, we had 2 namespaces, namely Test and Test2.<br />
 </p>
<div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/DesktopDev/T4/T4.png" alt="" title="" width="177" height="179" /></div><p> </p>

<p>We need a factory for both those namespaces. We can either copy/paste or change our template to produce more files. After all, these files are nearly the same.</p>

<h2>The code</h2>

<p>The code for this is pretty simple, once you know how. And here it is.</p>

<div class="codebox"><div class="codeheader">Code: <span>text</span></div><div class="codeholder"><div class="text" id="cb13916" style="display: block; color: rgb(0, 0, 0);">&lt;#@ template language=&quot;C#&quot; #&gt;<br />&lt;#@ output extension=&quot;vb&quot; #&gt; <br />&lt;#@ VolatileAssembly processor=&quot;T4Toolbox.VolatileAssemblyProcessor&quot; name=&quot;$(SolutionDir)/ConsoleApplication1/bin/Debug/ConsoleApplication1.exe&quot; #&gt;<br />&lt;#@ assembly name=&quot;System.Core&quot; #&gt;<br />&lt;#@ import namespace=&quot;System&quot; #&gt;<br />&lt;#@ import namespace=&quot;System.Linq&quot; #&gt;<br />&lt;#@ import namespace=&quot;System.Reflection&quot; #&gt;<br />&lt;#@ import namespace=&quot;ConsoleApplication1.Test&quot; #&gt;<br />&lt;#@ import namespace=&quot;System.Collections.Generic&quot; #&gt;<br />&lt;# <br />var namespaces = new List&lt;String&gt;();<br />namespaces.Add(&quot;Test&quot;);<br />namespaces.Add(&quot;Test2&quot;);<br />&nbsp;<br />string relativeOutputFilePath = &quot;&quot;;<br />&nbsp;<br />foreach(String _namespace in namespaces)<br />{ #&gt; ' **************************************<br />' Generated code, please do not change<br />' This file was last generated on &lt;#= DateTime.Now #&gt;<br />' **************************************<br />&nbsp;<br />Namespace ConsoleApplication1.&lt;#= _namespace #&gt;<br />&nbsp;<br />&nbsp; &nbsp; ''' &lt;summary&gt;<br />&nbsp; &nbsp; ''' <br />&nbsp; &nbsp; ''' &lt;/summary&gt;<br />&nbsp; &nbsp; ''' &lt;remarks&gt;&lt;/remarks&gt;<br />&nbsp; &nbsp; &lt;CLSCompliant(True)&gt; _<br />&nbsp; &nbsp; Public Interface IFactory<br />&nbsp;<br />#Region &quot;Methods&quot;<br />&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;# var ty = typeof(Interface3);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var assem = ty.Assembly;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var types = from e in assem.GetTypes() where e.IsInterface &amp;&amp; e.Namespace == &quot;ConsoleApplication1.&quot; + _namespace select e;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if( types.Count() &gt; 0)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; foreach(var cls in types)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var _FunctionName = cls.Name.Substring(1);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; ''' &lt;summary&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; ''' <br />&nbsp; &nbsp; &nbsp; &nbsp; ''' &lt;/summary&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; ''' &lt;returns&gt;&lt;/returns&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; ''' &lt;remarks&gt;&lt;/remarks&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; Function &lt;#=_FunctionName#&gt;() As &lt;#=cls.Name#&gt;<br />&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;#<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #&gt;<br />#End Region<br />&nbsp;<br />&nbsp; &nbsp; End Interface<br />&nbsp;<br />End Namespace<br />&lt;# <br />if(!System.IO.Directory.Exists(&quot;.../ConsoleApplication1/&quot; + _namespace + &quot;/Factory&quot;))<br />{<br />&nbsp; &nbsp; System.IO.Directory.CreateDirectory(&quot;.../ConsoleApplication1/&quot; + _namespace + &quot;/Factory&quot;);<br />}<br />relativeOutputFilePath = &quot;.../ConsoleApplication1/&quot; + _namespace + &quot;/Factory/IFactory.cs&quot;;<br />WriteTemplateOutputToFile(relativeOutputFilePath);<br />}<br />&nbsp;#&gt;<br />&lt;#+<br />&nbsp; &nbsp; void WriteTemplateOutputToFile(string relativeOutputFilePath)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; string outputFilePath = relativeOutputFilePath;<br />&nbsp; &nbsp; &nbsp; &nbsp; System.IO.File.WriteAllText(outputFilePath, this.GenerationEnvironment.ToString());<br />&nbsp; &nbsp; &nbsp; &nbsp; this.GenerationEnvironment.Remove(0, this.GenerationEnvironment.Length);<br />&nbsp; &nbsp; }<br />&nbsp;<br />#&gt;<br /><br /></div><div id="cb21155" style="display: none; color: red;"></div></div></div>

<p>As you can see, I added a List with namespaces, I could have just gotten them from the assembly as well. And then I have a for each which makes a template for each of those namespaces. In the end of that loop, I call WriteTemplateOutputToFile with the desired path. And now comes the important bit. </p>

<div class="codebox"><div class="codeheader">Code: <span>text</span></div><div class="codeholder"><div class="text" id="cb11312" style="display: block; color: rgb(0, 0, 0);">void WriteTemplateOutputToFile(string relativeOutputFilePath)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; string outputFilePath = relativeOutputFilePath;<br />&nbsp; &nbsp; &nbsp; &nbsp; System.IO.File.WriteAllText(outputFilePath, this.GenerationEnvironment.ToString());<br />&nbsp; &nbsp; &nbsp; &nbsp; this.GenerationEnvironment.Remove(0, this.GenerationEnvironment.Length);<br />&nbsp; &nbsp; }<br /><br /></div><div id="cb82009" style="display: none; color: red;"></div></div></div>

<p>The bit of code above writes the generated code to the filesystem and clears the Generated code so that you get a blank slate to generate the next file. I also added a comment at the top of the file to warn users not to change the file since it is generated and changes will get lost when regenerated.</p>

<div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/DesktopDev/T4/T4_4.png" alt="" title="" width="189" height="268" /></div> 

<h2>Conclusion</h2>

<p>Why write code if you can have it generated? Lazy people make good programmers and even better DBA's.<br />
Adding a warning to your generated code is also important so that other people don't change it just to find out they their changes don't stick.</p>


<h2>Resources</h2>

<ul>
  <li><a href="http://www.olegsych.com/2008/03/how-to-generate-multiple-outputs-from-single-t4-template/">How to generate multiple outputs from single T4 template</a> by <a href="http://www.olegsych.com">Oleg Sych</a></li>
  <li><a href="http://damieng.com/blog/2009/11/06/multiple-outputs-from-t4-made-easy-revisited">Multiple outputs from T4 made easy &#8211; revisited</a> by <a href="http://damieng.com/blog">Damian Guard</a></li>
  <li><a href="http://stackoverflow.com/questions/2223421/t4-template-to-create-multiple-html-for-example-output-files-per-table-from-d/3070406#3070406">StackOverflow answer</a> to question <a href="http://stackoverflow.com/questions/2223421/t4-template-to-create-multiple-html-for-example-output-files-per-table-from-d">T4 template to create *multiple* html (for example) output files per table from database schema</a> by <a href="http://stackoverflow.com/users/12712/michael-maddox">Michael Maddox</a></li> 
</ul><a href="http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/t4-template-to-make-multiple-factories"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/t4-template-to-make-multiple-factories&amp;source=LessThanDot" height="61" width="51" /></a><div class="item_footer"><p><small><a href="http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/t4-template-to-make-multiple-factories">Original post</a> blogged on <a href="http://lessthandot.com/">LessThanDot</a>.</small></p></div>]]></content:encoded>
								<comments>http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/t4-template-to-make-multiple-factories#comments</comments>
		</item>
				<item>
			<title>SQLCop A Tool To Highlight Potential Problems With Your Database</title>
			<link>http://blogs.lessthandot.com/index.php/DataMgmt/DBAdmin/MSSQLServerAdmin/sqlcop-a-tool-to-highlight-potential-pro</link>
			<pubDate>Sun, 25 Jul 2010 18:44:38 +0000</pubDate>			<dc:creator>SQLDenis</dc:creator>
			<category domain="alt">Database Programming</category>
<category domain="main">Microsoft SQL Server Admin</category>			<guid isPermaLink="false">912@http://blogs.lessthandot.com/</guid>
						<description>&lt;h3&gt;by &lt;a href=&quot;http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;amp;author=4&quot;&gt; SQLDenis &lt;/a&gt;&lt;/h3&gt;&lt;p&gt;I wrote a blog post 437 days ago asking you the reader if you would be interested in a FxCop tool for SQL Server. That post can be found here: &lt;a href=&quot;http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/sqlcop-fxcop-for-sql-server-would-you-be&quot;&gt;SQLCop, FxCop For SQL Server, Would You Be Interested in This?&lt;/a&gt;. Today I am pleased to announce that the first version of this tool is available. The tool is free and will remain free, we will never charge for it.&lt;/p&gt;

&lt;p&gt;The tool is only 412 kb to download and no installer is needed. The reason we didn't do an add in in SSMS is because we wanted people to be able to run it it by itself. The tool was tested on Windows XP, Vista and Windows 7 (64 and 32 bit)&lt;/p&gt;

&lt;p&gt;A big thanks to &lt;a href=&quot;http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;amp;author=10&quot;&gt;George Mastros&lt;/a&gt; for coding this tool, you can also thank him on twitter here: &lt;a href=&quot;http://twitter.com/gmmastros&quot;&gt;http://twitter.com/gmmastros&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The tool will not modify any of your database, it will only check and if it find issues it will list the objects if possible. It will also show you a blog post or wiki article explaining why something is a problem and how to remedy it.&lt;/p&gt;

&lt;p&gt;To run the tool you just download it from the download link at the SQLCop homepage here: &lt;a href=&quot;http://sqlcop.lessthandot.com/index.php&quot;&gt;http://sqlcop.lessthandot.com/index.php&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that you run the tool, you will get the following login screen.&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://sqlcop.lessthandot.com/screenshots/sqlcop1.png&quot; alt=&quot;Login screen&quot; title=&quot;Login screen&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Enter the server name, database name and credentials (or windows authentication)&lt;/p&gt;


&lt;p&gt;After that you will see a screen similar to the one on the bottom. From the left side tree menu expand the node that you are interested in. When you click on an item the right part of the screen will show an html page showing you why the issue might be problematic and how to remedy it. Just remember that these issues might not be issues for you, maybe some of these objects are not used anymore but people are scared to drop them because they might break things down the road. So use your best judgement!&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://sqlcop.lessthandot.com/screenshots/sqlcop4.png&quot; alt=&quot;Issues&quot; title=&quot;Issues&quot; width=&quot;650&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
Here is a video of the tool in action so that you can see how it works before you install it&lt;/p&gt;
&lt;div class=&quot;videoblock&quot;&gt;&lt;object data=&quot;http://www.youtube.com/v/MCIZDUu2kC4&quot; type=&quot;application/x-shockwave-flash&quot; wmode=&quot;transparent&quot; width=&quot;425&quot; height=&quot;350&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/MCIZDUu2kC4&quot;&gt;&lt;/param&gt;&lt;param name=&quot;wmode&quot; value=&quot;transparent&quot;&gt;&lt;/param&gt;&lt;/object&gt;&lt;/div&gt;


&lt;p&gt;More info about this tool can be found here, including where to post questions if you have any problems: &lt;a href=&quot;http://sqlcop.lessthandot.com/index.php&quot;&gt;http://sqlcop.lessthandot.com/index.php&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also leave a comment here but we prefer you do it in the &lt;a href=&quot;http://forum.lessthandot.com/viewforum.php?f=145&quot;&gt;SQLCop help forum&lt;/a&gt; because the format is better suited for questions and answers&lt;/p&gt;&lt;a href=&quot;http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/DataMgmt/DBAdmin/MSSQLServerAdmin/sqlcop-a-tool-to-highlight-potential-pro&quot;&gt;&lt;img src=&quot;http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/DataMgmt/DBAdmin/MSSQLServerAdmin/sqlcop-a-tool-to-highlight-potential-pro&amp;source=LessThanDot&quot; height=&quot;61&quot; width=&quot;51&quot; /&gt;&lt;/a&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blogs.lessthandot.com/index.php/DataMgmt/DBAdmin/MSSQLServerAdmin/sqlcop-a-tool-to-highlight-potential-pro&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://lessthandot.com/&quot;&gt;LessThanDot&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[				<h3>by <a href="http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;author=4"> SQLDenis </a></h3>
				<p>I wrote a blog post 437 days ago asking you the reader if you would be interested in a FxCop tool for SQL Server. That post can be found here: <a href="http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/sqlcop-fxcop-for-sql-server-would-you-be">SQLCop, FxCop For SQL Server, Would You Be Interested in This?</a>. Today I am pleased to announce that the first version of this tool is available. The tool is free and will remain free, we will never charge for it.</p>

<p>The tool is only 412 kb to download and no installer is needed. The reason we didn't do an add in in SSMS is because we wanted people to be able to run it it by itself. The tool was tested on Windows XP, Vista and Windows 7 (64 and 32 bit)</p>

<p>A big thanks to <a href="http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;author=10">George Mastros</a> for coding this tool, you can also thank him on twitter here: <a href="http://twitter.com/gmmastros">http://twitter.com/gmmastros</a></p>

<p>The tool will not modify any of your database, it will only check and if it find issues it will list the objects if possible. It will also show you a blog post or wiki article explaining why something is a problem and how to remedy it.</p>

<p>To run the tool you just download it from the download link at the SQLCop homepage here: <a href="http://sqlcop.lessthandot.com/index.php">http://sqlcop.lessthandot.com/index.php</a></p>

<p>After that you run the tool, you will get the following login screen.</p>


<p><img src="http://sqlcop.lessthandot.com/screenshots/sqlcop1.png" alt="Login screen" title="Login screen" /></p>

<p>Enter the server name, database name and credentials (or windows authentication)</p>


<p>After that you will see a screen similar to the one on the bottom. From the left side tree menu expand the node that you are interested in. When you click on an item the right part of the screen will show an html page showing you why the issue might be problematic and how to remedy it. Just remember that these issues might not be issues for you, maybe some of these objects are not used anymore but people are scared to drop them because they might break things down the road. So use your best judgement!</p>


<p><img src="http://sqlcop.lessthandot.com/screenshots/sqlcop4.png" alt="Issues" title="Issues" width="650" /></p>

<p><br /><br /><br />
Here is a video of the tool in action so that you can see how it works before you install it</p>
<div class="videoblock"><object data="http://www.youtube.com/v/MCIZDUu2kC4" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"><param name="movie" value="http://www.youtube.com/v/MCIZDUu2kC4"></param><param name="wmode" value="transparent"></param></object></div>


<p>More info about this tool can be found here, including where to post questions if you have any problems: <a href="http://sqlcop.lessthandot.com/index.php">http://sqlcop.lessthandot.com/index.php</a></p>

<p>You can also leave a comment here but we prefer you do it in the <a href="http://forum.lessthandot.com/viewforum.php?f=145">SQLCop help forum</a> because the format is better suited for questions and answers</p><a href="http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/DataMgmt/DBAdmin/MSSQLServerAdmin/sqlcop-a-tool-to-highlight-potential-pro"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/DataMgmt/DBAdmin/MSSQLServerAdmin/sqlcop-a-tool-to-highlight-potential-pro&amp;source=LessThanDot" height="61" width="51" /></a><div class="item_footer"><p><small><a href="http://blogs.lessthandot.com/index.php/DataMgmt/DBAdmin/MSSQLServerAdmin/sqlcop-a-tool-to-highlight-potential-pro">Original post</a> blogged on <a href="http://lessthandot.com/">LessThanDot</a>.</small></p></div>]]></content:encoded>
								<comments>http://blogs.lessthandot.com/index.php/DataMgmt/DBAdmin/MSSQLServerAdmin/sqlcop-a-tool-to-highlight-potential-pro#comments</comments>
		</item>
				<item>
			<title>How to return error messages from the SQL Server to the client using SQLDataSource</title>
			<link>http://blogs.lessthandot.com/index.php/WebDev/WebDesignGraphicsStyling/how-to-return-error-messages-from-the-sq</link>
			<pubDate>Sun, 25 Jul 2010 17:05:20 +0000</pubDate>			<dc:creator>Naomi</dc:creator>
			<category domain="main">Web Design, Graphics &amp; Styling</category>			<guid isPermaLink="false">911@http://blogs.lessthandot.com/</guid>
						<description>&lt;h3&gt;by &lt;a href=&quot;http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;amp;author=218&quot;&gt; Naomi &lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The recent &lt;a href=&quot;http://forums.asp.net/t/1580016.aspx?PageIndex=1&quot;&gt;thread&lt;/a&gt; in ASP.NET forums is the primary reason for this blog post.&lt;/p&gt;

&lt;p&gt;I want to show how error messages from the SQL Server were handled in our web pages. The site I was working on had most of the functionality developed by the previous developer. Unfortunately, most pages didn't use a separation of layers and used SQLDataSource for data manipulations.&lt;/p&gt;

&lt;p&gt;The sample I want to show was called from InsertPerson.aspx page. For inserting a person we used the stored procedure I showed in my previous blog &lt;a href=&quot;http://blogs.lessthandot.com/index.php/WebDev/?p=553&quot;&gt;How to insert information into multiple related tables and return ID using SQLDataSource&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For inserting a new person the InsertPerson.aspx page was used that had multiview control, FormView controls with different tabs using User Controls for each tab (the tab was a special control designed by my colleague).&lt;/p&gt;

&lt;p&gt;Here is the beginning of the page's code:&lt;/p&gt;
&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;html&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;html&quot; id=&quot;cb97894&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;asp:&lt;span style=&quot;color: #000066;&quot;&gt;Label&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;ID&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;UPDATE_OPENER&amp;quot;&lt;/span&gt; runat=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;server&amp;quot;&lt;/span&gt; Visible=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;false&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;Text&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;/asp:Label&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/form.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;form&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #000066;&quot;&gt;id&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;form1&amp;quot;&lt;/span&gt; runat=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;server&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;asp:MultiView &lt;span style=&quot;color: #000066;&quot;&gt;ID&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;MltvwViewForms&amp;quot;&lt;/span&gt; runat=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;server&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;asp:View &lt;span style=&quot;color: #000066;&quot;&gt;ID&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;VwRegularPerson&amp;quot;&lt;/span&gt; runat=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;server&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;asp:SqlDataSource runat=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;ID&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;PeopleNoneDataSource&amp;quot;&lt;/span&gt; ConnectionString=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;lt;%$ ConnectionStrings:FCCMSConnectionString %&amp;gt;&lt;/span&gt;&amp;quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; InsertCommand=&amp;quot;PersonInsert&amp;quot; InsertCommandType=&amp;quot;StoredProcedure&amp;quot; OnInserted=&amp;quot;DataSource_Inserted&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;InsertParameters&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;asp:Parameter Name=&amp;quot;&lt;/span&gt;NewPersonID&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; Direction=&amp;quot;&lt;/span&gt;Output&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; Type=&amp;quot;&lt;/span&gt;Int32&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;asp:ProfileParameter Name=&amp;quot;&lt;/span&gt;SiteID&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; PropertyName=&amp;quot;&lt;/span&gt;SiteID&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; Type=&amp;quot;&lt;/span&gt;Int32&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;asp:QueryStringParameter Name=&amp;quot;&lt;/span&gt;PersonType&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; QueryStringField=&amp;quot;&lt;/span&gt;ptype&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; Type=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000066;&quot;&gt;Char&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DefaultValue=&amp;quot;&lt;/span&gt;N&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;asp:Parameter Name=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000066;&quot;&gt;Title&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;asp:Parameter Name=&amp;quot;&lt;/span&gt;Occupation&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;asp:Parameter Name=&amp;quot;&lt;/span&gt;BusinessName&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;asp:Parameter Name=&amp;quot;&lt;/span&gt;BusAdd1&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;asp:Parameter Name=&amp;quot;&lt;/span&gt;BusAdd2&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;asp:Parameter Name=&amp;quot;&lt;/span&gt;BusCity&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;asp:Parameter Name=&amp;quot;&lt;/span&gt;BusState&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;asp:Parameter Name=&amp;quot;&lt;/span&gt;BusZip&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;asp:Parameter Name=&amp;quot;&lt;/span&gt;BusEMail&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;asp:Parameter Name=&amp;quot;&lt;/span&gt;Pager&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;asp:Parameter Name=&amp;quot;&lt;/span&gt;Fax&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;asp:Parameter Name=&amp;quot;&lt;/span&gt;BusinessPhone&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;asp:Parameter Name=&amp;quot;&lt;/span&gt;SpouseFN&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;asp:Parameter Name=&amp;quot;&lt;/span&gt;SpouseLN&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;asp:Parameter Name=&amp;quot;&lt;/span&gt;SpouseID&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;asp:Parameter Name=&amp;quot;&lt;/span&gt;Anniversary&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/InsertParameters&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/asp:SqlDataSource&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;asp:FormView runat=&amp;quot;&lt;/span&gt;server&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; ID=&amp;quot;&lt;/span&gt;PeopleNoneForm&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; DefaultMode=&amp;quot;&lt;/span&gt;Insert&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; EditRowStyle-CssClass=&amp;quot;&lt;/span&gt;details_row&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DataSourceID=&amp;quot;&lt;/span&gt;PeopleNoneDataSource&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; OnItemInserted=&amp;quot;&lt;/span&gt;Form_ItemInserted&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;OnItemInserting=&amp;quot;&lt;/span&gt;Form_ItemInserting&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; &amp;nbsp;OnItemCommand=&amp;quot;&lt;/span&gt;Form_ItemCommand&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;InsertItemTemplate&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;div style=&amp;quot;&lt;/span&gt;margin-top: 20px&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ddbb00;&quot;&gt;&amp;amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;div id=&amp;quot;&lt;/span&gt;links&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;label class=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000066;&quot;&gt;link&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; id=&amp;quot;&lt;/span&gt;tab1&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; onclick=&amp;quot;&lt;/span&gt;showReport&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;,&amp;lt;%=clseditmode.NumTabs %&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;)&amp;quot; title=&amp;quot;Basic Info&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Basic Info&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/label.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;label&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #000066;&quot;&gt;class&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;link&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;id&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;tab2&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;onclick&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;showReport(2,&amp;lt;%=clseditmode.NumTabs %&amp;gt;&lt;/span&gt;)&amp;quot; title=&amp;quot;Contact Info&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Contact Info&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;label class=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000066;&quot;&gt;link&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; id=&amp;quot;&lt;/span&gt;tab3&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; onclick=&amp;quot;&lt;/span&gt;showReport&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;3&lt;/span&gt;,&amp;lt;%=clseditmode.NumTabs %&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;)&amp;quot; title=&amp;quot;User Info&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; User Info&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/label.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;label&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #000066;&quot;&gt;class&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;link&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;id&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;tab4&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;onclick&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;showReport(4,&amp;lt;%=clseditmode.NumTabs %&amp;gt;&lt;/span&gt;)&amp;quot; title=&amp;quot;Employment Info&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Employment Info&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;label class=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000066;&quot;&gt;link&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; id=&amp;quot;&lt;/span&gt;tab5&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; onclick=&amp;quot;&lt;/span&gt;showReport&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;5&lt;/span&gt;,&amp;lt;%=clseditmode.NumTabs %&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;)&amp;quot; title=&amp;quot;Family Info&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Family Info&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;% if &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;clseditmode.NumTabs == &lt;span style=&quot;color: #cc66cc;&quot;&gt;6&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt; %&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/label.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;label&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #000066;&quot;&gt;class&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;link&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;id&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;tab6&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;onclick&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;showReport(6,&amp;lt;%=clseditmode.NumTabs %&amp;gt;&lt;/span&gt;)&amp;quot; title=&amp;quot;Membership Info&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Membership Info&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/label&amp;gt;&lt;/span&gt; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;% } %&amp;gt;&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;div class=&amp;quot;&lt;/span&gt;boxMain&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;UndoSave:UndoSaveButtons ID=&amp;quot;&lt;/span&gt;btnRegular&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; runat=&amp;quot;&lt;/span&gt;server&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;!-- 1st --&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;div id=&amp;quot;&lt;/span&gt;info1&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; class=&amp;quot;&lt;/span&gt;cl&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;GenInfo:GeneralInfo ID=&amp;quot;&lt;/span&gt;GenInfoRegular&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; runat=&amp;quot;&lt;/span&gt;server&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; ShowTitle=&amp;quot;&lt;/span&gt;true&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; DOB='&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;DOB&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;'&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FirstName='&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;FirstName&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;'&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LastName='&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;LastName&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;' MiddleName='&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;MiddleName&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;' Title='&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000066;&quot;&gt;Title&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;'&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Gender='&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;Gender&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;' ShowParents=&amp;quot;false&amp;quot; SetGenderOnChangeEvent=&amp;quot;true&amp;quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ShowPicture =&amp;quot;true&amp;quot; DefaultPicture = '&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;DefaultPicture&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;' &amp;nbsp;/&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;div class=&amp;quot;&lt;/span&gt;cl&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; style=&amp;quot;&lt;/span&gt;padding-top: 26px&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;script type=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000066;&quot;&gt;text&lt;/span&gt;/javascript&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;TabNav(1,&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%=clseditmode.NumTabs %&amp;gt;&lt;/span&gt;)&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;!-- /1st --&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;!-- 2nd --&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;div id=&amp;quot;&lt;/span&gt;info2&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; class=&amp;quot;&lt;/span&gt;cl dn&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;AddrInfo:AddressInfo ID=&amp;quot;&lt;/span&gt;AddressInfoRegular&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; runat=&amp;quot;&lt;/span&gt;server&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; Address1='&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;Address1&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;'&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Address2='&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;Address2&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;' CellPhone='&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;CellPhone&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;' City='&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;City&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;'&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Zip='&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;Zip&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;' State='&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;State&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;' ScreenName='&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;ScreenName&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;'&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; HomePhone='&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;HomePhone&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;' &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Email='&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;Email&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;' &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SecondEmail='&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;SecondEmail&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;'/&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;div class=&amp;quot;&lt;/span&gt;cl&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; style=&amp;quot;&lt;/span&gt;padding-top: 15px&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;script type=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000066;&quot;&gt;text&lt;/span&gt;/javascript&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;TabNav(2,&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%=clseditmode.NumTabs %&amp;gt;&lt;/span&gt;)&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;!-- /2nd --&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;!-- 3rd --&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;div id=&amp;quot;&lt;/span&gt;info3&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; class=&amp;quot;&lt;/span&gt;cl dn&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;UserInfo:UserInfo ID=&amp;quot;&lt;/span&gt;UserInfoRegular&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; runat=&amp;quot;&lt;/span&gt;server&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; Pwd='&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;Pwd&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;' UserName='&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;UserName&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;' /&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;div class=&amp;quot;&lt;/span&gt;cl&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; style=&amp;quot;&lt;/span&gt;padding-top: 26px&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;script type=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000066;&quot;&gt;text&lt;/span&gt;/javascript&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;TabNav(3,&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%=clseditmode.NumTabs %&amp;gt;&lt;/span&gt;)&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;!-- /3rd --&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;!-- 4th --&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;div id=&amp;quot;&lt;/span&gt;info4&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; class=&amp;quot;&lt;/span&gt;cl dn&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;BusInfo:BussinessInfo ID=&amp;quot;&lt;/span&gt;BussinessInfoRegular&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; runat=&amp;quot;&lt;/span&gt;server&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; Occupation='&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;Occupation&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;'&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BusinessName='&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;BusinessName&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;' BusAdd1='&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;BusAdd1&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;' BusAdd2='&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;BusAdd2&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;'&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BusCity='&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;BusCity&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;' BusState='&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;BusState&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;' BusZip='&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;BusZip&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;'&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Pager='&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;Pager&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;' Fax='&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;Fax&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;' BusinessPhone='&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;BusinessPhone&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;' /&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;div class=&amp;quot;&lt;/span&gt;cl&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; style=&amp;quot;&lt;/span&gt;padding-top: 26px&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;script type=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000066;&quot;&gt;text&lt;/span&gt;/javascript&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;TabNav(4,&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%=clseditmode.NumTabs %&amp;gt;&lt;/span&gt;)&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;!-- /4th --&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;!-- 5th --&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;div id=&amp;quot;&lt;/span&gt;info5&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; class=&amp;quot;&lt;/span&gt;cl dn&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;div class=&amp;quot;&lt;/span&gt;cl&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;label class=&amp;quot;&lt;/span&gt;bx&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Spouse&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;span class=&amp;quot;&lt;/span&gt;bx&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; id=&amp;quot;&lt;/span&gt;spouseName&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;Custom:AutoSuggestBox ID=&amp;quot;&lt;/span&gt;asbSpouse&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; ToolTip=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000066;&quot;&gt;Start&lt;/span&gt; typing and select from the list&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;runat=&amp;quot;&lt;/span&gt;server&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; DataType = '&amp;lt;%# Eval(&amp;quot;&lt;/span&gt;Gender&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) ==&amp;quot;&lt;/span&gt;M&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;?&amp;quot;&lt;/span&gt;Mother&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;:&amp;quot;&lt;/span&gt;Father&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; %&amp;gt;&lt;/span&gt;' IncludeMoreMenuItem=&amp;quot;True&amp;quot; KeyPressDelay=&amp;quot;300&amp;quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MaxSuggestChars=&amp;quot;5&amp;quot; MoreMenuItemLabel=&amp;quot;...&amp;quot; NumMenuItems=&amp;quot;10&amp;quot; ResourcesDir=&amp;quot;/asb_includes&amp;quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SelectedValue='&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;SpouseID&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;' SelMenuItemCSSClass=&amp;quot;asbSelMenuItem&amp;quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; OnPreRender=&amp;quot;AsbPrerender&amp;quot; UseIFrame=&amp;quot;True&amp;quot; MaxLength=&amp;quot;80&amp;quot;&amp;gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/Custom:AutoSuggestBox&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;span class=&amp;quot;&lt;/span&gt;bx&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; style=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000066;&quot;&gt;width&lt;/span&gt;: 180px&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;a href=&amp;lt;%# clseditmode.CreateLink(Eval(&amp;quot;&lt;/span&gt;SpouseID&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;),&amp;quot;&lt;/span&gt;AddressInfoRegular&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;,&amp;quot;&lt;/span&gt;Spouse&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;label class=&amp;quot;&lt;/span&gt;bx&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Anniversary&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;span class=&amp;quot;&lt;/span&gt;bx&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;asp:TextBox ID=&amp;quot;&lt;/span&gt;tbAnniversary&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; runat=&amp;quot;&lt;/span&gt;server&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;AutoCompleteType=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000066;&quot;&gt;Disabled&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; Text='&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;Anniversary&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;, &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;:M/d/yyyy&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;'&amp;gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/asp:TextBox&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;asp:RegularExpressionValidator ID=&amp;quot;&lt;/span&gt;regexAnniversary&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; runat=&amp;quot;&lt;/span&gt;server&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; ControlToValidate=&amp;quot;&lt;/span&gt;tbAnniversary&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Display=&amp;quot;&lt;/span&gt;Dynamic&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; ErrorMessage=&amp;quot;&lt;/span&gt;Incorrect Anniversary &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;m/d/yyyy&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ValidationExpression=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;?:&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;?:&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;?:&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;?&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;13578&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;|&lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;02&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;\/|-|\.&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;31&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;\&lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;|&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;?:&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;?:&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;?&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;13&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;-9&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;|&lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;-2&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;\/|-|\.&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;?:&lt;span style=&quot;color: #cc66cc;&quot;&gt;29&lt;/span&gt;|&lt;span style=&quot;color: #cc66cc;&quot;&gt;30&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;\&lt;span style=&quot;color: #cc66cc;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;?:&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;?:&lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;6&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;-9&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;|&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;-9&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;\d&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;?\d&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;$|^&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;?:&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;?&lt;span style=&quot;color: #cc66cc;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;\/|-|\.&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;29&lt;/span&gt;\&lt;span style=&quot;color: #cc66cc;&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;?:&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;?:&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;?:&lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;6&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;-9&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;|&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;-9&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;\d&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;?&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;?:&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;48&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;|&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;2468&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;048&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;|&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;13579&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;26&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;|&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;?:&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;?:&lt;span style=&quot;color: #cc66cc;&quot;&gt;16&lt;/span&gt;|&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;2468&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;048&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;|&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;3579&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;26&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;00&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;$|^&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;?:&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;?:&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;?&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;-9&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;|&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;?:&lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;-2&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;\/|-|\.&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;?:&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;?&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;-9&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;|&lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;\d|&lt;span style=&quot;color: #cc66cc;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;-8&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;\&lt;span style=&quot;color: #cc66cc;&quot;&gt;4&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;?:&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;?:&lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;6&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;-9&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;|&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;-9&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;\d&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;?\d&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/asp:RegularExpressionValidator&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;label class=&amp;quot;&lt;/span&gt;bx&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;Marital Status&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;span class=&amp;quot;&lt;/span&gt;bx&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;asp:DropDownList runat=&amp;quot;&lt;/span&gt;server&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; ID=&amp;quot;&lt;/span&gt;drpMsts&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; SelectedValue='&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;MaritalStatus&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;'&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;asp:ListItem Value=&amp;quot;&lt;/span&gt;M&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;Married&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/asp:ListItem&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;asp:ListItem Value=&amp;quot;&lt;/span&gt;D&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;Divorced&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/asp:ListItem&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;asp:ListItem Value=&amp;quot;&lt;/span&gt;S&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;Separated&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/asp:ListItem&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;asp:ListItem Value=&amp;quot;&lt;/span&gt;W&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;Widowed&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/asp:ListItem&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/asp:DropDownList&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;div class=&amp;quot;&lt;/span&gt;cl&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;label class=&amp;quot;&lt;/span&gt;bx&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Father&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;span class=&amp;quot;&lt;/span&gt;bx&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; id = &amp;quot;&lt;/span&gt;fatherName&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;Custom:AutoSuggestBox ID=&amp;quot;&lt;/span&gt;fatherName&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; Text='&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;Father&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;'&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DataType=&amp;quot;Father&amp;quot; MaxLength=&amp;quot;100&amp;quot; OnPreRender=&amp;quot;AsbPrerender&amp;quot; ToolTip=&amp;quot;Start typing and select from the list&amp;quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; runat=&amp;quot;server&amp;quot; ResourcesDir=&amp;quot;/asb_includes&amp;quot; /&amp;gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;span class=&amp;quot;&lt;/span&gt;bx&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; style=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000066;&quot;&gt;width&lt;/span&gt;: 180px&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;a href=&amp;lt;%# clseditmode.CreateLink(Eval(&amp;quot;&lt;/span&gt;FatherID&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;),&amp;quot;&lt;/span&gt;AddressInfoRegular&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;,&amp;quot;&lt;/span&gt;Father&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;div class=&amp;quot;&lt;/span&gt;cl&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;label class=&amp;quot;&lt;/span&gt;bx&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Mother&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;span class=&amp;quot;&lt;/span&gt;bx&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; id =&amp;quot;&lt;/span&gt;motherName&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;Custom:AutoSuggestBox ID=&amp;quot;&lt;/span&gt;motherName&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; Text='&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;Mother&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;'&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DataType=&amp;quot;Mother&amp;quot; MaxLength=&amp;quot;100&amp;quot; OnPreRender=&amp;quot;AsbPrerender&amp;quot; ToolTip=&amp;quot;Start typing and select from the list&amp;quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; runat=&amp;quot;server&amp;quot; ResourcesDir=&amp;quot;/asb_includes&amp;quot; /&amp;gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;span class=&amp;quot;&lt;/span&gt;bx&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; style=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000066;&quot;&gt;width&lt;/span&gt;: 180px&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;a href=&amp;lt;%# clseditmode.CreateLink(Eval(&amp;quot;&lt;/span&gt;MotherID&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;),&amp;quot;&lt;/span&gt;AddressInfoRegular&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;,&amp;quot;&lt;/span&gt;Mother&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;div class=&amp;quot;&lt;/span&gt;cl&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;label class=&amp;quot;&lt;/span&gt;bx&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Comment&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;span class=&amp;quot;&lt;/span&gt;bx&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;asp:TextBox ID=&amp;quot;&lt;/span&gt;txtComment&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; Width=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;120&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; Text='&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;Comment&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;'&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TextMode=&amp;quot;MultiLine&amp;quot; runat=&amp;quot;server&amp;quot; AutoCompleteType=&amp;quot;Disabled&amp;quot; /&amp;gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;div class=&amp;quot;&lt;/span&gt;cl&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; style=&amp;quot;&lt;/span&gt;padding-top: 26px&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;script type=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000066;&quot;&gt;text&lt;/span&gt;/javascript&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;TabNav(5,&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%=clseditmode.NumTabs %&amp;gt;&lt;/span&gt;)&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;!-- /5th --&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;% if (clseditmode.NumTabs == 6) { %&amp;gt;&lt;/span&gt; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;!-- 6th --&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;div id=&amp;quot;&lt;/span&gt;info6&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; class=&amp;quot;&lt;/span&gt;cl dn&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;MembInfo:MembershipInfo ID=&amp;quot;&lt;/span&gt;MembershipInfoRegular&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; runat=&amp;quot;&lt;/span&gt;server&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BillQuaterly ='&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;BillQuaterly&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;' IsMember ='&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;IsMember&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;'&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PaymentMethod='&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;PaymentMethod&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;' StartDate ='&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%# Bind(&amp;quot;&lt;/span&gt;StartDate&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;) %&amp;gt;&lt;/span&gt;' /&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;div class=&amp;quot;&lt;/span&gt;cl&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; style=&amp;quot;&lt;/span&gt;padding-top: 26px&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;script type=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000066;&quot;&gt;text&lt;/span&gt;/javascript&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;TabNav(6,&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%=clseditmode.NumTabs %&amp;gt;&lt;/span&gt;)&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;!-- /6th --&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;% } %&amp;gt;&lt;/span&gt; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;script type=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000066;&quot;&gt;text&lt;/span&gt;/javascript&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&lt;/span&gt;showReport(1,&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%=clseditmode.NumTabs %&amp;gt;&lt;/span&gt;);&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/InsertItemTemplate&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;EditRowStyle CssClass=&amp;quot;&lt;/span&gt;details_row&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/asp:FormView&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;/asp:View&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;!-- End of the Regular Person --&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb53492&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;etc.&lt;/p&gt;

&lt;p&gt;The InsertPerson.cs (code behind) had the following code in regards to showing the error message:&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;c#&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;c#&quot; id=&quot;cb29525&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/// Display message&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/// &amp;lt;param name=&amp;quot;msg&amp;quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/// &amp;lt;param name=&amp;quot;CloseWindow&amp;quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; protected &lt;span style=&quot;color: #993333;&quot;&gt;void&lt;/span&gt; DisplayMessage&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #993333;&quot;&gt;string&lt;/span&gt; msg, bool CloseWindow&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #993333;&quot;&gt;string&lt;/span&gt; Script=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;Request.&lt;span style=&quot;color: #202020;&quot;&gt;QueryString&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;pid&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; != &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt; &amp;amp;&amp;amp; Request.&lt;span style=&quot;color: #202020;&quot;&gt;QueryString&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;pid&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span style=&quot;color: #202020;&quot;&gt;Length&lt;/span&gt; &amp;gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;msg != &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt; Script = &lt;span style=&quot;color: #993333;&quot;&gt;string&lt;/span&gt;.&lt;span style=&quot;color: #202020;&quot;&gt;Format&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;alert(&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\&amp;quot;&lt;/span&gt;{0}&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\&amp;quot;&lt;/span&gt;);&amp;quot;&lt;/span&gt;, msg&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; + &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;CloseWindow ? &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;window.close;&amp;quot;&lt;/span&gt; : &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Script = &lt;span style=&quot;color: #993333;&quot;&gt;string&lt;/span&gt;.&lt;span style=&quot;color: #202020;&quot;&gt;Format&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;parent.DisplayMessage(&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\&amp;quot;&lt;/span&gt;{0}&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\&amp;quot;&lt;/span&gt;);&amp;quot;&lt;/span&gt;, msg&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;Script!=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;this.&lt;span style=&quot;color: #202020;&quot;&gt;ClientScript&lt;/span&gt;.&lt;span style=&quot;color: #202020;&quot;&gt;RegisterClientScriptBlock&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;this.&lt;span style=&quot;color: #202020;&quot;&gt;GetType&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;, &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Message&amp;quot;&lt;/span&gt;, Script, &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb36286&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The way the error was passed back to the client was handled in Form_ItemInserted event:&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;c#&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;c#&quot; id=&quot;cb67015&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;protected &lt;span style=&quot;color: #993333;&quot;&gt;void&lt;/span&gt; Form_ItemInserted&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;object sender, FormViewInsertedEventArgs e&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #993333;&quot;&gt;string&lt;/span&gt; Text;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bool CloseWindow = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;false&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;e.&lt;span style=&quot;color: #202020;&quot;&gt;Exception&lt;/span&gt; == &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;Request.&lt;span style=&quot;color: #202020;&quot;&gt;QueryString&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;pid&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; != &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt; &amp;amp;&amp;amp; Request.&lt;span style=&quot;color: #202020;&quot;&gt;QueryString&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;pid&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;.&lt;span style=&quot;color: #202020;&quot;&gt;Length&lt;/span&gt; &amp;gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Text = &lt;span style=&quot;color: #993333;&quot;&gt;string&lt;/span&gt;.&lt;span style=&quot;color: #202020;&quot;&gt;Format&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;You just inserted {0} {1}&amp;quot;&lt;/span&gt;, e.&lt;span style=&quot;color: #202020;&quot;&gt;Values&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;FirstName&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;, e.&lt;span style=&quot;color: #202020;&quot;&gt;Values&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;LastName&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; this.&lt;span style=&quot;color: #202020;&quot;&gt;UPDATE_OPENER&lt;/span&gt;.&lt;span style=&quot;color: #202020;&quot;&gt;Text&lt;/span&gt; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;lt;script language=&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\&amp;quot;&lt;/span&gt;JavaScript&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\&amp;quot;&lt;/span&gt;&amp;gt;changeParent('&amp;quot;&lt;/span&gt; + Request.&lt;span style=&quot;color: #202020;&quot;&gt;QueryString&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;pid&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; + &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;','&amp;quot;&lt;/span&gt; + e.&lt;span style=&quot;color: #202020;&quot;&gt;Values&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;LastName&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; + &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;, &amp;quot;&lt;/span&gt; + e.&lt;span style=&quot;color: #202020;&quot;&gt;Values&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;FirstName&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; + &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt; + &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;e.&lt;span style=&quot;color: #202020;&quot;&gt;Values&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;MiddleName&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt; ?? &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; + &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;',&amp;quot;&lt;/span&gt; + &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; this.&lt;span style=&quot;color: #202020;&quot;&gt;NewPersonID&lt;/span&gt; + &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;,'&amp;quot;&lt;/span&gt; + Text.&lt;span style=&quot;color: #202020;&quot;&gt;Replace&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;'&amp;quot;&lt;/span&gt;,&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\\&lt;/span&gt;'&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &amp;nbsp;+ &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;');&amp;lt;/script&amp;gt;&amp;quot;&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CloseWindow = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;true&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; this.&lt;span style=&quot;color: #202020;&quot;&gt;UPDATE_OPENER&lt;/span&gt;.&lt;span style=&quot;color: #202020;&quot;&gt;Visible&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;true&lt;/span&gt;; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Text = &lt;span style=&quot;color: #993333;&quot;&gt;string&lt;/span&gt;.&lt;span style=&quot;color: #202020;&quot;&gt;Format&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;You just inserted {0} {1} &amp;lt;a href='peopleV.aspx?perid={2}'&amp;gt;&amp;quot;&lt;/span&gt; +&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Edit Here&amp;lt;/a&amp;gt;&amp;quot;&lt;/span&gt;, e.&lt;span style=&quot;color: #202020;&quot;&gt;Values&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;FirstName&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;, e.&lt;span style=&quot;color: #202020;&quot;&gt;Values&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;LastName&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;, this.&lt;span style=&quot;color: #202020;&quot;&gt;NewPersonID&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; this.&lt;span style=&quot;color: #202020;&quot;&gt;DisplayMessage&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;Text, CloseWindow&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; this.&lt;span style=&quot;color: #202020;&quot;&gt;MltvwViewForms&lt;/span&gt;.&lt;span style=&quot;color: #202020;&quot;&gt;Visible&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;false&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Exception case&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Text = &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;The data was entered in an incorrect format, please check it over.&amp;quot;&lt;/span&gt; +&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt; + e.&lt;span style=&quot;color: #202020;&quot;&gt;Exception&lt;/span&gt;.&lt;span style=&quot;color: #202020;&quot;&gt;Message&lt;/span&gt;.&lt;span style=&quot;color: #202020;&quot;&gt;Replace&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;Environment.&lt;span style=&quot;color: #202020;&quot;&gt;NewLine&lt;/span&gt;, &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\\&lt;/span&gt;n&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #202020;&quot;&gt;Replace&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\&amp;quot;&lt;/span&gt;&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\\&lt;/span&gt;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\&amp;quot;&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; this.&lt;span style=&quot;color: #202020;&quot;&gt;DisplayMessage&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;Text, CloseWindow&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.&lt;span style=&quot;color: #202020;&quot;&gt;ExceptionHandled&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;true&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.&lt;span style=&quot;color: #202020;&quot;&gt;KeepInInsertMode&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;true&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb10142&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The page calling the InsertPerson page was called CreatePerson.aspx and had the following ASPX code:&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;html&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;html&quot; id=&quot;cb55775&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;%@ Page &lt;span style=&quot;color: #000066;&quot;&gt;Language&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;C#&amp;quot;&lt;/span&gt; MasterPageFile=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;~/admin.master&amp;quot;&lt;/span&gt; AutoEventWireup=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt; CodeFile=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;CreatePerson.aspx.cs&amp;quot;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; Theme=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Profesional&amp;quot;&lt;/span&gt; Inherits=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Coordinator_People_CreatePerson&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;Title&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Create Users&amp;quot;&lt;/span&gt; %&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;asp:&lt;span style=&quot;color: #000066;&quot;&gt;Content&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;ID&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Content1&amp;quot;&lt;/span&gt; ContentPlaceHolderID=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;ContentPlaceHolder1&amp;quot;&lt;/span&gt; runat=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Server&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/div.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;div&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #000066;&quot;&gt;id&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;spnStatFrame&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;style&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;display:none;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/table.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;table&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #000066;&quot;&gt;style&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;font-weight: bolder; vertical-align: middle; color: #FFFFFF; width: 32%; text-align: center;&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;cellpadding&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;0&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;cellspacing&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;0&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/tr.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/td.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/img.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;img&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #000066;&quot;&gt;alt&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;src&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;../../images/tl-LightBlue.gif&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;height&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;10&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;width&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;10&amp;quot;&lt;/span&gt; /&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/td.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;td&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #000066;&quot;&gt;style&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;background-color: #5BA2EB;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #ddbb00;&quot;&gt;&amp;amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/td.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/img.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;img&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #000066;&quot;&gt;alt&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;src&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;../../images/tr-LightBlue.gif&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;height&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;10&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;width&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;10&amp;quot;&lt;/span&gt; /&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/tr.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;tr&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #000066;&quot;&gt;style&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;background-color: #5BA2EB;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/td.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;color: #ddbb00;&quot;&gt;&amp;amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/td.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/span.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;span&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #000066;&quot;&gt;id&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;spnStat&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/td.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;color: #ddbb00;&quot;&gt;&amp;amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/tr.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/td.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/img.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;img&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #000066;&quot;&gt;alt&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;src&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;../../images/bl-LightBlue.gif&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;height&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;10&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;width&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;10&amp;quot;&lt;/span&gt; /&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/td.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;td&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #000066;&quot;&gt;style&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;background-color: #5BA2EB;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #ddbb00;&quot;&gt;&amp;amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/td.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/img.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;img&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #000066;&quot;&gt;alt&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;src&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;../../images/br-LightBlue.gif&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;height&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;10&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;width&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;10&amp;quot;&lt;/span&gt; /&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/script.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;script&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #000066;&quot;&gt;type&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; var dv = document.getElementById(&amp;quot;spnStatFrame&amp;quot;);&lt;br /&gt;&amp;nbsp; &amp;nbsp; var Spn = document.getElementById(&amp;quot;spnStat&amp;quot;);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; function DisplayMessage(Message)&lt;br /&gt;&amp;nbsp; &amp;nbsp; { &amp;nbsp; if (Message !=&amp;quot;&amp;quot;){ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dv.style.display = &amp;quot;inline&amp;quot;; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Spn.innerHTML = Message;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; setTimeout(&amp;quot;dv.style.display = 'none'&amp;quot;, 300000);}&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dv.style.display = &amp;quot;none&amp;quot;; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/div.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;div&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #000066;&quot;&gt;class&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;p5&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;style&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;text-align:right&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; View all People &lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/a.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;a&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #000066;&quot;&gt;href&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;peopleV.aspx&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/img.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;img&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #000066;&quot;&gt;alt&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;View People&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;src&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;../../images/id_card_view.png&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;title&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;View all People&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;class&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;peopleVNavIcon&amp;quot;&lt;/span&gt;/&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/div.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;div&amp;gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;Create a&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/select.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;select&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #000066;&quot;&gt;id&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;PersonType&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;PersonType&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;onchange&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;javascript:go();&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/option.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;option&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #000066;&quot;&gt;selected&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;selected&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;value&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;--Choose a Person Type--&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/option&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/option.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;option&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #000066;&quot;&gt;value&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;InsertPerson.aspx?ptype=B&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;Special Friend&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/option&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/option.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;option&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #000066;&quot;&gt;value&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;InsertPerson.aspx?ptype=N&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;Regular Person&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/option&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/option.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;option&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #000066;&quot;&gt;value&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;InsertPerson.aspx?ptype=A&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;Adult Volunteer&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/option&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -- other options --&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/select&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/iframe.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;iframe&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #000066;&quot;&gt;id&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;myframe&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;scrolling&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;no&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;marginwidth&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;0&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;marginheight&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;0&amp;quot;&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color: #000066;&quot;&gt;frameborder&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;0&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;style&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;text-align: center; overflow: visible; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt; &amp;nbsp; &amp;nbsp;width:710px; display: none;&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/iframe&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/div.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;div&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #000066;&quot;&gt;id&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;loading&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;class&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;more&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;Loading...&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;a href=&quot;http://december.com/html/4/element/script.html&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;script&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #000066;&quot;&gt;type&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;text/ecmascript&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; var loading = document.getElementById(&amp;quot;loading&amp;quot;);&lt;br /&gt;&amp;nbsp; &amp;nbsp; function go()&lt;br /&gt;&amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var SelInsert = document.getElementById(&amp;quot;PersonType&amp;quot;);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(SelInsert.selectedIndex != 0){&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; loading.style.display = 'block'&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var frm =loadintoIframe('myframe', SelInsert.options[SelInsert.selectedIndex].value);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DisplayMessage(&amp;quot;&amp;quot;); &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //setTimeout(&amp;quot;loading.style.display = 'none'&amp;quot;, 5000); &amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //var x=document.getElementById(&amp;quot;myframe&amp;quot;).contentDocument;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // This doesn't work for User Controls &amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //document.frames[&amp;quot;myframe&amp;quot;].onload = function() {showReqFld(); };&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; } &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt;/asp:Content&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb41636&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So, hopefully you see the logic of the pages. The CreatePerson page had a place to show an error message or a link if the insert worked correctly. From the InsertPerson page we manipulated the parent CreatePerson page and displayed the appropriate message (either the error message or a link to edit a newly inserted person).&lt;/p&gt;&lt;a href=&quot;http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/WebDev/WebDesignGraphicsStyling/how-to-return-error-messages-from-the-sq&quot;&gt;&lt;img src=&quot;http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/WebDev/WebDesignGraphicsStyling/how-to-return-error-messages-from-the-sq&amp;source=LessThanDot&quot; height=&quot;61&quot; width=&quot;51&quot; /&gt;&lt;/a&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blogs.lessthandot.com/index.php/WebDev/WebDesignGraphicsStyling/how-to-return-error-messages-from-the-sq&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://lessthandot.com/&quot;&gt;LessThanDot&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[				<h3>by <a href="http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;author=218"> Naomi </a></h3>
				<p>The recent <a href="http://forums.asp.net/t/1580016.aspx?PageIndex=1">thread</a> in ASP.NET forums is the primary reason for this blog post.</p>

<p>I want to show how error messages from the SQL Server were handled in our web pages. The site I was working on had most of the functionality developed by the previous developer. Unfortunately, most pages didn't use a separation of layers and used SQLDataSource for data manipulations.</p>

<p>The sample I want to show was called from InsertPerson.aspx page. For inserting a person we used the stored procedure I showed in my previous blog <a href="http://blogs.lessthandot.com/index.php/WebDev/?p=553">How to insert information into multiple related tables and return ID using SQLDataSource</a>.</p>

<p>For inserting a new person the InsertPerson.aspx page was used that had multiview control, FormView controls with different tabs using User Controls for each tab (the tab was a special control designed by my colleague).</p>

<p>Here is the beginning of the page's code:</p>
<div class="codebox"><div class="codeheader">Code: <span>html</span></div><div class="codeholder"><div class="html" id="cb93619" style="display: block; color: rgb(0, 0, 0);"><span style="color: #009900;">&lt;asp:<span style="color: #000066;">Label</span> <span style="color: #000066;">ID</span>=<span style="color: #ff0000;">&quot;UPDATE_OPENER&quot;</span> runat=<span style="color: #ff0000;">&quot;server&quot;</span> Visible=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000066;">Text</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;</span>/asp:Label&gt;</span><br />&nbsp; &nbsp; <br />&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/form.html"><span style="color: #000000; font-weight: bold;">&lt;form</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;form1&quot;</span> runat=<span style="color: #ff0000;">&quot;server&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span> &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; <span style="color: #009900;">&lt;asp:MultiView <span style="color: #000066;">ID</span>=<span style="color: #ff0000;">&quot;MltvwViewForms&quot;</span> runat=<span style="color: #ff0000;">&quot;server&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;asp:View <span style="color: #000066;">ID</span>=<span style="color: #ff0000;">&quot;VwRegularPerson&quot;</span> runat=<span style="color: #ff0000;">&quot;server&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;asp:SqlDataSource runat=<span style="color: #ff0000;">&quot;server&quot;</span> <span style="color: #000066;">ID</span>=<span style="color: #ff0000;">&quot;PeopleNoneDataSource&quot;</span> ConnectionString=<span style="color: #ff0000;">&quot;&lt;%$ ConnectionStrings:FCCMSConnectionString %&gt;</span>&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; InsertCommand=&quot;PersonInsert&quot; InsertCommandType=&quot;StoredProcedure&quot; OnInserted=&quot;DataSource_Inserted&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;InsertParameters&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;asp:Parameter Name=&quot;</span>NewPersonID<span style="color: #ff0000;">&quot; Direction=&quot;</span>Output<span style="color: #ff0000;">&quot; Type=&quot;</span>Int32<span style="color: #ff0000;">&quot; /&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;asp:ProfileParameter Name=&quot;</span>SiteID<span style="color: #ff0000;">&quot; PropertyName=&quot;</span>SiteID<span style="color: #ff0000;">&quot; Type=&quot;</span>Int32<span style="color: #ff0000;">&quot; /&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;asp:QueryStringParameter Name=&quot;</span>PersonType<span style="color: #ff0000;">&quot; QueryStringField=&quot;</span>ptype<span style="color: #ff0000;">&quot; Type=&quot;</span><span style="color: #000066;">Char</span><span style="color: #ff0000;">&quot;</span><br /><span style="color: #ff0000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DefaultValue=&quot;</span>N<span style="color: #ff0000;">&quot; /&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;asp:Parameter Name=&quot;</span><span style="color: #000066;">Title</span><span style="color: #ff0000;">&quot; /&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;asp:Parameter Name=&quot;</span>Occupation<span style="color: #ff0000;">&quot; /&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;asp:Parameter Name=&quot;</span>BusinessName<span style="color: #ff0000;">&quot; /&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;asp:Parameter Name=&quot;</span>BusAdd1<span style="color: #ff0000;">&quot; /&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;asp:Parameter Name=&quot;</span>BusAdd2<span style="color: #ff0000;">&quot; /&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;asp:Parameter Name=&quot;</span>BusCity<span style="color: #ff0000;">&quot; /&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;asp:Parameter Name=&quot;</span>BusState<span style="color: #ff0000;">&quot; /&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;asp:Parameter Name=&quot;</span>BusZip<span style="color: #ff0000;">&quot; /&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;asp:Parameter Name=&quot;</span>BusEMail<span style="color: #ff0000;">&quot; /&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;asp:Parameter Name=&quot;</span>Pager<span style="color: #ff0000;">&quot; /&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;asp:Parameter Name=&quot;</span>Fax<span style="color: #ff0000;">&quot; /&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;asp:Parameter Name=&quot;</span>BusinessPhone<span style="color: #ff0000;">&quot; /&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;asp:Parameter Name=&quot;</span>SpouseFN<span style="color: #ff0000;">&quot; /&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;asp:Parameter Name=&quot;</span>SpouseLN<span style="color: #ff0000;">&quot; /&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;asp:Parameter Name=&quot;</span>SpouseID<span style="color: #ff0000;">&quot; /&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;asp:Parameter Name=&quot;</span>Anniversary<span style="color: #ff0000;">&quot; /&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;/InsertParameters&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;/asp:SqlDataSource&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;asp:FormView runat=&quot;</span>server<span style="color: #ff0000;">&quot; ID=&quot;</span>PeopleNoneForm<span style="color: #ff0000;">&quot; DefaultMode=&quot;</span>Insert<span style="color: #ff0000;">&quot; EditRowStyle-CssClass=&quot;</span>details_row<span style="color: #ff0000;">&quot;</span><br /><span style="color: #ff0000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DataSourceID=&quot;</span>PeopleNoneDataSource<span style="color: #ff0000;">&quot; OnItemInserted=&quot;</span>Form_ItemInserted<span style="color: #ff0000;">&quot; </span><br /><span style="color: #ff0000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;OnItemInserting=&quot;</span>Form_ItemInserting<span style="color: #ff0000;">&quot; &nbsp;OnItemCommand=&quot;</span>Form_ItemCommand<span style="color: #ff0000;">&quot;&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;InsertItemTemplate&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;div style=&quot;</span>margin-top: 20px<span style="color: #ff0000;">&quot;&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ddbb00;">&amp;nbsp;</span><span style="color: #009900;">&lt;/div&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;div id=&quot;</span>links<span style="color: #ff0000;">&quot;&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;label class=&quot;</span><span style="color: #000066;">link</span><span style="color: #ff0000;">&quot; id=&quot;</span>tab1<span style="color: #ff0000;">&quot; onclick=&quot;</span>showReport<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span>,&lt;%=clseditmode.NumTabs %<span style="color: #000000; font-weight: bold;">&gt;</span></span>)&quot; title=&quot;Basic Info&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Basic Info<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/label&gt;</span></span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/label.html"><span style="color: #000000; font-weight: bold;">&lt;label</span></a> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;link&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;tab2&quot;</span> <span style="color: #000066;">onclick</span>=<span style="color: #ff0000;">&quot;showReport(2,&lt;%=clseditmode.NumTabs %&gt;</span>)&quot; title=&quot;Contact Info&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Contact Info<span style="color: #009900;">&lt;/label&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;label class=&quot;</span><span style="color: #000066;">link</span><span style="color: #ff0000;">&quot; id=&quot;</span>tab3<span style="color: #ff0000;">&quot; onclick=&quot;</span>showReport<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">3</span>,&lt;%=clseditmode.NumTabs %<span style="color: #000000; font-weight: bold;">&gt;</span></span>)&quot; title=&quot;User Info&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; User Info<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/label&gt;</span></span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/label.html"><span style="color: #000000; font-weight: bold;">&lt;label</span></a> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;link&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;tab4&quot;</span> <span style="color: #000066;">onclick</span>=<span style="color: #ff0000;">&quot;showReport(4,&lt;%=clseditmode.NumTabs %&gt;</span>)&quot; title=&quot;Employment Info&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Employment Info<span style="color: #009900;">&lt;/label&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;label class=&quot;</span><span style="color: #000066;">link</span><span style="color: #ff0000;">&quot; id=&quot;</span>tab5<span style="color: #ff0000;">&quot; onclick=&quot;</span>showReport<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">5</span>,&lt;%=clseditmode.NumTabs %<span style="color: #000000; font-weight: bold;">&gt;</span></span>)&quot; title=&quot;Family Info&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Family Info<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/label&gt;</span></span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&lt;% if <span style="color: #66cc66;">&#40;</span>clseditmode.NumTabs == <span style="color: #cc66cc;">6</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> %<span style="color: #000000; font-weight: bold;">&gt;</span></span> &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><a href="http://december.com/html/4/element/label.html"><span style="color: #000000; font-weight: bold;">&lt;label</span></a> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;link&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;tab6&quot;</span> <span style="color: #000066;">onclick</span>=<span style="color: #ff0000;">&quot;showReport(6,&lt;%=clseditmode.NumTabs %&gt;</span>)&quot; title=&quot;Membership Info&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Membership Info<span style="color: #009900;">&lt;/label&gt;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&lt;% } %&gt;</span> &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;/div&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;div class=&quot;</span>boxMain<span style="color: #ff0000;">&quot;&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&lt;UndoSave:UndoSaveButtons ID=&quot;</span>btnRegular<span style="color: #ff0000;">&quot; runat=&quot;</span>server<span style="color: #ff0000;">&quot; /&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;!-- 1st --&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;div id=&quot;</span>info1<span style="color: #ff0000;">&quot; class=&quot;</span>cl<span style="color: #ff0000;">&quot;&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;GenInfo:GeneralInfo ID=&quot;</span>GenInfoRegular<span style="color: #ff0000;">&quot; runat=&quot;</span>server<span style="color: #ff0000;">&quot; ShowTitle=&quot;</span>true<span style="color: #ff0000;">&quot; DOB='&lt;%# Bind(&quot;</span>DOB<span style="color: #ff0000;">&quot;) %&gt;</span>'<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FirstName='<span style="color: #009900;">&lt;%# Bind(&quot;</span>FirstName<span style="color: #ff0000;">&quot;) %&gt;</span>'<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LastName='<span style="color: #009900;">&lt;%# Bind(&quot;</span>LastName<span style="color: #ff0000;">&quot;) %&gt;</span>' MiddleName='<span style="color: #009900;">&lt;%# Bind(&quot;</span>MiddleName<span style="color: #ff0000;">&quot;) %&gt;</span>' Title='<span style="color: #009900;">&lt;%# Bind(&quot;</span><span style="color: #000066;">Title</span><span style="color: #ff0000;">&quot;) %&gt;</span>'<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Gender='<span style="color: #009900;">&lt;%# Bind(&quot;</span>Gender<span style="color: #ff0000;">&quot;) %&gt;</span>' ShowParents=&quot;false&quot; SetGenderOnChangeEvent=&quot;true&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ShowPicture =&quot;true&quot; DefaultPicture = '<span style="color: #009900;">&lt;%# Bind(&quot;</span>DefaultPicture<span style="color: #ff0000;">&quot;) %&gt;</span>' &nbsp;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;div class=&quot;</span>cl<span style="color: #ff0000;">&quot; style=&quot;</span>padding-top: 26px<span style="color: #ff0000;">&quot;&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;script type=&quot;</span><span style="color: #000066;">text</span>/javascript<span style="color: #ff0000;">&quot;&gt;</span>TabNav(1,<span style="color: #009900;">&lt;%=clseditmode.NumTabs %&gt;</span>)<span style="color: #009900;">&lt;/script&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;/div&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;/div&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;!-- /1st --&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;!-- 2nd --&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;div id=&quot;</span>info2<span style="color: #ff0000;">&quot; class=&quot;</span>cl dn<span style="color: #ff0000;">&quot;&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;AddrInfo:AddressInfo ID=&quot;</span>AddressInfoRegular<span style="color: #ff0000;">&quot; runat=&quot;</span>server<span style="color: #ff0000;">&quot; Address1='&lt;%# Bind(&quot;</span>Address1<span style="color: #ff0000;">&quot;) %&gt;</span>'<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Address2='<span style="color: #009900;">&lt;%# Bind(&quot;</span>Address2<span style="color: #ff0000;">&quot;) %&gt;</span>' CellPhone='<span style="color: #009900;">&lt;%# Bind(&quot;</span>CellPhone<span style="color: #ff0000;">&quot;) %&gt;</span>' City='<span style="color: #009900;">&lt;%# Bind(&quot;</span>City<span style="color: #ff0000;">&quot;) %&gt;</span>'<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Zip='<span style="color: #009900;">&lt;%# Bind(&quot;</span>Zip<span style="color: #ff0000;">&quot;) %&gt;</span>' State='<span style="color: #009900;">&lt;%# Bind(&quot;</span>State<span style="color: #ff0000;">&quot;) %&gt;</span>' ScreenName='<span style="color: #009900;">&lt;%# Bind(&quot;</span>ScreenName<span style="color: #ff0000;">&quot;) %&gt;</span>'<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HomePhone='<span style="color: #009900;">&lt;%# Bind(&quot;</span>HomePhone<span style="color: #ff0000;">&quot;) %&gt;</span>' <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Email='<span style="color: #009900;">&lt;%# Bind(&quot;</span>Email<span style="color: #ff0000;">&quot;) %&gt;</span>' <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SecondEmail='<span style="color: #009900;">&lt;%# Bind(&quot;</span>SecondEmail<span style="color: #ff0000;">&quot;) %&gt;</span>'/&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;div class=&quot;</span>cl<span style="color: #ff0000;">&quot; style=&quot;</span>padding-top: 15px<span style="color: #ff0000;">&quot;&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;script type=&quot;</span><span style="color: #000066;">text</span>/javascript<span style="color: #ff0000;">&quot;&gt;</span>TabNav(2,<span style="color: #009900;">&lt;%=clseditmode.NumTabs %&gt;</span>)<span style="color: #009900;">&lt;/script&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;/div&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;/div&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;!-- /2nd --&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;!-- 3rd --&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;div id=&quot;</span>info3<span style="color: #ff0000;">&quot; class=&quot;</span>cl dn<span style="color: #ff0000;">&quot;&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;UserInfo:UserInfo ID=&quot;</span>UserInfoRegular<span style="color: #ff0000;">&quot; runat=&quot;</span>server<span style="color: #ff0000;">&quot; Pwd='&lt;%# Bind(&quot;</span>Pwd<span style="color: #ff0000;">&quot;) %&gt;</span>' UserName='<span style="color: #009900;">&lt;%# Bind(&quot;</span>UserName<span style="color: #ff0000;">&quot;) %&gt;</span>' /&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;div class=&quot;</span>cl<span style="color: #ff0000;">&quot; style=&quot;</span>padding-top: 26px<span style="color: #ff0000;">&quot;&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;script type=&quot;</span><span style="color: #000066;">text</span>/javascript<span style="color: #ff0000;">&quot;&gt;</span>TabNav(3,<span style="color: #009900;">&lt;%=clseditmode.NumTabs %&gt;</span>)<span style="color: #009900;">&lt;/script&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;/div&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;/div&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;!-- /3rd --&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;!-- 4th --&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;div id=&quot;</span>info4<span style="color: #ff0000;">&quot; class=&quot;</span>cl dn<span style="color: #ff0000;">&quot;&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;BusInfo:BussinessInfo ID=&quot;</span>BussinessInfoRegular<span style="color: #ff0000;">&quot; runat=&quot;</span>server<span style="color: #ff0000;">&quot; Occupation='&lt;%# Bind(&quot;</span>Occupation<span style="color: #ff0000;">&quot;) %&gt;</span>'<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; BusinessName='<span style="color: #009900;">&lt;%# Bind(&quot;</span>BusinessName<span style="color: #ff0000;">&quot;) %&gt;</span>' BusAdd1='<span style="color: #009900;">&lt;%# Bind(&quot;</span>BusAdd1<span style="color: #ff0000;">&quot;) %&gt;</span>' BusAdd2='<span style="color: #009900;">&lt;%# Bind(&quot;</span>BusAdd2<span style="color: #ff0000;">&quot;) %&gt;</span>'<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; BusCity='<span style="color: #009900;">&lt;%# Bind(&quot;</span>BusCity<span style="color: #ff0000;">&quot;) %&gt;</span>' BusState='<span style="color: #009900;">&lt;%# Bind(&quot;</span>BusState<span style="color: #ff0000;">&quot;) %&gt;</span>' BusZip='<span style="color: #009900;">&lt;%# Bind(&quot;</span>BusZip<span style="color: #ff0000;">&quot;) %&gt;</span>'<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Pager='<span style="color: #009900;">&lt;%# Bind(&quot;</span>Pager<span style="color: #ff0000;">&quot;) %&gt;</span>' Fax='<span style="color: #009900;">&lt;%# Bind(&quot;</span>Fax<span style="color: #ff0000;">&quot;) %&gt;</span>' BusinessPhone='<span style="color: #009900;">&lt;%# Bind(&quot;</span>BusinessPhone<span style="color: #ff0000;">&quot;) %&gt;</span>' /&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;div class=&quot;</span>cl<span style="color: #ff0000;">&quot; style=&quot;</span>padding-top: 26px<span style="color: #ff0000;">&quot;&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;script type=&quot;</span><span style="color: #000066;">text</span>/javascript<span style="color: #ff0000;">&quot;&gt;</span>TabNav(4,<span style="color: #009900;">&lt;%=clseditmode.NumTabs %&gt;</span>)<span style="color: #009900;">&lt;/script&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;/div&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;/div&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;!-- /4th --&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;!-- 5th --&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;div id=&quot;</span>info5<span style="color: #ff0000;">&quot; class=&quot;</span>cl dn<span style="color: #ff0000;">&quot;&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;div class=&quot;</span>cl<span style="color: #ff0000;">&quot;&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;label class=&quot;</span>bx<span style="color: #ff0000;">&quot;&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Spouse<span style="color: #009900;">&lt;/label&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;span class=&quot;</span>bx<span style="color: #ff0000;">&quot; id=&quot;</span>spouseName<span style="color: #ff0000;">&quot;&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;Custom:AutoSuggestBox ID=&quot;</span>asbSpouse<span style="color: #ff0000;">&quot; ToolTip=&quot;</span><span style="color: #000066;">Start</span> typing and select from the list<span style="color: #ff0000;">&quot;</span><br /><span style="color: #ff0000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;runat=&quot;</span>server<span style="color: #ff0000;">&quot; DataType = '&lt;%# Eval(&quot;</span>Gender<span style="color: #ff0000;">&quot;) ==&quot;</span>M<span style="color: #ff0000;">&quot;?&quot;</span>Mother<span style="color: #ff0000;">&quot;:&quot;</span>Father<span style="color: #ff0000;">&quot; %&gt;</span>' IncludeMoreMenuItem=&quot;True&quot; KeyPressDelay=&quot;300&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MaxSuggestChars=&quot;5&quot; MoreMenuItemLabel=&quot;...&quot; NumMenuItems=&quot;10&quot; ResourcesDir=&quot;/asb_includes&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SelectedValue='<span style="color: #009900;">&lt;%# Bind(&quot;</span>SpouseID<span style="color: #ff0000;">&quot;) %&gt;</span>' SelMenuItemCSSClass=&quot;asbSelMenuItem&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; OnPreRender=&quot;AsbPrerender&quot; UseIFrame=&quot;True&quot; MaxLength=&quot;80&quot;&gt;<span style="color: #009900;">&lt;/Custom:AutoSuggestBox&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;/span&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;span class=&quot;</span>bx<span style="color: #ff0000;">&quot; style=&quot;</span><span style="color: #000066;">width</span>: 180px<span style="color: #ff0000;">&quot;&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;a href=&lt;%# clseditmode.CreateLink(Eval(&quot;</span>SpouseID<span style="color: #ff0000;">&quot;),&quot;</span>AddressInfoRegular<span style="color: #ff0000;">&quot;,&quot;</span>Spouse<span style="color: #ff0000;">&quot;) %&gt;</span><span style="color: #009900;">&lt;/a&gt;</span><span style="color: #009900;">&lt;/span&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&lt;label class=&quot;</span>bx<span style="color: #ff0000;">&quot;&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Anniversary<span style="color: #009900;">&lt;/label&gt;</span><span style="color: #009900;">&lt;span class=&quot;</span>bx<span style="color: #ff0000;">&quot;&gt;</span><span style="color: #009900;">&lt;asp:TextBox ID=&quot;</span>tbAnniversary<span style="color: #ff0000;">&quot; runat=&quot;</span>server<span style="color: #ff0000;">&quot;</span><br /><span style="color: #ff0000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AutoCompleteType=&quot;</span><span style="color: #000066;">Disabled</span><span style="color: #ff0000;">&quot; Text='&lt;%# Bind(&quot;</span>Anniversary<span style="color: #ff0000;">&quot;, &quot;</span><span style="color: #66cc66;">&#123;</span><span style="color: #cc66cc;">0</span>:M/d/yyyy<span style="color: #66cc66;">&#125;</span><span style="color: #ff0000;">&quot;) %&gt;</span>'&gt;<span style="color: #009900;">&lt;/asp:TextBox&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;asp:RegularExpressionValidator ID=&quot;</span>regexAnniversary<span style="color: #ff0000;">&quot; runat=&quot;</span>server<span style="color: #ff0000;">&quot; ControlToValidate=&quot;</span>tbAnniversary<span style="color: #ff0000;">&quot;</span><br /><span style="color: #ff0000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Display=&quot;</span>Dynamic<span style="color: #ff0000;">&quot; ErrorMessage=&quot;</span>Incorrect Anniversary <span style="color: #66cc66;">&#40;</span>m/d/yyyy<span style="color: #66cc66;">&#41;</span><span style="color: #ff0000;">&quot; </span><br /><span style="color: #ff0000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ValidationExpression=&quot;</span><span style="color: #66cc66;">&#40;</span>?:<span style="color: #66cc66;">&#40;</span>?:<span style="color: #66cc66;">&#40;</span>?:<span style="color: #cc66cc;">0</span>?<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">13578</span><span style="color: #66cc66;">&#93;</span>|<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">02</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#40;</span>\/|-|\.<span style="color: #66cc66;">&#41;</span><span style="color: #cc66cc;">31</span><span style="color: #66cc66;">&#41;</span>\<span style="color: #cc66cc;">1</span>|<span style="color: #66cc66;">&#40;</span>?:<span style="color: #66cc66;">&#40;</span>?:<span style="color: #cc66cc;">0</span>?<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">13</span><span style="color: #cc66cc;">-9</span><span style="color: #66cc66;">&#93;</span>|<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #cc66cc;">-2</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#40;</span>\/|-|\.<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#40;</span>?:<span style="color: #cc66cc;">29</span>|<span style="color: #cc66cc;">30</span><span style="color: #66cc66;">&#41;</span>\<span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#40;</span>?:<span style="color: #66cc66;">&#40;</span>?:<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">6</span><span style="color: #cc66cc;">-9</span><span style="color: #66cc66;">&#93;</span>|<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #cc66cc;">-9</span><span style="color: #66cc66;">&#93;</span>\d<span style="color: #66cc66;">&#41;</span>?\d<span style="color: #66cc66;">&#123;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>$|^<span style="color: #66cc66;">&#40;</span>?:<span style="color: #cc66cc;">0</span>?<span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#40;</span>\/|-|\.<span style="color: #66cc66;">&#41;</span><span style="color: #cc66cc;">29</span>\<span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#40;</span>?:<span style="color: #66cc66;">&#40;</span>?:<span style="color: #66cc66;">&#40;</span>?:<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">6</span><span style="color: #cc66cc;">-9</span><span style="color: #66cc66;">&#93;</span>|<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #cc66cc;">-9</span><span style="color: #66cc66;">&#93;</span>\d<span style="color: #66cc66;">&#41;</span>?<span style="color: #66cc66;">&#40;</span>?:<span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">48</span><span style="color: #66cc66;">&#93;</span>|<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">2468</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">048</span><span style="color: #66cc66;">&#93;</span>|<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">13579</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">26</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>|<span style="color: #66cc66;">&#40;</span>?:<span style="color: #66cc66;">&#40;</span>?:<span style="color: #cc66cc;">16</span>|<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">2468</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">048</span><span style="color: #66cc66;">&#93;</span>|<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">3579</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">26</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #cc66cc;">00</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>$|^<span style="color: #66cc66;">&#40;</span>?:<span style="color: #66cc66;">&#40;</span>?:<span style="color: #cc66cc;">0</span>?<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #cc66cc;">-9</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>|<span style="color: #66cc66;">&#40;</span>?:<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #cc66cc;">-2</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#40;</span>\/|-|\.<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#40;</span>?:<span style="color: #cc66cc;">0</span>?<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #cc66cc;">-9</span><span style="color: #66cc66;">&#93;</span>|<span style="color: #cc66cc;">1</span>\d|<span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #cc66cc;">-8</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>\<span style="color: #cc66cc;">4</span><span style="color: #66cc66;">&#40;</span>?:<span style="color: #66cc66;">&#40;</span>?:<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">6</span><span style="color: #cc66cc;">-9</span><span style="color: #66cc66;">&#93;</span>|<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #cc66cc;">-9</span><span style="color: #66cc66;">&#93;</span>\d<span style="color: #66cc66;">&#41;</span>?\d<span style="color: #66cc66;">&#123;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span><span style="color: #ff0000;">&quot;&gt;</span><span style="color: #009900;">&lt;/asp:RegularExpressionValidator&gt;</span><span style="color: #009900;">&lt;/span&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;label class=&quot;</span>bx<span style="color: #ff0000;">&quot;&gt;</span>Marital Status<span style="color: #009900;">&lt;/label&gt;</span><span style="color: #009900;">&lt;span class=&quot;</span>bx<span style="color: #ff0000;">&quot;&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;asp:DropDownList runat=&quot;</span>server<span style="color: #ff0000;">&quot; ID=&quot;</span>drpMsts<span style="color: #ff0000;">&quot; SelectedValue='&lt;%# Bind(&quot;</span>MaritalStatus<span style="color: #ff0000;">&quot;) %&gt;</span>'&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;asp:ListItem Value=&quot;</span>M<span style="color: #ff0000;">&quot;&gt;</span>Married<span style="color: #009900;">&lt;/asp:ListItem&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;asp:ListItem Value=&quot;</span>D<span style="color: #ff0000;">&quot;&gt;</span>Divorced<span style="color: #009900;">&lt;/asp:ListItem&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;asp:ListItem Value=&quot;</span>S<span style="color: #ff0000;">&quot;&gt;</span>Separated<span style="color: #009900;">&lt;/asp:ListItem&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;asp:ListItem Value=&quot;</span>W<span style="color: #ff0000;">&quot;&gt;</span>Widowed<span style="color: #009900;">&lt;/asp:ListItem&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;/asp:DropDownList&gt;</span><span style="color: #009900;">&lt;/span&gt;</span><span style="color: #009900;">&lt;/div&gt;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;div class=&quot;</span>cl<span style="color: #ff0000;">&quot;&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;label class=&quot;</span>bx<span style="color: #ff0000;">&quot;&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Father<span style="color: #009900;">&lt;/label&gt;</span><span style="color: #009900;">&lt;span class=&quot;</span>bx<span style="color: #ff0000;">&quot; id = &quot;</span>fatherName<span style="color: #ff0000;">&quot;&gt;</span><span style="color: #009900;">&lt;Custom:AutoSuggestBox ID=&quot;</span>fatherName<span style="color: #ff0000;">&quot; Text='&lt;%# Bind(&quot;</span>Father<span style="color: #ff0000;">&quot;) %&gt;</span>'<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DataType=&quot;Father&quot; MaxLength=&quot;100&quot; OnPreRender=&quot;AsbPrerender&quot; ToolTip=&quot;Start typing and select from the list&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; runat=&quot;server&quot; ResourcesDir=&quot;/asb_includes&quot; /&gt;<span style="color: #009900;">&lt;/span&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;span class=&quot;</span>bx<span style="color: #ff0000;">&quot; style=&quot;</span><span style="color: #000066;">width</span>: 180px<span style="color: #ff0000;">&quot;&gt;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;a href=&lt;%# clseditmode.CreateLink(Eval(&quot;</span>FatherID<span style="color: #ff0000;">&quot;),&quot;</span>AddressInfoRegular<span style="color: #ff0000;">&quot;,&quot;</span>Father<span style="color: #ff0000;">&quot;) %&gt;</span><span style="color: #009900;">&lt;/a&gt;</span><span style="color: #009900;">&lt;/span&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&lt;/div&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&lt;div class=&quot;</span>cl<span style="color: #ff0000;">&quot;&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;label class=&quot;</span>bx<span style="color: #ff0000;">&quot;&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Mother<span style="color: #009900;">&lt;/label&gt;</span><span style="color: #009900;">&lt;span class=&quot;</span>bx<span style="color: #ff0000;">&quot; id =&quot;</span>motherName<span style="color: #ff0000;">&quot;&gt;</span><span style="color: #009900;">&lt;Custom:AutoSuggestBox ID=&quot;</span>motherName<span style="color: #ff0000;">&quot; Text='&lt;%# Bind(&quot;</span>Mother<span style="color: #ff0000;">&quot;) %&gt;</span>'<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DataType=&quot;Mother&quot; MaxLength=&quot;100&quot; OnPreRender=&quot;AsbPrerender&quot; ToolTip=&quot;Start typing and select from the list&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; runat=&quot;server&quot; ResourcesDir=&quot;/asb_includes&quot; /&gt;<span style="color: #009900;">&lt;/span&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;span class=&quot;</span>bx<span style="color: #ff0000;">&quot; style=&quot;</span><span style="color: #000066;">width</span>: 180px<span style="color: #ff0000;">&quot;&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;a href=&lt;%# clseditmode.CreateLink(Eval(&quot;</span>MotherID<span style="color: #ff0000;">&quot;),&quot;</span>AddressInfoRegular<span style="color: #ff0000;">&quot;,&quot;</span>Mother<span style="color: #ff0000;">&quot;) %&gt;</span><span style="color: #009900;">&lt;/a&gt;</span><span style="color: #009900;">&lt;/span&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;/div&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;div class=&quot;</span>cl<span style="color: #ff0000;">&quot;&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;label class=&quot;</span>bx<span style="color: #ff0000;">&quot;&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Comment<span style="color: #009900;">&lt;/label&gt;</span><span style="color: #009900;">&lt;span class=&quot;</span>bx<span style="color: #ff0000;">&quot;&gt;</span><span style="color: #009900;">&lt;asp:TextBox ID=&quot;</span>txtComment<span style="color: #ff0000;">&quot; Width=&quot;</span><span style="color: #cc66cc;">120</span><span style="color: #ff0000;">&quot; Text='&lt;%# Bind(&quot;</span>Comment<span style="color: #ff0000;">&quot;) %&gt;</span>'<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TextMode=&quot;MultiLine&quot; runat=&quot;server&quot; AutoCompleteType=&quot;Disabled&quot; /&gt;<span style="color: #009900;">&lt;/span&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;/div&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;div class=&quot;</span>cl<span style="color: #ff0000;">&quot; style=&quot;</span>padding-top: 26px<span style="color: #ff0000;">&quot;&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;script type=&quot;</span><span style="color: #000066;">text</span>/javascript<span style="color: #ff0000;">&quot;&gt;</span>TabNav(5,<span style="color: #009900;">&lt;%=clseditmode.NumTabs %&gt;</span>)<span style="color: #009900;">&lt;/script&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;/div&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;/div&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;!-- /5th --&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&lt;% if (clseditmode.NumTabs == 6) { %&gt;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;!-- 6th --&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;div id=&quot;</span>info6<span style="color: #ff0000;">&quot; class=&quot;</span>cl dn<span style="color: #ff0000;">&quot;&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;MembInfo:MembershipInfo ID=&quot;</span>MembershipInfoRegular<span style="color: #ff0000;">&quot; runat=&quot;</span>server<span style="color: #ff0000;">&quot; </span><br /><span style="color: #ff0000;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;BillQuaterly ='&lt;%# Bind(&quot;</span>BillQuaterly<span style="color: #ff0000;">&quot;) %&gt;</span>' IsMember ='<span style="color: #009900;">&lt;%# Bind(&quot;</span>IsMember<span style="color: #ff0000;">&quot;) %&gt;</span>'<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PaymentMethod='<span style="color: #009900;">&lt;%# Bind(&quot;</span>PaymentMethod<span style="color: #ff0000;">&quot;) %&gt;</span>' StartDate ='<span style="color: #009900;">&lt;%# Bind(&quot;</span>StartDate<span style="color: #ff0000;">&quot;) %&gt;</span>' /&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&lt;div class=&quot;</span>cl<span style="color: #ff0000;">&quot; style=&quot;</span>padding-top: 26px<span style="color: #ff0000;">&quot;&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;script type=&quot;</span><span style="color: #000066;">text</span>/javascript<span style="color: #ff0000;">&quot;&gt;</span>TabNav(6,<span style="color: #009900;">&lt;%=clseditmode.NumTabs %&gt;</span>)<span style="color: #009900;">&lt;/script&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;/div&gt;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;/div&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;!-- /6th --&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;% } %&gt;</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;script type=&quot;</span><span style="color: #000066;">text</span>/javascript<span style="color: #ff0000;">&quot;&gt;</span>showReport(1,<span style="color: #009900;">&lt;%=clseditmode.NumTabs %&gt;</span>);<span style="color: #009900;">&lt;/script&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&lt;/div&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;/InsertItemTemplate&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;EditRowStyle CssClass=&quot;</span>details_row<span style="color: #ff0000;">&quot; /&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;/asp:FormView&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;/asp:View&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;!-- End of the Regular Person --&gt;</span></span><br /><br /></div><div id="cb8384" style="display: none; color: red;"></div></div></div>
<p>etc.</p>

<p>The InsertPerson.cs (code behind) had the following code in regards to showing the error message:</p>

<div class="codebox"><div class="codeheader">Code: <span>c#</span></div><div class="codeholder"><div class="c#" id="cb92132" style="display: block; color: rgb(0, 0, 0);"><span style="color: #808080; font-style: italic;">/// &lt;summary&gt;</span><br />&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/// Display message</span><br />&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/// &lt;/summary&gt;</span><br />&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/// &lt;param name=&quot;msg&quot;&gt;&lt;/param&gt;</span><br />&nbsp; &nbsp; <span style="color: #808080; font-style: italic;">/// &lt;param name=&quot;CloseWindow&quot;&gt;&lt;/param&gt;</span><br />&nbsp; &nbsp; protected <span style="color: #993333;">void</span> DisplayMessage<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">string</span> msg, bool CloseWindow<span style="color: #66cc66;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #993333;">string</span> Script=<span style="color: #ff0000;">&quot;&quot;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>Request.<span style="color: #202020;">QueryString</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;pid&quot;</span><span style="color: #66cc66;">&#93;</span> != <span style="color: #000000; font-weight: bold;">null</span> &amp;&amp; Request.<span style="color: #202020;">QueryString</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;pid&quot;</span><span style="color: #66cc66;">&#93;</span>.<span style="color: #202020;">Length</span> &gt; <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>msg != <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> Script = <span style="color: #993333;">string</span>.<span style="color: #202020;">Format</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;alert(<span style="color: #000099; font-weight: bold;">\&quot;</span>{0}<span style="color: #000099; font-weight: bold;">\&quot;</span>);&quot;</span>, msg<span style="color: #66cc66;">&#41;</span> + <span style="color: #66cc66;">&#40;</span>CloseWindow ? <span style="color: #ff0000;">&quot;window.close;&quot;</span> : <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #66cc66;">&#125;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Script = <span style="color: #993333;">string</span>.<span style="color: #202020;">Format</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;parent.DisplayMessage(<span style="color: #000099; font-weight: bold;">\&quot;</span>{0}<span style="color: #000099; font-weight: bold;">\&quot;</span>);&quot;</span>, msg<span style="color: #66cc66;">&#41;</span>;<span style="color: #66cc66;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>Script!=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;this.<span style="color: #202020;">ClientScript</span>.<span style="color: #202020;">RegisterClientScriptBlock</span><span style="color: #66cc66;">&#40;</span>this.<span style="color: #202020;">GetType</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #ff0000;">&quot;Message&quot;</span>, Script, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br /><br /></div><div id="cb30928" style="display: none; color: red;"></div></div></div>

<p>The way the error was passed back to the client was handled in Form_ItemInserted event:</p>

<div class="codebox"><div class="codeheader">Code: <span>c#</span></div><div class="codeholder"><div class="c#" id="cb90207" style="display: block; color: rgb(0, 0, 0);">protected <span style="color: #993333;">void</span> Form_ItemInserted<span style="color: #66cc66;">&#40;</span>object sender, FormViewInsertedEventArgs e<span style="color: #66cc66;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #993333;">string</span> Text;<br />&nbsp; &nbsp; &nbsp; &nbsp; bool CloseWindow = <span style="color: #000000; font-weight: bold;">false</span>;<br />&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>e.<span style="color: #202020;">Exception</span> == <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>Request.<span style="color: #202020;">QueryString</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;pid&quot;</span><span style="color: #66cc66;">&#93;</span> != <span style="color: #000000; font-weight: bold;">null</span> &amp;&amp; Request.<span style="color: #202020;">QueryString</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;pid&quot;</span><span style="color: #66cc66;">&#93;</span>.<span style="color: #202020;">Length</span> &gt; <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Text = <span style="color: #993333;">string</span>.<span style="color: #202020;">Format</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;You just inserted {0} {1}&quot;</span>, e.<span style="color: #202020;">Values</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;FirstName&quot;</span><span style="color: #66cc66;">&#93;</span>, e.<span style="color: #202020;">Values</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;LastName&quot;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.<span style="color: #202020;">UPDATE_OPENER</span>.<span style="color: #202020;">Text</span> = <span style="color: #ff0000;">&quot;&lt;script language=<span style="color: #000099; font-weight: bold;">\&quot;</span>JavaScript<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;changeParent('&quot;</span> + Request.<span style="color: #202020;">QueryString</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;pid&quot;</span><span style="color: #66cc66;">&#93;</span> + <span style="color: #ff0000;">&quot;','&quot;</span> + e.<span style="color: #202020;">Values</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;LastName&quot;</span><span style="color: #66cc66;">&#93;</span> + <span style="color: #ff0000;">&quot;, &quot;</span> + e.<span style="color: #202020;">Values</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;FirstName&quot;</span><span style="color: #66cc66;">&#93;</span> + <span style="color: #ff0000;">&quot; &quot;</span> + <span style="color: #66cc66;">&#40;</span>e.<span style="color: #202020;">Values</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;MiddleName&quot;</span><span style="color: #66cc66;">&#93;</span> ?? <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #ff0000;">&quot;',&quot;</span> + <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.<span style="color: #202020;">NewPersonID</span> + <span style="color: #ff0000;">&quot;,'&quot;</span> + Text.<span style="color: #202020;">Replace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;'&quot;</span>,<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>'&quot;</span><span style="color: #66cc66;">&#41;</span> &nbsp;+ <span style="color: #ff0000;">&quot;');&lt;/script&gt;&quot;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CloseWindow = <span style="color: #000000; font-weight: bold;">true</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.<span style="color: #202020;">UPDATE_OPENER</span>.<span style="color: #202020;">Visible</span> = <span style="color: #000000; font-weight: bold;">true</span>; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Text = <span style="color: #993333;">string</span>.<span style="color: #202020;">Format</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;You just inserted {0} {1} &lt;a href='peopleV.aspx?perid={2}'&gt;&quot;</span> +<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">&quot;Edit Here&lt;/a&gt;&quot;</span>, e.<span style="color: #202020;">Values</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;FirstName&quot;</span><span style="color: #66cc66;">&#93;</span>, e.<span style="color: #202020;">Values</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;LastName&quot;</span><span style="color: #66cc66;">&#93;</span>, this.<span style="color: #202020;">NewPersonID</span><span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.<span style="color: #202020;">DisplayMessage</span><span style="color: #66cc66;">&#40;</span>Text, CloseWindow<span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.<span style="color: #202020;">MltvwViewForms</span>.<span style="color: #202020;">Visible</span> = <span style="color: #000000; font-weight: bold;">false</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span> <span style="color: #808080; font-style: italic;">// Exception case</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #66cc66;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Text = <span style="color: #ff0000;">&quot;The data was entered in an incorrect format, please check it over.&quot;</span> +<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">&quot; &quot;</span> + e.<span style="color: #202020;">Exception</span>.<span style="color: #202020;">Message</span>.<span style="color: #202020;">Replace</span><span style="color: #66cc66;">&#40;</span>Environment.<span style="color: #202020;">NewLine</span>, <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>n&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #202020;">Replace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span>, <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\\</span><span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #66cc66;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.<span style="color: #202020;">DisplayMessage</span><span style="color: #66cc66;">&#40;</span>Text, CloseWindow<span style="color: #66cc66;">&#41;</span>;<br />&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.<span style="color: #202020;">ExceptionHandled</span> = <span style="color: #000000; font-weight: bold;">true</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.<span style="color: #202020;">KeepInInsertMode</span> = <span style="color: #000000; font-weight: bold;">true</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br />&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><br /><br /></div><div id="cb70329" style="display: none; color: red;"></div></div></div>

<p>The page calling the InsertPerson page was called CreatePerson.aspx and had the following ASPX code:</p>

<div class="codebox"><div class="codeheader">Code: <span>html</span></div><div class="codeholder"><div class="html" id="cb47843" style="display: block; color: rgb(0, 0, 0);"><span style="color: #009900;">&lt;%@ Page <span style="color: #000066;">Language</span>=<span style="color: #ff0000;">&quot;C#&quot;</span> MasterPageFile=<span style="color: #ff0000;">&quot;~/admin.master&quot;</span> AutoEventWireup=<span style="color: #ff0000;">&quot;true&quot;</span> CodeFile=<span style="color: #ff0000;">&quot;CreatePerson.aspx.cs&quot;</span><br />&nbsp; &nbsp; Theme=<span style="color: #ff0000;">&quot;Profesional&quot;</span> Inherits=<span style="color: #ff0000;">&quot;Coordinator_People_CreatePerson&quot;</span> <span style="color: #000066;">Title</span>=<span style="color: #ff0000;">&quot;Create Users&quot;</span> %<span style="color: #000000; font-weight: bold;">&gt;</span></span><br />&nbsp;<br /><span style="color: #009900;">&lt;asp:<span style="color: #000066;">Content</span> <span style="color: #000066;">ID</span>=<span style="color: #ff0000;">&quot;Content1&quot;</span> ContentPlaceHolderID=<span style="color: #ff0000;">&quot;ContentPlaceHolder1&quot;</span> runat=<span style="color: #ff0000;">&quot;Server&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br /><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;spnStatFrame&quot;</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;display:none;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br /><span style="color: #009900;"><a href="http://december.com/html/4/element/table.html"><span style="color: #000000; font-weight: bold;">&lt;table</span></a> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;font-weight: bolder; vertical-align: middle; color: #FFFFFF; width: 32%; text-align: center;&quot;</span> <span style="color: #000066;">cellpadding</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">cellspacing</span>=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br /><span style="color: #009900;"><a href="http://december.com/html/4/element/tr.html"><span style="color: #000000; font-weight: bold;">&lt;tr&gt;</span></a></span><br />&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">&lt;td&gt;</span></a></span><span style="color: #009900;"><a href="http://december.com/html/4/element/img.html"><span style="color: #000000; font-weight: bold;">&lt;img</span></a> <span style="color: #000066;">alt</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;../../images/tl-LightBlue.gif&quot;</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;10&quot;</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td&gt;</span></span><br />&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">&lt;td</span></a> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;background-color: #5BA2EB;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #ddbb00;">&amp;nbsp;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td&gt;</span></span><br />&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">&lt;td&gt;</span></a></span><span style="color: #009900;"><a href="http://december.com/html/4/element/img.html"><span style="color: #000000; font-weight: bold;">&lt;img</span></a> <span style="color: #000066;">alt</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;../../images/tr-LightBlue.gif&quot;</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;10&quot;</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td&gt;</span></span><br /><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tr&gt;</span></span><br /><span style="color: #009900;"><a href="http://december.com/html/4/element/tr.html"><span style="color: #000000; font-weight: bold;">&lt;tr</span></a> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;background-color: #5BA2EB;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">&lt;td&gt;</span></a></span><span style="color: #ddbb00;">&amp;nbsp;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td&gt;</span></span><br />&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">&lt;td&gt;</span></a></span><span style="color: #009900;"><a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">&lt;span</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;spnStat&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td&gt;</span></span><br />&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">&lt;td&gt;</span></a></span><span style="color: #ddbb00;">&amp;nbsp;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td&gt;</span></span><br /><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tr&gt;</span></span><br /><span style="color: #009900;"><a href="http://december.com/html/4/element/tr.html"><span style="color: #000000; font-weight: bold;">&lt;tr&gt;</span></a></span><br />&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">&lt;td&gt;</span></a></span><span style="color: #009900;"><a href="http://december.com/html/4/element/img.html"><span style="color: #000000; font-weight: bold;">&lt;img</span></a> <span style="color: #000066;">alt</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;../../images/bl-LightBlue.gif&quot;</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;10&quot;</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td&gt;</span></span><br />&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">&lt;td</span></a> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;background-color: #5BA2EB;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #ddbb00;">&amp;nbsp;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td&gt;</span></span><br />&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/td.html"><span style="color: #000000; font-weight: bold;">&lt;td&gt;</span></a></span><span style="color: #009900;"><a href="http://december.com/html/4/element/img.html"><span style="color: #000000; font-weight: bold;">&lt;img</span></a> <span style="color: #000066;">alt</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;../../images/br-LightBlue.gif&quot;</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;10&quot;</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td&gt;</span></span><br /><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tr&gt;</span></span><br /><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/table&gt;</span></span><br /><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span><br />&nbsp;<br /><span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />&nbsp; &nbsp; var dv = document.getElementById(&quot;spnStatFrame&quot;);<br />&nbsp; &nbsp; var Spn = document.getElementById(&quot;spnStat&quot;);<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; function DisplayMessage(Message)<br />&nbsp; &nbsp; { &nbsp; if (Message !=&quot;&quot;){ &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dv.style.display = &quot;inline&quot;; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Spn.innerHTML = Message;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setTimeout(&quot;dv.style.display = 'none'&quot;, 300000);}<br />&nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dv.style.display = &quot;none&quot;; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; }<br /><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span><br />&nbsp;<br /><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;p5&quot;</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;text-align:right&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />&nbsp; &nbsp; View all People <span style="color: #009900;"><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">&lt;a</span></a> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;peopleV.aspx&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><a href="http://december.com/html/4/element/img.html"><span style="color: #000000; font-weight: bold;">&lt;img</span></a> <span style="color: #000066;">alt</span>=<span style="color: #ff0000;">&quot;View People&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;../../images/id_card_view.png&quot;</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">&quot;View all People&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;peopleVNavIcon&quot;</span>/<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a&gt;</span></span><br /><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span><br />&nbsp;<br />&nbsp;<br /><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div&gt;</span></a></span><br />Create a<br /><span style="color: #009900;"><a href="http://december.com/html/4/element/select.html"><span style="color: #000000; font-weight: bold;">&lt;select</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;PersonType&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;PersonType&quot;</span> <span style="color: #000066;">onchange</span>=<span style="color: #ff0000;">&quot;javascript:go();&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/option.html"><span style="color: #000000; font-weight: bold;">&lt;option</span></a> <span style="color: #000066;">selected</span>=<span style="color: #ff0000;">&quot;selected&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>--Choose a Person Type--<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/option&gt;</span></span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/option.html"><span style="color: #000000; font-weight: bold;">&lt;option</span></a> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;InsertPerson.aspx?ptype=B&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Special Friend<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/option&gt;</span></span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/option.html"><span style="color: #000000; font-weight: bold;">&lt;option</span></a> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;InsertPerson.aspx?ptype=N&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Regular Person<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/option&gt;</span></span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/option.html"><span style="color: #000000; font-weight: bold;">&lt;option</span></a> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;InsertPerson.aspx?ptype=A&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Adult Volunteer<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/option&gt;</span></span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -- other options --<br /><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/select&gt;</span></span><br /><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span><br /><span style="color: #009900;"><a href="http://december.com/html/4/element/iframe.html"><span style="color: #000000; font-weight: bold;">&lt;iframe</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;myframe&quot;</span> <span style="color: #000066;">scrolling</span>=<span style="color: #ff0000;">&quot;no&quot;</span> <span style="color: #000066;">marginwidth</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">marginheight</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <br /><span style="color: #000066;">frameborder</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;text-align: center; overflow: visible; </span><br /><span style="color: #ff0000;"> &nbsp; &nbsp;width:710px; display: none;&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/iframe&gt;</span></span><br /><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;loading&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;more&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Loading...<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span><br />&nbsp;<br />&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/ecmascript&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />&nbsp; &nbsp; var loading = document.getElementById(&quot;loading&quot;);<br />&nbsp; &nbsp; function go()<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; var SelInsert = document.getElementById(&quot;PersonType&quot;);<br />&nbsp; &nbsp; &nbsp; &nbsp; if(SelInsert.selectedIndex != 0){<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; loading.style.display = 'block'<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var frm =loadintoIframe('myframe', SelInsert.options[SelInsert.selectedIndex].value);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DisplayMessage(&quot;&quot;); &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; //setTimeout(&quot;loading.style.display = 'none'&quot;, 5000); &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; //var x=document.getElementById(&quot;myframe&quot;).contentDocument;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // This doesn't work for User Controls &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //document.frames[&quot;myframe&quot;].onload = function() {showReqFld(); };<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; } <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; } &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span><br />&nbsp;<br /><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;</span>/asp:Content&gt;</span><br /><br /></div><div id="cb64269" style="display: none; color: red;"></div></div></div>

<p>So, hopefully you see the logic of the pages. The CreatePerson page had a place to show an error message or a link if the insert worked correctly. From the InsertPerson page we manipulated the parent CreatePerson page and displayed the appropriate message (either the error message or a link to edit a newly inserted person).</p><a href="http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/WebDev/WebDesignGraphicsStyling/how-to-return-error-messages-from-the-sq"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/WebDev/WebDesignGraphicsStyling/how-to-return-error-messages-from-the-sq&amp;source=LessThanDot" height="61" width="51" /></a><div class="item_footer"><p><small><a href="http://blogs.lessthandot.com/index.php/WebDev/WebDesignGraphicsStyling/how-to-return-error-messages-from-the-sq">Original post</a> blogged on <a href="http://lessthandot.com/">LessThanDot</a>.</small></p></div>]]></content:encoded>
								<comments>http://blogs.lessthandot.com/index.php/WebDev/WebDesignGraphicsStyling/how-to-return-error-messages-from-the-sq#comments</comments>
		</item>
				<item>
			<title>T4 template to make a factory class.</title>
			<link>http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/t4-template-to-make-a-factory-class</link>
			<pubDate>Sat, 24 Jul 2010 17:01:26 +0000</pubDate>			<dc:creator>chrissie1</dc:creator>
			<category domain="main">Microsoft Technologies</category>
<category domain="alt">VB.NET</category>
<category domain="alt">C#</category>			<guid isPermaLink="false">910@http://blogs.lessthandot.com/</guid>
						<description>&lt;h3&gt;by &lt;a href=&quot;http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;amp;author=7&quot;&gt; chrissie1 &lt;/a&gt;&lt;/h3&gt;&lt;h2&gt;Introduction&lt;/h2&gt;

&lt;p&gt;Some jobs are tedious and errorprone. To avoid the errors we should unittest, but to avoid the tediousness we can make use of code generation. One such code generation tool is T4. It is available in Visual studio so why not use it? Well I can think of a few reasons. No intellisense no code coloring and no refactoring. But I guess we will have to learn to live with that. Or use a third party editor like the one from &lt;a href=&quot;http://www.t4editor.net/downloads.html&quot;&gt;Clarius consulting&lt;/a&gt;. So I thought code generation would be a good fit for some of my factory classes I have. &lt;/p&gt;

&lt;h2&gt;The goal&lt;/h2&gt;

&lt;p&gt;Well that is simple I want to create this file automagicaly.&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;vbnet&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;vbnet&quot; id=&quot;cb30865&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;Imports ConsoleApplication1.&lt;span style=&quot;color: #000000;&quot;&gt;Test&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;Namespace ConsoleApplication1.&lt;span style=&quot;color: #000000;&quot;&gt;T4&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008080; font-style: italic;&quot;&gt;''' &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008080; font-style: italic;&quot;&gt;''' &lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008080; font-style: italic;&quot;&gt;''' &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008080; font-style: italic;&quot;&gt;''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;CLSCompliant&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;True&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&amp;gt; _&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Public&lt;/span&gt; Interface IFactory&lt;br /&gt;&amp;nbsp;&lt;br /&gt;#Region &lt;span style=&quot;color: #0600FF;&quot;&gt;&amp;quot;Methods&amp;quot;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008080; font-style: italic;&quot;&gt;''' &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008080; font-style: italic;&quot;&gt;''' &lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008080; font-style: italic;&quot;&gt;''' &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008080; font-style: italic;&quot;&gt;''' &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008080; font-style: italic;&quot;&gt;''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Function&lt;/span&gt; Interface3&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;As&lt;/span&gt; IInterface3&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008080; font-style: italic;&quot;&gt;''' &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008080; font-style: italic;&quot;&gt;''' &lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008080; font-style: italic;&quot;&gt;''' &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008080; font-style: italic;&quot;&gt;''' &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008080; font-style: italic;&quot;&gt;''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Function&lt;/span&gt; Interface4&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;As&lt;/span&gt; IInterface4&lt;br /&gt;&amp;nbsp;&lt;br /&gt;#End Region&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;End&lt;/span&gt; Interface&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;End&lt;/span&gt; Namespace&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb81341&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The point is that it should create a Function for every Interface I have in a certain namespace. &lt;/p&gt;

&lt;h2&gt;Getting the interfaces&lt;/h2&gt;

&lt;p&gt;First problem to solve was how to easily get the interfaces in a nice list.&lt;/p&gt;

&lt;p&gt;I made a ConsoleApplication to test this. First I added a few interfaces in 2 different namespace and then I created a program to find the interfaces in the namespace I want.&lt;/p&gt;

&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/DesktopDev/T4/T4.png&quot; alt=&quot;&quot; title=&quot;&quot; width=&quot;177&quot; height=&quot;179&quot; /&gt;&lt;/div&gt; 

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;csharp&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;csharp&quot; id=&quot;cb23038&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;System&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;System&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;Collections&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;Generic&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;System&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;Linq&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;System&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;Reflection&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;using&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;System&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;Text&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;using&lt;/span&gt; ConsoleApplication1.&lt;span style=&quot;color: #0000FF;&quot;&gt;Test2&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;namespace&lt;/span&gt; ConsoleApplication1&lt;br /&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #FF0000;&quot;&gt;class&lt;/span&gt; Program&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;void&lt;/span&gt; Main&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#93;&lt;/span&gt; args&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var ty = &lt;a href=&quot;http://www.google.com/search?q=typeof+msdn.microsoft.com&quot;&gt;&lt;span style=&quot;color: #008000;&quot;&gt;typeof&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;Interface1&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var assem = ty.&lt;span style=&quot;color: #0000FF;&quot;&gt;Assembly&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var types = from e &lt;span style=&quot;color: #0600FF;&quot;&gt;in&lt;/span&gt; assem.&lt;span style=&quot;color: #0000FF;&quot;&gt;GetTypes&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt; where e.&lt;span style=&quot;color: #0000FF;&quot;&gt;IsInterface&lt;/span&gt; &amp;amp;&amp;amp; e.&lt;span style=&quot;color: #0600FF;&quot;&gt;Namespace&lt;/span&gt; == &lt;span style=&quot;color: #808080;&quot;&gt;&amp;quot;ConsoleApplication1.Test&amp;quot;&lt;/span&gt; select e;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt; types.&lt;span style=&quot;color: #0000FF;&quot;&gt;Count&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt; &amp;gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;var cls &lt;span style=&quot;color: #0600FF;&quot;&gt;in&lt;/span&gt; types&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.&lt;span style=&quot;color: #0000FF;&quot;&gt;WriteLine&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;quot;Function {0}() As {1}&amp;quot;&lt;/span&gt;,cls.&lt;span style=&quot;color: #0000FF;&quot;&gt;Name&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;Substring&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;,cls.&lt;span style=&quot;color: #0000FF;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.&lt;span style=&quot;color: #0000FF;&quot;&gt;ReadLine&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb48426&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Yes that is C#. And why is it C#? Because I decided to write T4 templates in C#. To keep the generated code apart from the generating code. You could also write the generating code in VB.Net if you like.&lt;br /&gt;
So we have this covered. Seemed simple enough. &lt;/p&gt;

&lt;h2&gt;The template&lt;/h2&gt;

&lt;p&gt;And now came the tricky part, writing the template.&lt;/p&gt;

&lt;p&gt;First of all we create a file called IFactory.tt. Visual studio will give you a warning if you do that, but it is safe to ignore that warning, just pretend that you know what you are doing.&lt;/p&gt;

&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/DesktopDev/T4/T4_1.png&quot; alt=&quot;&quot; title=&quot;&quot; width=&quot;548&quot; height=&quot;199&quot; /&gt;&lt;/div&gt;&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Then we add the generating language. and we tell it to output our file with a .vb extension.&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;text&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;text&quot; id=&quot;cb218&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&amp;lt;#@ template language=&amp;quot;C#&amp;quot; #&amp;gt;&lt;br /&gt;&amp;lt;#@ output extension=&amp;quot;vb&amp;quot; #&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb71455&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now for the code.&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;text&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;text&quot; id=&quot;cb46451&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;Imports ConsoleApplication1.Test&lt;br /&gt;&amp;nbsp;&lt;br /&gt;Namespace ConsoleApplication1.T4&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; ''' &amp;lt;summary&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; ''' &lt;br /&gt;&amp;nbsp; &amp;nbsp; ''' &amp;lt;/summary&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;CLSCompliant(True)&amp;gt; _&lt;br /&gt;&amp;nbsp; &amp;nbsp; Public Interface IFactory&lt;br /&gt;&amp;nbsp;&lt;br /&gt;#Region &amp;quot;Methods&amp;quot;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;# var ty = typeof(IInterface3);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var assem = ty.Assembly;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var types = from e in assem.GetTypes() where e.IsInterface &amp;amp;&amp;amp; e.Namespace == &amp;quot;ConsoleApplication1.Test&amp;quot; select e;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if( types.Count() &amp;gt; 0)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach(var cls in types)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var _FunctionName = cls.Name.Substring(1);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ''' &amp;lt;summary&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ''' &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ''' &amp;lt;/summary&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ''' &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Function &amp;lt;#=_FunctionName#&amp;gt;() As &amp;lt;#=cls.Name#&amp;gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;#&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #&amp;gt;&lt;br /&gt;#End Region&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; End Interface&lt;br /&gt;&amp;nbsp;&lt;br /&gt;End Namespace&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb936&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Text between &lt;# #&gt; tags is our code text between &lt;#= #&gt; tags is text that will be output to the file. Text between &lt;#@ #&gt; tags are directives.&lt;/p&gt;

&lt;p&gt;The above will fail miserably and Google failed me too. &lt;/p&gt;

&lt;p&gt;You will get 2 errors out of the above.&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Compiling transformation: The type or namespace name 'IFactory' could not be found (are you missing a using directive or an assembly reference?)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;and this one&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Compiling transformation: Could not find an implementation of the query pattern for source type 'System.Type[]'.  'Where' not found.  Are you missing a reference to 'System.Core.dll' or a using directive for 'System.Linq'?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Clearly it is complaining that you need to set references and imports.&lt;/p&gt;

&lt;p&gt;However it is not always clear to me when you need to this and for which libraries. I guess we just wait for an error and then add it.&lt;/p&gt;

&lt;p&gt;In my case I needed to add these.&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;text&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;text&quot; id=&quot;cb23560&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&amp;lt;#@ assembly name=&amp;quot;C:\..\bin\x86\Debug\ConsoleApplication1.exe&amp;quot; #&amp;gt;&lt;br /&gt;&amp;lt;#@ assembly name=&amp;quot;System.Core&amp;quot; #&amp;gt;&lt;br /&gt;&amp;lt;#@ import namespace=&amp;quot;System&amp;quot; #&amp;gt;&lt;br /&gt;&amp;lt;#@ import namespace=&amp;quot;System.Linq&amp;quot; #&amp;gt;&lt;br /&gt;&amp;lt;#@ import namespace=&amp;quot;System.Reflection&amp;quot; #&amp;gt;&lt;br /&gt;&amp;lt;#@ import namespace=&amp;quot;ConsoleApplication1.Test&amp;quot; #&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb60276&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The directives with assembly are actualy what you would do when you do Add reference for your project. If it is a system assembly then you can just use the short name like I did for System.Core if you want to reference one of you project then you need to add the fullpath and filename. like I did for my project. If you then have all the references you need you can add import directives. And then it all just works.&lt;/p&gt;

&lt;p&gt;So the final code would then be.&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;text&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;text&quot; id=&quot;cb78602&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&amp;lt;#@ assembly name=&amp;quot;C:\..\bin\x86\Debug\ConsoleApplication1.exe&amp;quot; #&amp;gt;&lt;br /&gt;&amp;lt;#@ assembly name=&amp;quot;System.Core&amp;quot; #&amp;gt;&lt;br /&gt;&amp;lt;#@ import namespace=&amp;quot;System&amp;quot; #&amp;gt;&lt;br /&gt;&amp;lt;#@ import namespace=&amp;quot;System.Linq&amp;quot; #&amp;gt;&lt;br /&gt;&amp;lt;#@ import namespace=&amp;quot;System.Reflection&amp;quot; #&amp;gt;&lt;br /&gt;&amp;lt;#@ import namespace=&amp;quot;ConsoleApplication1.Test&amp;quot; #&amp;gt;&lt;br /&gt;Imports ConsoleApplication1.Test&lt;br /&gt;&amp;nbsp;&lt;br /&gt;Namespace ConsoleApplication1.T4&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; ''' &amp;lt;summary&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; ''' &lt;br /&gt;&amp;nbsp; &amp;nbsp; ''' &amp;lt;/summary&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;CLSCompliant(True)&amp;gt; _&lt;br /&gt;&amp;nbsp; &amp;nbsp; Public Interface IFactory&lt;br /&gt;&amp;nbsp;&lt;br /&gt;#Region &amp;quot;Methods&amp;quot;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;# var ty = typeof(IInterface3);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var assem = ty.Assembly;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var types = from e in assem.GetTypes() where e.IsInterface &amp;amp;&amp;amp; e.Namespace == &amp;quot;ConsoleApplication1.Test&amp;quot; select e;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if( types.Count() &amp;gt; 0)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach(var cls in types)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var _FunctionName = cls.Name.Substring(1);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ''' &amp;lt;summary&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ''' &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ''' &amp;lt;/summary&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ''' &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Function &amp;lt;#=_FunctionName#&amp;gt;() As &amp;lt;#=cls.Name#&amp;gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;#&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #&amp;gt;&lt;br /&gt;#End Region&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; End Interface&lt;br /&gt;&amp;nbsp;&lt;br /&gt;End Namespace&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb97503&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The tt will now have a vb file attached to it.&lt;/p&gt;

&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/DesktopDev/T4/T4_3.png&quot; alt=&quot;&quot; title=&quot;&quot; width=&quot;194&quot; height=&quot;56&quot; /&gt;&lt;/div&gt;&lt;p&gt; &lt;/p&gt;

&lt;p&gt;And that will then look like this.&lt;/p&gt;

&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/DesktopDev/T4/T4_2.png&quot; alt=&quot;&quot; title=&quot;&quot; width=&quot;647&quot; height=&quot;809&quot; /&gt;&lt;/div&gt; &lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/DesktopDev/T4/T4_3.png&quot; alt=&quot;&quot; title=&quot;&quot; width=&quot;194&quot; height=&quot;56&quot; /&gt;&lt;/div&gt;&lt;p&gt; &lt;/p&gt;

&lt;p&gt;All ready for use. Now I can just add an interface and the factory will.&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;MT_red&quot;&gt;Warning&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;The above code works, but as soon as you build your project it wiil complain to say that the exe in the bin folder is blocked. This is a well known problem. It has to with the fact that the template engine does not release the AppDomain immediatly, but it caches it. There is however a nice solution to this problem. And it is called the T4 toolbox and the VolatileAssembly. You just need to download and install the Toolbox then you need to swap the assembly directive to this.&lt;/p&gt;

&lt;p&gt;You can read more abot this problem in these locations.&lt;/p&gt;

&lt;p&gt;&lt;#@ VolatileAssembly processor=&quot;T4Toolbox.VolatileAssemblyProcessor&quot; name=&quot;$(SolutionDir)/ConsoleApplication1/bin/Debug/ConsoleApplication1.exe&quot; #&gt;&lt;/p&gt;

&lt;ul&gt;  
  &lt;li&gt;&lt;a href=&quot;http://www.olegsych.com/2008/02/t4-assembly-directive/&quot;&gt;Understanding T4: &lt;#@ assembly #&gt; directive&lt;/a&gt; by &lt;a href=&quot;http://www.olegsych.com/&quot;&gt;Oleg Sych&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://siderite.blogspot.com/2010/06/working-with-t4.html&quot;&gt;Working with the T4&lt;/a&gt; by &lt;a href=&quot;http://siderite.blogspot.com&quot;&gt;Siderite&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;Code generation is a powerful tool that can take a lot of work out of your hands. But it can also become a maintenance nightmare if you aren't careful. I learned a lot while making this post. And all this because someone on &lt;a href=&quot;http://stackoverflow.com&quot;&gt;Stackoverflow &lt;/a&gt;asked &lt;a href=&quot;http://stackoverflow.com/questions/3317141/vb-net-automatically-add-namespace-when-adding-new-item&quot;&gt;how to add the namespace to a class template for VB.Net&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Resources&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://www.hanselman.com/blog/T4TextTemplateTransformationToolkitCodeGenerationBestKeptVisualStudioSecret.aspx&quot;&gt;T4 (Text Template Transformation Toolkit) Code Generation - Best Kept Visual Studio Secret&lt;/a&gt; by &lt;a href=&quot;http://www.hanselman.com&quot;&gt;Scott Hanselman&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://www.dotnetthoughts.net/2009/07/31/code-generation-using-t4-templates/&quot;&gt;Code generation using T4 Templates&lt;/a&gt; by &lt;a href=&quot;http://www.dotnetthoughts.net&quot;&gt;DotNetThoughts&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://www.olegsych.com/tag/t4/&quot;&gt;Everything about T4&lt;/a&gt; by &lt;a href=&quot;http://www.olegsych.com&quot;&gt;Oleg Sych&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/bb126484%28VS.90%29.aspx&quot;&gt;Walkthrough: Creating and Running Text Templates&lt;/a&gt; on MSDN&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://visualstudiomagazine.com/articles/2010/04/01/scaled-down-code-generation.aspx&quot;&gt;How-To Q&amp;amp;A: How Can I Automate Code Without Resorting to Heavy Code-Generation Techniques?&lt;/a&gt; by Kathleen Dollard&lt;/li&gt;
&lt;/ul&gt;&lt;a href=&quot;http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/t4-template-to-make-a-factory-class&quot;&gt;&lt;img src=&quot;http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/t4-template-to-make-a-factory-class&amp;source=LessThanDot&quot; height=&quot;61&quot; width=&quot;51&quot; /&gt;&lt;/a&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/t4-template-to-make-a-factory-class&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://lessthandot.com/&quot;&gt;LessThanDot&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[				<h3>by <a href="http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;author=7"> chrissie1 </a></h3>
				<h2>Introduction</h2>

<p>Some jobs are tedious and errorprone. To avoid the errors we should unittest, but to avoid the tediousness we can make use of code generation. One such code generation tool is T4. It is available in Visual studio so why not use it? Well I can think of a few reasons. No intellisense no code coloring and no refactoring. But I guess we will have to learn to live with that. Or use a third party editor like the one from <a href="http://www.t4editor.net/downloads.html">Clarius consulting</a>. So I thought code generation would be a good fit for some of my factory classes I have. </p>

<h2>The goal</h2>

<p>Well that is simple I want to create this file automagicaly.</p>

<div class="codebox"><div class="codeheader">Code: <span>vbnet</span></div><div class="codeholder"><div class="vbnet" id="cb34621" style="display: block; color: rgb(0, 0, 0);">Imports ConsoleApplication1.<span style="color: #000000;">Test</span><br />&nbsp;<br />Namespace ConsoleApplication1.<span style="color: #000000;">T4</span><br />&nbsp;<br />&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">''' &lt;summary&gt;</span><br />&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">''' </span><br />&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">''' &lt;/summary&gt;</span><br />&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">''' &lt;remarks&gt;&lt;/remarks&gt;</span><br />&nbsp; &nbsp; &lt;CLSCompliant<span style="color: #000000;">&#40;</span>True<span style="color: #000000;">&#41;</span>&gt; _<br />&nbsp; &nbsp; <span style="color: #0600FF;">Public</span> Interface IFactory<br />&nbsp;<br />#Region <span style="color: #0600FF;">&quot;Methods&quot;</span><br />&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">''' &lt;summary&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">''' </span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">''' &lt;/summary&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">''' &lt;returns&gt;&lt;/returns&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">''' &lt;remarks&gt;&lt;/remarks&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Function</span> Interface3<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #0600FF;">As</span> IInterface3<br />&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">''' &lt;summary&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">''' </span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">''' &lt;/summary&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">''' &lt;returns&gt;&lt;/returns&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">''' &lt;remarks&gt;&lt;/remarks&gt;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Function</span> Interface4<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #0600FF;">As</span> IInterface4<br />&nbsp;<br />#End Region<br />&nbsp;<br />&nbsp; &nbsp; <span style="color: #0600FF;">End</span> Interface<br />&nbsp;<br /><span style="color: #0600FF;">End</span> Namespace<br /><br /></div><div id="cb7005" style="display: none; color: red;"></div></div></div>

<p>The point is that it should create a Function for every Interface I have in a certain namespace. </p>

<h2>Getting the interfaces</h2>

<p>First problem to solve was how to easily get the interfaces in a nice list.</p>

<p>I made a ConsoleApplication to test this. First I added a few interfaces in 2 different namespace and then I created a program to find the interfaces in the namespace I want.</p>

<div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/DesktopDev/T4/T4.png" alt="" title="" width="177" height="179" /></div> 

<div class="codebox"><div class="codeheader">Code: <span>csharp</span></div><div class="codeholder"><div class="csharp" id="cb33179" style="display: block; color: rgb(0, 0, 0);"><span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>;<br /><span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Collections</span>.<span style="color: #0000FF;">Generic</span>;<br /><span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Linq</span>;<br /><span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Reflection</span>;<br /><span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Text</span>;<br /><span style="color: #0600FF;">using</span> ConsoleApplication1.<span style="color: #0000FF;">Test2</span>;<br />&nbsp;<br /><span style="color: #0600FF;">namespace</span> ConsoleApplication1<br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; <span style="color: #FF0000;">class</span> Program<br />&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">void</span> Main<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> args<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var ty = <a href="http://www.google.com/search?q=typeof+msdn.microsoft.com"><span style="color: #008000;">typeof</span></a><span style="color: #000000;">&#40;</span>Interface1<span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var assem = ty.<span style="color: #0000FF;">Assembly</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var types = from e <span style="color: #0600FF;">in</span> assem.<span style="color: #0000FF;">GetTypes</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> where e.<span style="color: #0000FF;">IsInterface</span> &amp;&amp; e.<span style="color: #0600FF;">Namespace</span> == <span style="color: #808080;">&quot;ConsoleApplication1.Test&quot;</span> select e;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">if</span><span style="color: #000000;">&#40;</span> types.<span style="color: #0000FF;">Count</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &gt; <span style="color: #FF0000;">0</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">foreach</span><span style="color: #000000;">&#40;</span>var cls <span style="color: #0600FF;">in</span> types<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Console.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;Function {0}() As {1}&quot;</span>,cls.<span style="color: #0000FF;">Name</span>.<span style="color: #0000FF;">Substring</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">1</span><span style="color: #000000;">&#41;</span>,cls.<span style="color: #0000FF;">Name</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Console.<span style="color: #0000FF;">ReadLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br /><span style="color: #000000;">&#125;</span><br /><br /></div><div id="cb77147" style="display: none; color: red;"></div></div></div>

<p>Yes that is C#. And why is it C#? Because I decided to write T4 templates in C#. To keep the generated code apart from the generating code. You could also write the generating code in VB.Net if you like.<br />
So we have this covered. Seemed simple enough. </p>

<h2>The template</h2>

<p>And now came the tricky part, writing the template.</p>

<p>First of all we create a file called IFactory.tt. Visual studio will give you a warning if you do that, but it is safe to ignore that warning, just pretend that you know what you are doing.</p>

<div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/DesktopDev/T4/T4_1.png" alt="" title="" width="548" height="199" /></div><p> </p>

<p>Then we add the generating language. and we tell it to output our file with a .vb extension.</p>

<div class="codebox"><div class="codeheader">Code: <span>text</span></div><div class="codeholder"><div class="text" id="cb37341" style="display: block; color: rgb(0, 0, 0);">&lt;#@ template language=&quot;C#&quot; #&gt;<br />&lt;#@ output extension=&quot;vb&quot; #&gt;<br /><br /></div><div id="cb9066" style="display: none; color: red;"></div></div></div>

<p>Now for the code.</p>

<div class="codebox"><div class="codeheader">Code: <span>text</span></div><div class="codeholder"><div class="text" id="cb86090" style="display: block; color: rgb(0, 0, 0);">Imports ConsoleApplication1.Test<br />&nbsp;<br />Namespace ConsoleApplication1.T4<br />&nbsp;<br />&nbsp; &nbsp; ''' &lt;summary&gt;<br />&nbsp; &nbsp; ''' <br />&nbsp; &nbsp; ''' &lt;/summary&gt;<br />&nbsp; &nbsp; ''' &lt;remarks&gt;&lt;/remarks&gt;<br />&nbsp; &nbsp; &lt;CLSCompliant(True)&gt; _<br />&nbsp; &nbsp; Public Interface IFactory<br />&nbsp;<br />#Region &quot;Methods&quot;<br />&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;# var ty = typeof(IInterface3);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var assem = ty.Assembly;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var types = from e in assem.GetTypes() where e.IsInterface &amp;&amp; e.Namespace == &quot;ConsoleApplication1.Test&quot; select e;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if( types.Count() &gt; 0)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; foreach(var cls in types)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var _FunctionName = cls.Name.Substring(1);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; ''' &lt;summary&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; ''' <br />&nbsp; &nbsp; &nbsp; &nbsp; ''' &lt;/summary&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; ''' &lt;returns&gt;&lt;/returns&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; ''' &lt;remarks&gt;&lt;/remarks&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; Function &lt;#=_FunctionName#&gt;() As &lt;#=cls.Name#&gt;<br />&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;#<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #&gt;<br />#End Region<br />&nbsp;<br />&nbsp; &nbsp; End Interface<br />&nbsp;<br />End Namespace<br /><br /></div><div id="cb46497" style="display: none; color: red;"></div></div></div>

<p>Text between <# #> tags is our code text between <#= #> tags is text that will be output to the file. Text between <#@ #> tags are directives.</p>

<p>The above will fail miserably and Google failed me too. </p>

<p>You will get 2 errors out of the above.</p>

<blockquote><p>Compiling transformation: The type or namespace name 'IFactory' could not be found (are you missing a using directive or an assembly reference?)</p>
</blockquote>

<p>and this one</p>

<blockquote><p>Compiling transformation: Could not find an implementation of the query pattern for source type 'System.Type[]'.  'Where' not found.  Are you missing a reference to 'System.Core.dll' or a using directive for 'System.Linq'?</p>
</blockquote>

<p>Clearly it is complaining that you need to set references and imports.</p>

<p>However it is not always clear to me when you need to this and for which libraries. I guess we just wait for an error and then add it.</p>

<p>In my case I needed to add these.</p>

<div class="codebox"><div class="codeheader">Code: <span>text</span></div><div class="codeholder"><div class="text" id="cb87027" style="display: block; color: rgb(0, 0, 0);">&lt;#@ assembly name=&quot;C:\..\bin\x86\Debug\ConsoleApplication1.exe&quot; #&gt;<br />&lt;#@ assembly name=&quot;System.Core&quot; #&gt;<br />&lt;#@ import namespace=&quot;System&quot; #&gt;<br />&lt;#@ import namespace=&quot;System.Linq&quot; #&gt;<br />&lt;#@ import namespace=&quot;System.Reflection&quot; #&gt;<br />&lt;#@ import namespace=&quot;ConsoleApplication1.Test&quot; #&gt;<br /><br /></div><div id="cb93750" style="display: none; color: red;"></div></div></div>

<p>The directives with assembly are actualy what you would do when you do Add reference for your project. If it is a system assembly then you can just use the short name like I did for System.Core if you want to reference one of you project then you need to add the fullpath and filename. like I did for my project. If you then have all the references you need you can add import directives. And then it all just works.</p>

<p>So the final code would then be.</p>

<div class="codebox"><div class="codeheader">Code: <span>text</span></div><div class="codeholder"><div class="text" id="cb37419" style="display: block; color: rgb(0, 0, 0);">&lt;#@ assembly name=&quot;C:\..\bin\x86\Debug\ConsoleApplication1.exe&quot; #&gt;<br />&lt;#@ assembly name=&quot;System.Core&quot; #&gt;<br />&lt;#@ import namespace=&quot;System&quot; #&gt;<br />&lt;#@ import namespace=&quot;System.Linq&quot; #&gt;<br />&lt;#@ import namespace=&quot;System.Reflection&quot; #&gt;<br />&lt;#@ import namespace=&quot;ConsoleApplication1.Test&quot; #&gt;<br />Imports ConsoleApplication1.Test<br />&nbsp;<br />Namespace ConsoleApplication1.T4<br />&nbsp;<br />&nbsp; &nbsp; ''' &lt;summary&gt;<br />&nbsp; &nbsp; ''' <br />&nbsp; &nbsp; ''' &lt;/summary&gt;<br />&nbsp; &nbsp; ''' &lt;remarks&gt;&lt;/remarks&gt;<br />&nbsp; &nbsp; &lt;CLSCompliant(True)&gt; _<br />&nbsp; &nbsp; Public Interface IFactory<br />&nbsp;<br />#Region &quot;Methods&quot;<br />&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;# var ty = typeof(IInterface3);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var assem = ty.Assembly;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var types = from e in assem.GetTypes() where e.IsInterface &amp;&amp; e.Namespace == &quot;ConsoleApplication1.Test&quot; select e;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if( types.Count() &gt; 0)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; foreach(var cls in types)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var _FunctionName = cls.Name.Substring(1);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; ''' &lt;summary&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; ''' <br />&nbsp; &nbsp; &nbsp; &nbsp; ''' &lt;/summary&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; ''' &lt;returns&gt;&lt;/returns&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; ''' &lt;remarks&gt;&lt;/remarks&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; Function &lt;#=_FunctionName#&gt;() As &lt;#=cls.Name#&gt;<br />&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;#<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #&gt;<br />#End Region<br />&nbsp;<br />&nbsp; &nbsp; End Interface<br />&nbsp;<br />End Namespace<br /><br /></div><div id="cb2280" style="display: none; color: red;"></div></div></div>

<p>The tt will now have a vb file attached to it.</p>

<div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/DesktopDev/T4/T4_3.png" alt="" title="" width="194" height="56" /></div><p> </p>

<p>And that will then look like this.</p>

<div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/DesktopDev/T4/T4_2.png" alt="" title="" width="647" height="809" /></div> <div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/DesktopDev/T4/T4_3.png" alt="" title="" width="194" height="56" /></div><p> </p>

<p>All ready for use. Now I can just add an interface and the factory will.</p>

<p><span class="MT_red">Warning</span></p>

<p>The above code works, but as soon as you build your project it wiil complain to say that the exe in the bin folder is blocked. This is a well known problem. It has to with the fact that the template engine does not release the AppDomain immediatly, but it caches it. There is however a nice solution to this problem. And it is called the T4 toolbox and the VolatileAssembly. You just need to download and install the Toolbox then you need to swap the assembly directive to this.</p>

<p>You can read more abot this problem in these locations.</p>

<p><#@ VolatileAssembly processor="T4Toolbox.VolatileAssemblyProcessor" name="$(SolutionDir)/ConsoleApplication1/bin/Debug/ConsoleApplication1.exe" #></p>

<ul>  
  <li><a href="http://www.olegsych.com/2008/02/t4-assembly-directive/">Understanding T4: <#@ assembly #> directive</a> by <a href="http://www.olegsych.com/">Oleg Sych</a></li>
  <li><a href="http://siderite.blogspot.com/2010/06/working-with-t4.html">Working with the T4</a> by <a href="http://siderite.blogspot.com">Siderite</a></li>
</ul>

<h2>Conclusion</h2>

<p>Code generation is a powerful tool that can take a lot of work out of your hands. But it can also become a maintenance nightmare if you aren't careful. I learned a lot while making this post. And all this because someone on <a href="http://stackoverflow.com">Stackoverflow </a>asked <a href="http://stackoverflow.com/questions/3317141/vb-net-automatically-add-namespace-when-adding-new-item">how to add the namespace to a class template for VB.Net</a>.</p>

<h2>Resources</h2>

<ul>
  <li><a href="http://www.hanselman.com/blog/T4TextTemplateTransformationToolkitCodeGenerationBestKeptVisualStudioSecret.aspx">T4 (Text Template Transformation Toolkit) Code Generation - Best Kept Visual Studio Secret</a> by <a href="http://www.hanselman.com">Scott Hanselman</a></li>
  <li><a href="http://www.dotnetthoughts.net/2009/07/31/code-generation-using-t4-templates/">Code generation using T4 Templates</a> by <a href="http://www.dotnetthoughts.net">DotNetThoughts</a></li>
  <li><a href="http://www.olegsych.com/tag/t4/">Everything about T4</a> by <a href="http://www.olegsych.com">Oleg Sych</a></li>
  <li><a href="http://msdn.microsoft.com/en-us/library/bb126484%28VS.90%29.aspx">Walkthrough: Creating and Running Text Templates</a> on MSDN</li>
<li><a href="http://visualstudiomagazine.com/articles/2010/04/01/scaled-down-code-generation.aspx">How-To Q&amp;A: How Can I Automate Code Without Resorting to Heavy Code-Generation Techniques?</a> by Kathleen Dollard</li>
</ul><a href="http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/t4-template-to-make-a-factory-class"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/t4-template-to-make-a-factory-class&amp;source=LessThanDot" height="61" width="51" /></a><div class="item_footer"><p><small><a href="http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/t4-template-to-make-a-factory-class">Original post</a> blogged on <a href="http://lessthandot.com/">LessThanDot</a>.</small></p></div>]]></content:encoded>
								<comments>http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/t4-template-to-make-a-factory-class#comments</comments>
		</item>
				<item>
			<title>WPF and the splashscreen</title>
			<link>http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/wpf-and-the-splashscreen</link>
			<pubDate>Fri, 23 Jul 2010 08:22:58 +0000</pubDate>			<dc:creator>chrissie1</dc:creator>
			<category domain="main">Microsoft Technologies</category>
<category domain="alt">VB.NET</category>			<guid isPermaLink="false">909@http://blogs.lessthandot.com/</guid>
						<description>&lt;h3&gt;by &lt;a href=&quot;http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;amp;author=7&quot;&gt; chrissie1 &lt;/a&gt;&lt;/h3&gt;&lt;h2&gt;Introduction&lt;/h2&gt;

&lt;p&gt;Making a splashscreen in WPF is easy, since the .Net framework SP1 there is even a built in method to do this. But this method only accepts a static image. I would have liked a more dynamic thing. Something that says what it is doing. And something that fades in and out and has a custom shape. I'm not very demanding but I know this would be very complicated in windows forms. Possible but difficult. In WPF it seems a bit easier. So I went on a Google frenzy and combined several things I found along the way.&lt;/p&gt;

&lt;h2&gt;The static splashscreen&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;Make a nice Image.&lt;/li&gt;
  &lt;li&gt;Add it to the project via Add-&gt;Existing Item or Ctrl+D.&lt;/li&gt;
  &lt;li&gt;Click on the file and change the Build action to SplashScreen&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/DesktopDev/splash/splash3.png&quot; alt=&quot;&quot; title=&quot;&quot; width=&quot;348&quot; height=&quot;270&quot; /&gt;&lt;/div&gt;

&lt;p&gt;And that's all there is to it. It does have fade-in and fade-out effect. &lt;br /&gt;
   &lt;/p&gt;
&lt;h2&gt;The dynamic splashscreen&lt;/h2&gt;

&lt;p&gt;This was very easy since Google's first hit was this &lt;a href=&quot;http://social.msdn.microsoft.com/forums/en/wpf/thread/b0b9cb71-f74d-4a68-b07d-10ae0877ba6a/&quot;&gt;MSDN forum post&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;And someone even handed us the VB.Net sample.&lt;/p&gt;

&lt;p&gt;So I just had to add a window called splash.xaml &lt;/p&gt;

&lt;p&gt;That had these properties.&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;xml&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;xml&quot; id=&quot;cb57542&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;ResizeMode=&amp;quot;NoResize&amp;quot; &lt;br /&gt;ShowInTaskbar=&amp;quot;False&amp;quot; &lt;br /&gt;WindowStartupLocation=&amp;quot;CenterScreen&amp;quot; &lt;br /&gt;WindowStyle=&amp;quot;None&amp;quot; &lt;br /&gt;Topmost=&amp;quot;True&amp;quot; &lt;br /&gt;ShowActivated=&amp;quot;False&amp;quot;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb51885&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And this in the code behind.&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;vbnet&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;vbnet&quot; id=&quot;cb42967&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;Namespace View.&lt;span style=&quot;color: #000000;&quot;&gt;Forms&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Class&lt;/span&gt; Splash&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Public&lt;/span&gt; Splash&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Private&lt;/span&gt; Shared InitCompleted &lt;span style=&quot;color: #0600FF;&quot;&gt;As&lt;/span&gt; AsyncCallback&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Private&lt;/span&gt; Shared result &lt;span style=&quot;color: #0600FF;&quot;&gt;As&lt;/span&gt; IAsyncResult&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Private&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt; Window1_Loaded&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: #0600FF;&quot;&gt;As&lt;/span&gt; System.&lt;span style=&quot;color: #000000;&quot;&gt;Object&lt;/span&gt;, &lt;span style=&quot;color: #0600FF;&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: #0600FF;&quot;&gt;As&lt;/span&gt; System.&lt;span style=&quot;color: #000000;&quot;&gt;Windows&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;RoutedEventArgs&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Handles&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;MyBase&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;Loaded&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; InitCompleted = AddressOf _initCompleted&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; result = My.&lt;span style=&quot;color: #000000;&quot;&gt;Application&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;dLoadSplash&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;BeginInvoke&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;Me&lt;/span&gt;, InitCompleted, &lt;span style=&quot;color: #0600FF;&quot;&gt;Nothing&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lblProgress.&lt;span style=&quot;color: #000000;&quot;&gt;Content&lt;/span&gt; = &lt;span style=&quot;color: #0600FF;&quot;&gt;&amp;quot;Loading...&amp;quot;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Private&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt; _initCompleted&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; My.&lt;span style=&quot;color: #000000;&quot;&gt;Application&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;dLoadSplash&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;EndInvoke&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;result&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dispatcher.&lt;span style=&quot;color: #000000;&quot;&gt;BeginInvoke&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;New&lt;/span&gt; Action&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;AddressOf _closeWindow&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;, Windows.&lt;span style=&quot;color: #000000;&quot;&gt;Threading&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;DispatcherPriority&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;Normal&lt;/span&gt;, &lt;span style=&quot;color: #0600FF;&quot;&gt;Nothing&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Private&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt; _closeWindow&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Close&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt; SetProgress&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;ByVal&lt;/span&gt; Message &lt;span style=&quot;color: #0600FF;&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dispatcher.&lt;span style=&quot;color: #000000;&quot;&gt;BeginInvoke&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;New&lt;/span&gt; Action&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;Of &lt;span style=&quot;color: #0600FF;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;AddressOf _SetProgress&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;, Windows.&lt;span style=&quot;color: #000000;&quot;&gt;Threading&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;DispatcherPriority&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;Normal&lt;/span&gt;, Message&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Private&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt; _SetProgress&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;ByVal&lt;/span&gt; Message &lt;span style=&quot;color: #0600FF;&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lblProgress.&lt;span style=&quot;color: #000000;&quot;&gt;Content&lt;/span&gt; = Message&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Class&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;End&lt;/span&gt; Namespace&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb61710&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I changed it so that you can show messages to the user and I set the progressbar to continuous. &lt;/p&gt;

&lt;p&gt;Then we just make this form the startup form. And we add a little bit of code to the codebehind of Application to make it all work.&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;vbnet&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;vbnet&quot; id=&quot;cb24498&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;Imports TDB2009.&lt;span style=&quot;color: #000000;&quot;&gt;View&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;WPFMenu&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;View&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;Forms&lt;/span&gt;&lt;br /&gt;Imports TDB2009.&lt;span style=&quot;color: #000000;&quot;&gt;Utils&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;IoC&lt;/span&gt;&lt;br /&gt;Imports TDB2009.&lt;span style=&quot;color: #000000;&quot;&gt;View&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;WPFMenu&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;Startup&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;Interfaces&lt;/span&gt;&lt;br /&gt;Imports System.&lt;span style=&quot;color: #000000;&quot;&gt;Windows&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;Threading&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Class&lt;/span&gt; Application&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Public&lt;/span&gt; dLoadSplash &lt;span style=&quot;color: #0600FF;&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;New&lt;/span&gt; _dLoadSplash&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;AddressOf LoadSplash&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Public&lt;/span&gt; Delegate &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt; _dLoadSplash&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;ByVal&lt;/span&gt; w &lt;span style=&quot;color: #0600FF;&quot;&gt;As&lt;/span&gt; Splash&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Private&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt; LoadSplash&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;ByVal&lt;/span&gt; w &lt;span style=&quot;color: #0600FF;&quot;&gt;As&lt;/span&gt; Splash&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; w.&lt;span style=&quot;color: #000000;&quot;&gt;SetProgress&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;&amp;quot;Configuring Container&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; IoCUtil.&lt;span style=&quot;color: #000000;&quot;&gt;InsertConfigOfContainingType&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;Of IoC.&lt;span style=&quot;color: #000000;&quot;&gt;Configure&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Dim&lt;/span&gt; _StartUp &lt;span style=&quot;color: #0600FF;&quot;&gt;As&lt;/span&gt; IStartUp = Container.&lt;span style=&quot;color: #000000;&quot;&gt;Resolve&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;Of IStartUp&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; w.&lt;span style=&quot;color: #000000;&quot;&gt;SetProgress&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;&amp;quot;Starting Mainwindow&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dispatcher.&lt;span style=&quot;color: #000000;&quot;&gt;BeginInvoke&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;New&lt;/span&gt; Action&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;AddressOf CreateMainWindow&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;, DispatcherPriority.&lt;span style=&quot;color: #000000;&quot;&gt;Normal&lt;/span&gt;, &lt;span style=&quot;color: #0600FF;&quot;&gt;Nothing&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Private&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt; CreateMainWindow&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MainWindow = Container.&lt;span style=&quot;color: #000000;&quot;&gt;Resolve&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;Of View.&lt;span style=&quot;color: #000000;&quot;&gt;Forms&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;Interfaces&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;IMenu&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MainWindow.&lt;span style=&quot;color: #000000;&quot;&gt;Show&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Private&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt; Application_Exit&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: #0600FF;&quot;&gt;As&lt;/span&gt; Object, &lt;span style=&quot;color: #0600FF;&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: #0600FF;&quot;&gt;As&lt;/span&gt; System.&lt;span style=&quot;color: #000000;&quot;&gt;Windows&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;ExitEventArgs&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Handles&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Me&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;Exit&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Container.&lt;span style=&quot;color: #000000;&quot;&gt;DisposeAll&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Class&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb40880&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That was simple and I didn't change much from what I saw in the post. You can just copy/paste it but you have to understand what it is doing.&lt;/p&gt;

&lt;h2&gt;The fade in and fade out&lt;/h2&gt;

&lt;p&gt;But the above code is still not much better than what we can do in winforms. So now it is time to add some fade in and fade out to it. Again I directed my attention to Google and found some inspiration in a &lt;a href=&quot;http://stackoverflow.com/questions/867656/fading-out-a-wpf-window-on-close&quot;&gt;Stackoverflow article&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;But there are some problems with what they said, the solution is not really copy-pastable as is. &lt;/p&gt;

&lt;p&gt;Getting a fade in is easy. you just add a trigger to the window, like so.&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;xml&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;xml&quot; id=&quot;cb300&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;Window&lt;/span&gt;.Triggers&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;EventTrigger&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;RoutedEvent&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Window.Loaded&amp;quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;BeginStoryboard&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;Storyboard&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;DoubleAnimation&lt;/span&gt; Storyboard.&lt;span style=&quot;color: #000066;&quot;&gt;TargetProperty&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Opacity&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;From&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;0&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;To&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;1&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;Duration&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;0:0:2&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;FillBehavior&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;HoldEnd&amp;quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/Storyboard&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/BeginStoryboard&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/EventTrigger&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/Window&lt;/span&gt;.Triggers&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb61493&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That works, but it had one minor glitch that I will cover in a little bit.&lt;/p&gt;

&lt;p&gt;Then you need to add the fadeout. This is more work and needs some code behind.&lt;/p&gt;

&lt;p&gt;First you add some xaml.&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;xml&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;xml&quot; id=&quot;cb50275&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;Window&lt;/span&gt;.Resources&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;Storyboard&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;x:Key&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;closeStoryBoard&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;Completed&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;closeStoryBoard_Completed&amp;quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;DoubleAnimation&lt;/span&gt; Storyboard.&lt;span style=&quot;color: #000066;&quot;&gt;TargetProperty&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Opacity&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;From&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;1&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;To&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;0&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;Duration&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;0:0:2&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;FillBehavior&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;HoldEnd&amp;quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/Storyboard&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/Window&lt;/span&gt;.Resources&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb33047&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And then you add a few bits to the codebehind.&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;vbnet&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;vbnet&quot; id=&quot;cb73873&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;Private&lt;/span&gt; closeStoryBoardCompleted &lt;span style=&quot;color: #0600FF;&quot;&gt;As&lt;/span&gt; Boolean&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Private&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt; Splash_Closing&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: #0600FF;&quot;&gt;As&lt;/span&gt; Object, &lt;span style=&quot;color: #0600FF;&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: #0600FF;&quot;&gt;As&lt;/span&gt; System.&lt;span style=&quot;color: #000000;&quot;&gt;ComponentModel&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;CancelEventArgs&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Handles&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Me&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;Closing&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If Not closeStoryBoardCompleted &lt;span style=&quot;color: #0600FF;&quot;&gt;Then&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Me&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;Resources&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;&amp;quot;closeStoryBoard&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;Begin&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;Me&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.&lt;span style=&quot;color: #000000;&quot;&gt;Cancel&lt;/span&gt; = True&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;End&lt;/span&gt; If&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Private&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt; closeStoryBoard_Completed&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: #0600FF;&quot;&gt;As&lt;/span&gt; System.&lt;span style=&quot;color: #000000;&quot;&gt;Object&lt;/span&gt;, &lt;span style=&quot;color: #0600FF;&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: #0600FF;&quot;&gt;As&lt;/span&gt; System.&lt;span style=&quot;color: #000000;&quot;&gt;EventArgs&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; closeStoryBoardCompleted = True&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Me&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;Close&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb3808&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This has a slight bug in it. Which can only be seen if your splash screen is not going to be shown long enough (less than 4 seconds to be precise). So I had to make a few adaptations so that I would still get a fade in and out even if the loading of the form takes less than 4 seconds.&lt;/p&gt;

&lt;p&gt;First we add an event completed to the beginstoryboard. like so.&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;xml&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;xml&quot; id=&quot;cb13630&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;Window&lt;/span&gt;.Triggers&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;EventTrigger&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;RoutedEvent&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Window.Loaded&amp;quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;BeginStoryboard&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;Storyboard&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;color: #000066;&quot;&gt;Completed&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;beginStoryBoard_Completed&amp;quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;DoubleAnimation&lt;/span&gt; Storyboard.&lt;span style=&quot;color: #000066;&quot;&gt;TargetProperty&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Opacity&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;From&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;0&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;To&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;1&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;Duration&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;0:0:2&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;FillBehavior&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;HoldEnd&amp;quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/Storyboard&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/BeginStoryboard&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/EventTrigger&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/Window&lt;/span&gt;.Triggers&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb77191&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And then we change our codebehind to this.&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;vbnet&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;vbnet&quot; id=&quot;cb30377&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;Private&lt;/span&gt; closeStoryBoardCompleted &lt;span style=&quot;color: #0600FF;&quot;&gt;As&lt;/span&gt; Boolean&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Private&lt;/span&gt; beginStoryBoardCompleted &lt;span style=&quot;color: #0600FF;&quot;&gt;As&lt;/span&gt; Boolean&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Private&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt; Splash_Closing&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: #0600FF;&quot;&gt;As&lt;/span&gt; Object, &lt;span style=&quot;color: #0600FF;&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: #0600FF;&quot;&gt;As&lt;/span&gt; System.&lt;span style=&quot;color: #000000;&quot;&gt;ComponentModel&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;CancelEventArgs&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Handles&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Me&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;Closing&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If Not closeStoryBoardCompleted AndAlso beginStoryBoardCompleted &lt;span style=&quot;color: #0600FF;&quot;&gt;Then&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Me&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;Resources&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;&amp;quot;closeStoryBoard&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;Begin&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;Me&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.&lt;span style=&quot;color: #000000;&quot;&gt;Cancel&lt;/span&gt; = True&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;End&lt;/span&gt; If&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Private&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt; closeStoryBoard_Completed&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: #0600FF;&quot;&gt;As&lt;/span&gt; System.&lt;span style=&quot;color: #000000;&quot;&gt;Object&lt;/span&gt;, &lt;span style=&quot;color: #0600FF;&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: #0600FF;&quot;&gt;As&lt;/span&gt; System.&lt;span style=&quot;color: #000000;&quot;&gt;EventArgs&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; closeStoryBoardCompleted = True&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Me&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;Close&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Private&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt; beginStoryBoard_Completed&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: #0600FF;&quot;&gt;As&lt;/span&gt; System.&lt;span style=&quot;color: #000000;&quot;&gt;Object&lt;/span&gt;, &lt;span style=&quot;color: #0600FF;&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: #0600FF;&quot;&gt;As&lt;/span&gt; System.&lt;span style=&quot;color: #000000;&quot;&gt;EventArgs&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; beginStoryBoardCompleted = True&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb74116&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I added the beginstoryboardcompleted and made sure it only it was set to true, meaning the fadein is done, before starting the fadeout. Simple really, if you understand what you are copy pasting. &lt;/p&gt;

&lt;h2&gt;The custom shape&lt;/h2&gt;

&lt;p&gt;To make a form a custom shape is just as easy. First you set your window properties like so.&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;xml&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;xml&quot; id=&quot;cb68425&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;Background=&amp;quot;Transparent&amp;quot;&lt;br /&gt;AllowsTransparency=&amp;quot;True&amp;quot;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb15535&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then you add an image to form. and that's it.&lt;/p&gt;

&lt;p&gt;And just for fun I made the ugliest splashscreen you can think of, but it works. This is the design view.&lt;/p&gt;

&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/DesktopDev/splash/splash1.png&quot; alt=&quot;&quot; title=&quot;&quot; width=&quot;500&quot; height=&quot;364&quot; /&gt;&lt;/div&gt;&lt;p&gt; &lt;/p&gt;

&lt;p&gt;See how the image is outside of the bounds of the window?&lt;/p&gt;

&lt;p&gt;Now see that when you run it it will chop of those parts.&lt;/p&gt;

&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/DesktopDev/splash/splash2.png&quot; alt=&quot;&quot; title=&quot;&quot; width=&quot;434&quot; height=&quot;362&quot; /&gt;&lt;/div&gt;&lt;p&gt; &lt;/p&gt;

&lt;p&gt;So now your window is completely transparent and as ugly as I could make it ;-).&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;Making a dynamic splashscreen in WPF is easy and well worth the trouble. Your users will love you. Getting to grips is easy too, you can use Google and find just about anything you want or can think of. Some examples are just good and some examples need a little work. Some examples need to be ignored. But remember don't just copy paste the code, try to understand it first. You know you understood it when you can combine and change different pieces and make them work together.&lt;/p&gt;&lt;a href=&quot;http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/wpf-and-the-splashscreen&quot;&gt;&lt;img src=&quot;http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/wpf-and-the-splashscreen&amp;source=LessThanDot&quot; height=&quot;61&quot; width=&quot;51&quot; /&gt;&lt;/a&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/wpf-and-the-splashscreen&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://lessthandot.com/&quot;&gt;LessThanDot&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[				<h3>by <a href="http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;author=7"> chrissie1 </a></h3>
				<h2>Introduction</h2>

<p>Making a splashscreen in WPF is easy, since the .Net framework SP1 there is even a built in method to do this. But this method only accepts a static image. I would have liked a more dynamic thing. Something that says what it is doing. And something that fades in and out and has a custom shape. I'm not very demanding but I know this would be very complicated in windows forms. Possible but difficult. In WPF it seems a bit easier. So I went on a Google frenzy and combined several things I found along the way.</p>

<h2>The static splashscreen</h2>

<ul>
  <li>Make a nice Image.</li>
  <li>Add it to the project via Add->Existing Item or Ctrl+D.</li>
  <li>Click on the file and change the Build action to SplashScreen</li>
</ul>

<div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/DesktopDev/splash/splash3.png" alt="" title="" width="348" height="270" /></div>

<p>And that's all there is to it. It does have fade-in and fade-out effect. <br />
   </p>
<h2>The dynamic splashscreen</h2>

<p>This was very easy since Google's first hit was this <a href="http://social.msdn.microsoft.com/forums/en/wpf/thread/b0b9cb71-f74d-4a68-b07d-10ae0877ba6a/">MSDN forum post</a>.</p>

<p>And someone even handed us the VB.Net sample.</p>

<p>So I just had to add a window called splash.xaml </p>

<p>That had these properties.</p>

<div class="codebox"><div class="codeheader">Code: <span>xml</span></div><div class="codeholder"><div class="xml" id="cb79520" style="display: block; color: rgb(0, 0, 0);">ResizeMode=&quot;NoResize&quot; <br />ShowInTaskbar=&quot;False&quot; <br />WindowStartupLocation=&quot;CenterScreen&quot; <br />WindowStyle=&quot;None&quot; <br />Topmost=&quot;True&quot; <br />ShowActivated=&quot;False&quot;<br /><br /></div><div id="cb10419" style="display: none; color: red;"></div></div></div>

<p>And this in the code behind.</p>

<div class="codebox"><div class="codeheader">Code: <span>vbnet</span></div><div class="codeholder"><div class="vbnet" id="cb76783" style="display: block; color: rgb(0, 0, 0);">Namespace View.<span style="color: #000000;">Forms</span><br />&nbsp; &nbsp; <span style="color: #0600FF;">Public</span> <span style="color: #0600FF;">Class</span> Splash<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Public</span> Splash<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Private</span> Shared InitCompleted <span style="color: #0600FF;">As</span> AsyncCallback<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Private</span> Shared result <span style="color: #0600FF;">As</span> IAsyncResult<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Private</span> <span style="color: #0600FF;">Sub</span> Window1_Loaded<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">ByVal</span> sender <span style="color: #0600FF;">As</span> System.<span style="color: #000000;">Object</span>, <span style="color: #0600FF;">ByVal</span> e <span style="color: #0600FF;">As</span> System.<span style="color: #000000;">Windows</span>.<span style="color: #000000;">RoutedEventArgs</span><span style="color: #000000;">&#41;</span> <span style="color: #0600FF;">Handles</span> <span style="color: #0600FF;">MyBase</span>.<span style="color: #000000;">Loaded</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; InitCompleted = AddressOf _initCompleted<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result = My.<span style="color: #000000;">Application</span>.<span style="color: #000000;">dLoadSplash</span>.<span style="color: #000000;">BeginInvoke</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">Me</span>, InitCompleted, <span style="color: #0600FF;">Nothing</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lblProgress.<span style="color: #000000;">Content</span> = <span style="color: #0600FF;">&quot;Loading...&quot;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span><br />&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Private</span> <span style="color: #0600FF;">Sub</span> _initCompleted<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; My.<span style="color: #000000;">Application</span>.<span style="color: #000000;">dLoadSplash</span>.<span style="color: #000000;">EndInvoke</span><span style="color: #000000;">&#40;</span>result<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Dispatcher.<span style="color: #000000;">BeginInvoke</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">New</span> Action<span style="color: #000000;">&#40;</span>AddressOf _closeWindow<span style="color: #000000;">&#41;</span>, Windows.<span style="color: #000000;">Threading</span>.<span style="color: #000000;">DispatcherPriority</span>.<span style="color: #000000;">Normal</span>, <span style="color: #0600FF;">Nothing</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span><br />&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Private</span> <span style="color: #0600FF;">Sub</span> _closeWindow<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Close<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span><br />&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Public</span> <span style="color: #0600FF;">Sub</span> SetProgress<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">ByVal</span> Message <span style="color: #0600FF;">As</span> <span style="color: #0600FF;">String</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Dispatcher.<span style="color: #000000;">BeginInvoke</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">New</span> Action<span style="color: #000000;">&#40;</span>Of <span style="color: #0600FF;">String</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#40;</span>AddressOf _SetProgress<span style="color: #000000;">&#41;</span>, Windows.<span style="color: #000000;">Threading</span>.<span style="color: #000000;">DispatcherPriority</span>.<span style="color: #000000;">Normal</span>, Message<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span><br />&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Private</span> <span style="color: #0600FF;">Sub</span> _SetProgress<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">ByVal</span> Message <span style="color: #0600FF;">As</span> <span style="color: #0600FF;">String</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lblProgress.<span style="color: #000000;">Content</span> = Message<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span><br />&nbsp;<br /><span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Class</span><br /><span style="color: #0600FF;">End</span> Namespace<br /><br /></div><div id="cb57515" style="display: none; color: red;"></div></div></div>

<p>I changed it so that you can show messages to the user and I set the progressbar to continuous. </p>

<p>Then we just make this form the startup form. And we add a little bit of code to the codebehind of Application to make it all work.</p>

<div class="codebox"><div class="codeheader">Code: <span>vbnet</span></div><div class="codeholder"><div class="vbnet" id="cb72987" style="display: block; color: rgb(0, 0, 0);">Imports TDB2009.<span style="color: #000000;">View</span>.<span style="color: #000000;">WPFMenu</span>.<span style="color: #000000;">View</span>.<span style="color: #000000;">Forms</span><br />Imports TDB2009.<span style="color: #000000;">Utils</span>.<span style="color: #000000;">IoC</span><br />Imports TDB2009.<span style="color: #000000;">View</span>.<span style="color: #000000;">WPFMenu</span>.<span style="color: #000000;">Startup</span>.<span style="color: #000000;">Interfaces</span><br />Imports System.<span style="color: #000000;">Windows</span>.<span style="color: #000000;">Threading</span><br />&nbsp;<br /><span style="color: #0600FF;">Public</span> <span style="color: #0600FF;">Class</span> Application<br />&nbsp;<br />&nbsp; &nbsp; <span style="color: #0600FF;">Public</span> dLoadSplash <span style="color: #0600FF;">As</span> <span style="color: #0600FF;">New</span> _dLoadSplash<span style="color: #000000;">&#40;</span>AddressOf LoadSplash<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <br />&nbsp; &nbsp; <span style="color: #0600FF;">Public</span> Delegate <span style="color: #0600FF;">Sub</span> _dLoadSplash<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">ByVal</span> w <span style="color: #0600FF;">As</span> Splash<span style="color: #000000;">&#41;</span><br />&nbsp;<br />&nbsp; &nbsp; <span style="color: #0600FF;">Private</span> <span style="color: #0600FF;">Sub</span> LoadSplash<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">ByVal</span> w <span style="color: #0600FF;">As</span> Splash<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; w.<span style="color: #000000;">SetProgress</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">&quot;Configuring Container&quot;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; IoCUtil.<span style="color: #000000;">InsertConfigOfContainingType</span><span style="color: #000000;">&#40;</span>Of IoC.<span style="color: #000000;">Configure</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> _StartUp <span style="color: #0600FF;">As</span> IStartUp = Container.<span style="color: #000000;">Resolve</span><span style="color: #000000;">&#40;</span>Of IStartUp<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; w.<span style="color: #000000;">SetProgress</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">&quot;Starting Mainwindow&quot;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; Dispatcher.<span style="color: #000000;">BeginInvoke</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">New</span> Action<span style="color: #000000;">&#40;</span>AddressOf CreateMainWindow<span style="color: #000000;">&#41;</span>, DispatcherPriority.<span style="color: #000000;">Normal</span>, <span style="color: #0600FF;">Nothing</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span><br />&nbsp;<br />&nbsp; &nbsp; <span style="color: #0600FF;">Private</span> <span style="color: #0600FF;">Sub</span> CreateMainWindow<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MainWindow = Container.<span style="color: #000000;">Resolve</span><span style="color: #000000;">&#40;</span>Of View.<span style="color: #000000;">Forms</span>.<span style="color: #000000;">Interfaces</span>.<span style="color: #000000;">IMenu</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MainWindow.<span style="color: #000000;">Show</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span><br />&nbsp; &nbsp; <br />&nbsp; &nbsp; <span style="color: #0600FF;">Private</span> <span style="color: #0600FF;">Sub</span> Application_Exit<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">ByVal</span> sender <span style="color: #0600FF;">As</span> Object, <span style="color: #0600FF;">ByVal</span> e <span style="color: #0600FF;">As</span> System.<span style="color: #000000;">Windows</span>.<span style="color: #000000;">ExitEventArgs</span><span style="color: #000000;">&#41;</span> <span style="color: #0600FF;">Handles</span> <span style="color: #0600FF;">Me</span>.<span style="color: #000000;">Exit</span><br />&nbsp; &nbsp; &nbsp; &nbsp; Container.<span style="color: #000000;">DisposeAll</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span><br /><span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Class</span><br /><br /></div><div id="cb70834" style="display: none; color: red;"></div></div></div>

<p>That was simple and I didn't change much from what I saw in the post. You can just copy/paste it but you have to understand what it is doing.</p>

<h2>The fade in and fade out</h2>

<p>But the above code is still not much better than what we can do in winforms. So now it is time to add some fade in and fade out to it. Again I directed my attention to Google and found some inspiration in a <a href="http://stackoverflow.com/questions/867656/fading-out-a-wpf-window-on-close">Stackoverflow article</a>.</p>

<p>But there are some problems with what they said, the solution is not really copy-pastable as is. </p>

<p>Getting a fade in is easy. you just add a trigger to the window, like so.</p>

<div class="codebox"><div class="codeheader">Code: <span>xml</span></div><div class="codeholder"><div class="xml" id="cb6399" style="display: block; color: rgb(0, 0, 0);"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Window</span>.Triggers<span style="font-weight: bold; color: black;">&gt;</span></span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;EventTrigger</span> <span style="color: #000066;">RoutedEvent</span>=<span style="color: #ff0000;">&quot;Window.Loaded&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;BeginStoryboard<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Storyboard<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;DoubleAnimation</span> Storyboard.<span style="color: #000066;">TargetProperty</span>=<span style="color: #ff0000;">&quot;Opacity&quot;</span> <span style="color: #000066;">From</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">To</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000066;">Duration</span>=<span style="color: #ff0000;">&quot;0:0:2&quot;</span> <span style="color: #000066;">FillBehavior</span>=<span style="color: #ff0000;">&quot;HoldEnd&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Storyboard<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/BeginStoryboard<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/EventTrigger<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Window</span>.Triggers<span style="font-weight: bold; color: black;">&gt;</span></span><br /><br /></div><div id="cb65113" style="display: none; color: red;"></div></div></div>

<p>That works, but it had one minor glitch that I will cover in a little bit.</p>

<p>Then you need to add the fadeout. This is more work and needs some code behind.</p>

<p>First you add some xaml.</p>

<div class="codebox"><div class="codeheader">Code: <span>xml</span></div><div class="codeholder"><div class="xml" id="cb27651" style="display: block; color: rgb(0, 0, 0);"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Window</span>.Resources<span style="font-weight: bold; color: black;">&gt;</span></span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Storyboard</span> <span style="color: #000066;">x:Key</span>=<span style="color: #ff0000;">&quot;closeStoryBoard&quot;</span> <span style="color: #000066;">Completed</span>=<span style="color: #ff0000;">&quot;closeStoryBoard_Completed&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;DoubleAnimation</span> Storyboard.<span style="color: #000066;">TargetProperty</span>=<span style="color: #ff0000;">&quot;Opacity&quot;</span> <span style="color: #000066;">From</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000066;">To</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">Duration</span>=<span style="color: #ff0000;">&quot;0:0:2&quot;</span> <span style="color: #000066;">FillBehavior</span>=<span style="color: #ff0000;">&quot;HoldEnd&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Storyboard<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Window</span>.Resources<span style="font-weight: bold; color: black;">&gt;</span></span><br /><br /></div><div id="cb27139" style="display: none; color: red;"></div></div></div>

<p>And then you add a few bits to the codebehind.</p>

<div class="codebox"><div class="codeheader">Code: <span>vbnet</span></div><div class="codeholder"><div class="vbnet" id="cb22437" style="display: block; color: rgb(0, 0, 0);"><span style="color: #0600FF;">Private</span> closeStoryBoardCompleted <span style="color: #0600FF;">As</span> Boolean<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Private</span> <span style="color: #0600FF;">Sub</span> Splash_Closing<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">ByVal</span> sender <span style="color: #0600FF;">As</span> Object, <span style="color: #0600FF;">ByVal</span> e <span style="color: #0600FF;">As</span> System.<span style="color: #000000;">ComponentModel</span>.<span style="color: #000000;">CancelEventArgs</span><span style="color: #000000;">&#41;</span> <span style="color: #0600FF;">Handles</span> <span style="color: #0600FF;">Me</span>.<span style="color: #000000;">Closing</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If Not closeStoryBoardCompleted <span style="color: #0600FF;">Then</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Me</span>.<span style="color: #000000;">Resources</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">&quot;closeStoryBoard&quot;</span><span style="color: #000000;">&#41;</span>.<span style="color: #000000;">Begin</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">Me</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.<span style="color: #000000;">Cancel</span> = True<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> If<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span><br />&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Private</span> <span style="color: #0600FF;">Sub</span> closeStoryBoard_Completed<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">ByVal</span> sender <span style="color: #0600FF;">As</span> System.<span style="color: #000000;">Object</span>, <span style="color: #0600FF;">ByVal</span> e <span style="color: #0600FF;">As</span> System.<span style="color: #000000;">EventArgs</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; closeStoryBoardCompleted = True<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Me</span>.<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span><br /><br /></div><div id="cb86064" style="display: none; color: red;"></div></div></div>

<p>This has a slight bug in it. Which can only be seen if your splash screen is not going to be shown long enough (less than 4 seconds to be precise). So I had to make a few adaptations so that I would still get a fade in and out even if the loading of the form takes less than 4 seconds.</p>

<p>First we add an event completed to the beginstoryboard. like so.</p>

<div class="codebox"><div class="codeheader">Code: <span>xml</span></div><div class="codeholder"><div class="xml" id="cb1030" style="display: block; color: rgb(0, 0, 0);"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Window</span>.Triggers<span style="font-weight: bold; color: black;">&gt;</span></span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;EventTrigger</span> <span style="color: #000066;">RoutedEvent</span>=<span style="color: #ff0000;">&quot;Window.Loaded&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;BeginStoryboard<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Storyboard</span> &nbsp;<span style="color: #000066;">Completed</span>=<span style="color: #ff0000;">&quot;beginStoryBoard_Completed&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;DoubleAnimation</span> Storyboard.<span style="color: #000066;">TargetProperty</span>=<span style="color: #ff0000;">&quot;Opacity&quot;</span> <span style="color: #000066;">From</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">To</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000066;">Duration</span>=<span style="color: #ff0000;">&quot;0:0:2&quot;</span> <span style="color: #000066;">FillBehavior</span>=<span style="color: #ff0000;">&quot;HoldEnd&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Storyboard<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/BeginStoryboard<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/EventTrigger<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Window</span>.Triggers<span style="font-weight: bold; color: black;">&gt;</span></span><br /><br /></div><div id="cb93074" style="display: none; color: red;"></div></div></div>

<p>And then we change our codebehind to this.</p>

<div class="codebox"><div class="codeheader">Code: <span>vbnet</span></div><div class="codeholder"><div class="vbnet" id="cb21558" style="display: block; color: rgb(0, 0, 0);"><span style="color: #0600FF;">Private</span> closeStoryBoardCompleted <span style="color: #0600FF;">As</span> Boolean<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Private</span> beginStoryBoardCompleted <span style="color: #0600FF;">As</span> Boolean<br />&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Private</span> <span style="color: #0600FF;">Sub</span> Splash_Closing<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">ByVal</span> sender <span style="color: #0600FF;">As</span> Object, <span style="color: #0600FF;">ByVal</span> e <span style="color: #0600FF;">As</span> System.<span style="color: #000000;">ComponentModel</span>.<span style="color: #000000;">CancelEventArgs</span><span style="color: #000000;">&#41;</span> <span style="color: #0600FF;">Handles</span> <span style="color: #0600FF;">Me</span>.<span style="color: #000000;">Closing</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If Not closeStoryBoardCompleted AndAlso beginStoryBoardCompleted <span style="color: #0600FF;">Then</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Me</span>.<span style="color: #000000;">Resources</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">&quot;closeStoryBoard&quot;</span><span style="color: #000000;">&#41;</span>.<span style="color: #000000;">Begin</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">Me</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.<span style="color: #000000;">Cancel</span> = True<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> If<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span><br />&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Private</span> <span style="color: #0600FF;">Sub</span> closeStoryBoard_Completed<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">ByVal</span> sender <span style="color: #0600FF;">As</span> System.<span style="color: #000000;">Object</span>, <span style="color: #0600FF;">ByVal</span> e <span style="color: #0600FF;">As</span> System.<span style="color: #000000;">EventArgs</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; closeStoryBoardCompleted = True<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Me</span>.<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span><br />&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Private</span> <span style="color: #0600FF;">Sub</span> beginStoryBoard_Completed<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">ByVal</span> sender <span style="color: #0600FF;">As</span> System.<span style="color: #000000;">Object</span>, <span style="color: #0600FF;">ByVal</span> e <span style="color: #0600FF;">As</span> System.<span style="color: #000000;">EventArgs</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; beginStoryBoardCompleted = True<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span><br /><br /></div><div id="cb50757" style="display: none; color: red;"></div></div></div>

<p>I added the beginstoryboardcompleted and made sure it only it was set to true, meaning the fadein is done, before starting the fadeout. Simple really, if you understand what you are copy pasting. </p>

<h2>The custom shape</h2>

<p>To make a form a custom shape is just as easy. First you set your window properties like so.</p>

<div class="codebox"><div class="codeheader">Code: <span>xml</span></div><div class="codeholder"><div class="xml" id="cb68615" style="display: block; color: rgb(0, 0, 0);">Background=&quot;Transparent&quot;<br />AllowsTransparency=&quot;True&quot;<br /><br /></div><div id="cb75467" style="display: none; color: red;"></div></div></div>

<p>Then you add an image to form. and that's it.</p>

<p>And just for fun I made the ugliest splashscreen you can think of, but it works. This is the design view.</p>

<div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/DesktopDev/splash/splash1.png" alt="" title="" width="500" height="364" /></div><p> </p>

<p>See how the image is outside of the bounds of the window?</p>

<p>Now see that when you run it it will chop of those parts.</p>

<div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/DesktopDev/splash/splash2.png" alt="" title="" width="434" height="362" /></div><p> </p>

<p>So now your window is completely transparent and as ugly as I could make it ;-).</p>

<h2>Conclusion</h2>

<p>Making a dynamic splashscreen in WPF is easy and well worth the trouble. Your users will love you. Getting to grips is easy too, you can use Google and find just about anything you want or can think of. Some examples are just good and some examples need a little work. Some examples need to be ignored. But remember don't just copy paste the code, try to understand it first. You know you understood it when you can combine and change different pieces and make them work together.</p><a href="http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/wpf-and-the-splashscreen"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/wpf-and-the-splashscreen&amp;source=LessThanDot" height="61" width="51" /></a><div class="item_footer"><p><small><a href="http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/wpf-and-the-splashscreen">Original post</a> blogged on <a href="http://lessthandot.com/">LessThanDot</a>.</small></p></div>]]></content:encoded>
								<comments>http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/wpf-and-the-splashscreen#comments</comments>
		</item>
				<item>
			<title>Resources for Professional Development</title>
			<link>http://blogs.lessthandot.com/index.php/ITProfessionals/ProfessionalDevelopment/resources-for-professional-development</link>
			<pubDate>Thu, 22 Jul 2010 22:36:24 +0000</pubDate>			<dc:creator>tarwn</dc:creator>
			<category domain="main">Professional Development</category>			<guid isPermaLink="false">906@http://blogs.lessthandot.com/</guid>
						<description>&lt;h3&gt;by &lt;a href=&quot;http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;amp;author=9&quot;&gt; tarwn &lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Waiting for your company to provide training courses or advancement opportunities? It might be a long wait. Unfortunately many companies overlook professional development or consistently sacrifice it when the first round of annual budget cuts occur. Even when we do get training opportunities, many of us continue to select classes at random, based on what seems interesting at the moment.&lt;/p&gt;

&lt;p&gt;We live in a field that is expanding daily, where the environment we work in is drastically different from what it was 5 years ago and from what it will be 5 years from now. Whether we plan on being in a different role or not, advancing our skills and staying in step with the market is a must.&lt;/p&gt;

&lt;p&gt;This post covers a number of helpful links and ideas for staying up to date in our field.&lt;/p&gt;

&lt;h2&gt;Development Plans&lt;/h2&gt;
&lt;p&gt;Creating a development plan can help provide focus and give us a measure of our progress. These articles provide additional information on creating and refining our plans:&lt;/p&gt;
&lt;ul style=&quot;margin: 1em 2em;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://www.informit.com/guides/content.aspx?g=sqlserver&amp;amp;seqNum=356&quot; title=&quot;Read SQL Server Professional Development Plan, Part 1&quot;&gt;SQL Server Professional Development Plan, Part 1&lt;/a&gt; and &lt;a href=&quot;http://www.informit.com/guides/content.aspx?g=sqlserver&amp;amp;seqNum=357&quot; title=&quot;Read SQL Server Professional Development Plan, Part 2&quot;&gt;Part 2&lt;/a&gt; by Buck Woody (&lt;a href=&quot;http://blogs.msdn.com/b/buckwoody/&quot; title=&quot;Buck Woody's blog&quot;&gt;blog&lt;/a&gt; | &lt;a href=&quot;http://twitter.com/buckwoody&quot; title=&quot;Buck Woody on twitter&quot;&gt;twitter&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.greatleadershipbydan.com/2008/11/how-to-write-great-individual.html&quot; title=&quot;Read How to Write a Great Individual Development Plan (IDP)&quot;&gt;How to Write a Great Individual Development Plan (IDP)&lt;/a&gt; and a great &lt;a href=&quot;http://www.greatleadershipbydan.com/2008/04/checklist-for-great-individual.html&quot; title=&quot;Read Checklist for Great Individual&quot;&gt;checklist&lt;/a&gt; by Dan McCarthy (&lt;a href=&quot;http://www.greatleadershipbydan.com/&quot; title=&quot;Great Leadership blog by Dan McCarthy&quot;&gt;blog&lt;/a&gt; | &lt;a href=&quot;http://twitter.com/greatleadership&quot; title=&quot;Dan McCarthy on Twitter&quot;&gt;twitter&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://facility9.com/2009/09/14/your-own-personal-development-plan&quot; title=&quot;Read Your Own Personal Development Plan&quot;&gt;Your Own Personal Development Plan&lt;/a&gt; by Jeremiah Peschka (&lt;a href=&quot;http://facility9.com/&quot; title=&quot;facility9 blog&quot;&gt;blog&lt;/a&gt; | &lt;a href=&quot;http://twitter.com/peschkaj&quot; title=&quot;Jeremiah on Twitter&quot;&gt;twitter&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Tools and Processes&lt;/h2&gt;
&lt;p&gt;Once we have a plan, we need to be able to execute it. Having tools to help us execute the plan, methods of communicating the plan, and tricks for finding time can all help us be successful. &lt;/p&gt;
&lt;ul style=&quot;margin: 1em 2em;&quot;&gt;
&lt;li&gt;The &lt;a href=&quot;http://personalkanban.com/personal-kanban-101/&quot; title=&quot;More information on Personal Kanban&quot;&gt;Personal Kanban&lt;/a&gt; site has a lot of good information on creating a visual board and process to help manage short and long term tasks&lt;/li&gt;
&lt;li&gt;Jes Borland (&lt;a href=&quot;http://jesborland.wordpress.com/&quot; title=&quot;Jes Borland's blog&quot;&gt;blog&lt;/a&gt; | &lt;a href=&quot;http://twitter.com/grrl_geek&quot; title=&quot;Jes Borland on Twitter&quot;&gt;twitter&lt;/a&gt;) helps track her progress by reporting a &lt;a href=&quot;http://jesborland.wordpress.com/2010/07/08/2010-quarter-2-goal-review/&quot; title=&quot;2010 Quarter 2 Goal Review by Jes Borland&quot;&gt;Quarterly Status&lt;/a&gt; to her friends and the wider community&lt;/li&gt;
&lt;li&gt;And &lt;a href=&quot;http://www.openforum.com/idea-hub/topics/lifestyle/article/80-ways-to-steal-valuable-minutes-for-your-work-day-glen-stansberry&quot; title=&quot;Read 80 Ways to Steal Valuable Minutes for Your Work Day&quot;&gt;American Express's OPEN Forum &lt;/a&gt; has a number of ideas on where we can find time to execute&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Free and Cheap Resources&lt;/h2&gt;
&lt;p&gt;Not all development costs money. My own plan includes a certain amount of blog writing (free), reading a certain number of articles each week (free), an ongoing effort to keep up to date with webinars and webcasts (free), and attendance (and beginning to speak) at user groups and events (the free kind).&lt;/p&gt;

&lt;p&gt;I can't afford Tech-Ed or the PASS Summit, but I can afford:&lt;/p&gt;
&lt;ul style=&quot;margin: 1em 2em;&quot;&gt;
	&lt;li&gt;Watching the &lt;a href=&quot;http://www.msteched.com/&quot; title=&quot;Watch recorded Tech-Ed sessions&quot;&gt;recorded Tech-Ed sessions&lt;/a&gt; for free at MSDN (I've had over &lt;a href=&quot;http://delicious.com/tarwn/tech-ed&quot; title=&quot;Eli's Tech-Ed Delicious bookmarks&quot;&gt;11 hours&lt;/a&gt; of free training so far)&lt;/li&gt;
	&lt;li&gt;Watching the &lt;a href=&quot;http://www.sqlpass.org/LearningCenter/SummitOnDemand/Summit2008.aspx&quot; title=&quot;2008 PASS Summmit recordings&quot;&gt;2008 PASS Summit recordings&lt;/a&gt; for free (requires login)&lt;/li&gt;
	&lt;li&gt;Catching free &lt;a href=&quot;https://msevents.microsoft.com/CUI/default.aspx?culture=en-US&quot; title=&quot;Microsoft Events Home&quot;&gt;live and recorded webcasts&lt;/a&gt; from Microsoft&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Plus there are events like &lt;a href=&quot;http://www.sqlsaturday.com/&quot; title=&quot;SQLSaturday website&quot;&gt;SQLSaturday&lt;/a&gt;, &lt;a href=&quot;http://www.google.com/search?q=code+camp&quot; title=&quot;Search for Code Camps&quot;&gt;Code Camps&lt;/a&gt;, and user groups galore that don't cost $1000's to attend.&lt;/p&gt;

&lt;p&gt;If you need more ideas, Ted (&lt;a href=&quot;http://blogs.lessthandot.com/index.php/All/?summary.php?author=68&quot; title=&quot;Ted's blog posts&quot;&gt;blog&lt;/a&gt; | &lt;a href=&quot;http://twitter.com/onpnt&quot; title=&quot;Ted on Twitter&quot;&gt;twitter&lt;/a&gt;) posted an article with more SQL Resources &lt;a href=&quot;http://blogs.lessthandot.com/index.php/ITProfessionals/EthicsIT/sql-help-and-resources&quot; title=&quot;SQL Community Services - Resources everywhere!&quot;&gt;here&lt;/a&gt; and I presented a list of ideas in &lt;a href=&quot;http://blogs.lessthandot.com/index.php/ITProfessionals/ITProcesses/there-is-never-time-for-part-1&quot; title=&quot;Read Part 1 of the &quot;There is Never Time For...&quot; series&quot;&gt;Part 1&lt;/a&gt; of the &quot;There is Never Time For...&quot; series.&lt;/p&gt;

&lt;p&gt;Have more ideas or links for resources? Add them to the comments below. I'm always on the lookout for more ideas and I'm sure others would appreciate them as well.&lt;/p&gt;&lt;a href=&quot;http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/ITProfessionals/ProfessionalDevelopment/resources-for-professional-development&quot;&gt;&lt;img src=&quot;http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/ITProfessionals/ProfessionalDevelopment/resources-for-professional-development&amp;source=LessThanDot&quot; height=&quot;61&quot; width=&quot;51&quot; /&gt;&lt;/a&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blogs.lessthandot.com/index.php/ITProfessionals/ProfessionalDevelopment/resources-for-professional-development&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://lessthandot.com/&quot;&gt;LessThanDot&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[				<h3>by <a href="http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;author=9"> tarwn </a></h3>
				<p>Waiting for your company to provide training courses or advancement opportunities? It might be a long wait. Unfortunately many companies overlook professional development or consistently sacrifice it when the first round of annual budget cuts occur. Even when we do get training opportunities, many of us continue to select classes at random, based on what seems interesting at the moment.</p>

<p>We live in a field that is expanding daily, where the environment we work in is drastically different from what it was 5 years ago and from what it will be 5 years from now. Whether we plan on being in a different role or not, advancing our skills and staying in step with the market is a must.</p>

<p>This post covers a number of helpful links and ideas for staying up to date in our field.</p>

<h2>Development Plans</h2>
<p>Creating a development plan can help provide focus and give us a measure of our progress. These articles provide additional information on creating and refining our plans:</p>
<ul style="margin: 1em 2em;">
<li><a href="http://www.informit.com/guides/content.aspx?g=sqlserver&amp;seqNum=356" title="Read SQL Server Professional Development Plan, Part 1">SQL Server Professional Development Plan, Part 1</a> and <a href="http://www.informit.com/guides/content.aspx?g=sqlserver&amp;seqNum=357" title="Read SQL Server Professional Development Plan, Part 2">Part 2</a> by Buck Woody (<a href="http://blogs.msdn.com/b/buckwoody/" title="Buck Woody's blog">blog</a> | <a href="http://twitter.com/buckwoody" title="Buck Woody on twitter">twitter</a>)</li>
<li><a href="http://www.greatleadershipbydan.com/2008/11/how-to-write-great-individual.html" title="Read How to Write a Great Individual Development Plan (IDP)">How to Write a Great Individual Development Plan (IDP)</a> and a great <a href="http://www.greatleadershipbydan.com/2008/04/checklist-for-great-individual.html" title="Read Checklist for Great Individual">checklist</a> by Dan McCarthy (<a href="http://www.greatleadershipbydan.com/" title="Great Leadership blog by Dan McCarthy">blog</a> | <a href="http://twitter.com/greatleadership" title="Dan McCarthy on Twitter">twitter</a>)</li>
<li><a href="http://facility9.com/2009/09/14/your-own-personal-development-plan" title="Read Your Own Personal Development Plan">Your Own Personal Development Plan</a> by Jeremiah Peschka (<a href="http://facility9.com/" title="facility9 blog">blog</a> | <a href="http://twitter.com/peschkaj" title="Jeremiah on Twitter">twitter</a>)</li>
</ul>

<h2>Tools and Processes</h2>
<p>Once we have a plan, we need to be able to execute it. Having tools to help us execute the plan, methods of communicating the plan, and tricks for finding time can all help us be successful. </p>
<ul style="margin: 1em 2em;">
<li>The <a href="http://personalkanban.com/personal-kanban-101/" title="More information on Personal Kanban">Personal Kanban</a> site has a lot of good information on creating a visual board and process to help manage short and long term tasks</li>
<li>Jes Borland (<a href="http://jesborland.wordpress.com/" title="Jes Borland's blog">blog</a> | <a href="http://twitter.com/grrl_geek" title="Jes Borland on Twitter">twitter</a>) helps track her progress by reporting a <a href="http://jesborland.wordpress.com/2010/07/08/2010-quarter-2-goal-review/" title="2010 Quarter 2 Goal Review by Jes Borland">Quarterly Status</a> to her friends and the wider community</li>
<li>And <a href="http://www.openforum.com/idea-hub/topics/lifestyle/article/80-ways-to-steal-valuable-minutes-for-your-work-day-glen-stansberry" title="Read 80 Ways to Steal Valuable Minutes for Your Work Day">American Express's OPEN Forum </a> has a number of ideas on where we can find time to execute</li>
</ul>

<h2>Free and Cheap Resources</h2>
<p>Not all development costs money. My own plan includes a certain amount of blog writing (free), reading a certain number of articles each week (free), an ongoing effort to keep up to date with webinars and webcasts (free), and attendance (and beginning to speak) at user groups and events (the free kind).</p>

<p>I can't afford Tech-Ed or the PASS Summit, but I can afford:</p>
<ul style="margin: 1em 2em;">
	<li>Watching the <a href="http://www.msteched.com/" title="Watch recorded Tech-Ed sessions">recorded Tech-Ed sessions</a> for free at MSDN (I've had over <a href="http://delicious.com/tarwn/tech-ed" title="Eli's Tech-Ed Delicious bookmarks">11 hours</a> of free training so far)</li>
	<li>Watching the <a href="http://www.sqlpass.org/LearningCenter/SummitOnDemand/Summit2008.aspx" title="2008 PASS Summmit recordings">2008 PASS Summit recordings</a> for free (requires login)</li>
	<li>Catching free <a href="https://msevents.microsoft.com/CUI/default.aspx?culture=en-US" title="Microsoft Events Home">live and recorded webcasts</a> from Microsoft</li>
</ul>

<p>Plus there are events like <a href="http://www.sqlsaturday.com/" title="SQLSaturday website">SQLSaturday</a>, <a href="http://www.google.com/search?q=code+camp" title="Search for Code Camps">Code Camps</a>, and user groups galore that don't cost $1000's to attend.</p>

<p>If you need more ideas, Ted (<a href="http://blogs.lessthandot.com/index.php/All/?summary.php?author=68" title="Ted's blog posts">blog</a> | <a href="http://twitter.com/onpnt" title="Ted on Twitter">twitter</a>) posted an article with more SQL Resources <a href="http://blogs.lessthandot.com/index.php/ITProfessionals/EthicsIT/sql-help-and-resources" title="SQL Community Services - Resources everywhere!">here</a> and I presented a list of ideas in <a href="http://blogs.lessthandot.com/index.php/ITProfessionals/ITProcesses/there-is-never-time-for-part-1" title="Read Part 1 of the "There is Never Time For..." series">Part 1</a> of the "There is Never Time For..." series.</p>

<p>Have more ideas or links for resources? Add them to the comments below. I'm always on the lookout for more ideas and I'm sure others would appreciate them as well.</p><a href="http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/ITProfessionals/ProfessionalDevelopment/resources-for-professional-development"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/ITProfessionals/ProfessionalDevelopment/resources-for-professional-development&amp;source=LessThanDot" height="61" width="51" /></a><div class="item_footer"><p><small><a href="http://blogs.lessthandot.com/index.php/ITProfessionals/ProfessionalDevelopment/resources-for-professional-development">Original post</a> blogged on <a href="http://lessthandot.com/">LessThanDot</a>.</small></p></div>]]></content:encoded>
								<comments>http://blogs.lessthandot.com/index.php/ITProfessionals/ProfessionalDevelopment/resources-for-professional-development#comments</comments>
		</item>
				<item>
			<title>RID Lookup take me down</title>
			<link>http://blogs.lessthandot.com/index.php/DataMgmt/DBAdmin/rid-lookup-sql-tuning</link>
			<pubDate>Mon, 19 Jul 2010 00:21:52 +0000</pubDate>			<dc:creator>Ted Krueger (onpnt)</dc:creator>
			<category domain="alt">Data Modelling &amp; Design</category>
<category domain="alt">Database Programming</category>
<category domain="main">Database Administration</category>
<category domain="alt">Microsoft SQL Server Admin</category>
<category domain="alt">Microsoft SQL Server</category>			<guid isPermaLink="false">907@http://blogs.lessthandot.com/</guid>
						<description>&lt;h3&gt;by &lt;a href=&quot;http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;amp;author=68&quot;&gt; Ted Krueger (onpnt) &lt;/a&gt;&lt;/h3&gt;&lt;p&gt;This is your query on a rollercoaster.  Not a fun trip and sometimes bringing a paper bag with you is a necessity.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/DataMgmt/rid_1.gif&quot; alt=&quot;&quot; title=&quot;&quot; width=&quot;361&quot; height=&quot;248&quot; /&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It really happens&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The scenario starts with a phone call from the support desk reporting failed integrations from the ERP system to the WMS system.  This integration process is critical for the production of items with the company to fulfill orders and build inventory.  Without the process, finished goods inventory is not posted and thus does not become available for sale.  This causes a more detrimental effect on financial reporting and filters down to the revolving reason we are in business - making money.&lt;/p&gt;

&lt;p&gt;In a normal IT team structure, there are three high-level components we all start with to troubleshoot backend systems process failures:  Network, Systems/Applications and Database Server Performance.  Each team sector should work together and focus on their specialty to document possibly causes.  This will benefit the situation the best and also create a collaboration point where the team can compile everything found in order to proceed with the fix.   As a DBA you will find yourself in this situation often and there are a couple of key points you can focus on to quickly determine if the cause is the database server.  After your findings the DBA can then focus on areas to alter, tune or repair.&lt;/p&gt;

&lt;p&gt;In the scenario that my own team found themselves in recently, the troubleshooting steps lead to find timeouts occurring within the integration processing of the application.  The application was kind enough to have built in logging to show the query that was being timed out which greatly lowered the analytical stage in finding the root cause.  In most cases this isn't logged but with the combination of profiler and monitoring during these timeouts, the query can be extracted in order to proceed with determining if it is the cause and possible resolution.&lt;/p&gt;

&lt;p&gt;Once looking at the execution plan of the query that was in the log related to the timeouts, an RID Lookup operation was found with an Index Seek.  In some cases an RID Lookup may not cause any problems with performance and go without notice.  However is this case, the table in question that the query was requesting data from was roughly five millions rows.  This type of table size will cause the RID Lookup to slow the performance of even the simplest queries.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Showing is learning&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To portray the data, indexes and query we will step through recreating the exact situation that occurred.&lt;/p&gt;

&lt;p&gt;First step will be to create a database that we can work in.  We will then create an item table and load the item table from use of the AdventureWorks database table, &quot;Production.Product&quot;.&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;&lt;span class=&quot;MT_red&quot;&gt;Note: AdventureWorks can be used for this entire recreation but to retain the database as it is the secondary database was created for example purposes.&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Run the following to prepare the database and needed objects:&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;tsql&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;tsql&quot; id=&quot;cb28437&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;USE&lt;/span&gt; master&lt;br /&gt;GO&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;CREATE&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;DATABASE&lt;/span&gt; &lt;span style=&quot;color: #808080;&quot;&gt;&amp;#91;&lt;/span&gt;EXE_PLANS&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;ON&lt;/span&gt; &amp;nbsp;&lt;span style=&quot;color: #0000FF;&quot;&gt;PRIMARY&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;NAME = N&lt;span style=&quot;color: #FF0000;&quot;&gt;'EXE_PLANS'&lt;/span&gt;, &lt;br /&gt;&amp;nbsp;FILENAME = N&lt;span style=&quot;color: #FF0000;&quot;&gt;'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\EXE_PLANS.mdf'&lt;/span&gt;, &lt;br /&gt;&amp;nbsp;&lt;span style=&quot;color: #0000FF;&quot;&gt;SIZE&lt;/span&gt; = 2048KB, &lt;br /&gt;&amp;nbsp;MAXSIZE = 1024000KB, &lt;br /&gt;&amp;nbsp;FILEGROWTH = 409600KB&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;span style=&quot;color: #FF00FF;&quot;&gt;LOG&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;ON&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;NAME = N&lt;span style=&quot;color: #FF0000;&quot;&gt;'EXE_PLANS_log'&lt;/span&gt;, &lt;br /&gt;&amp;nbsp;FILENAME = N&lt;span style=&quot;color: #FF0000;&quot;&gt;'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\EXE_PLANS_log.ldf'&lt;/span&gt;, &lt;br /&gt;&amp;nbsp;&lt;span style=&quot;color: #0000FF;&quot;&gt;SIZE&lt;/span&gt; = 1024KB, &lt;br /&gt;&amp;nbsp;MAXSIZE = 102400KB, &lt;br /&gt;&amp;nbsp;FILEGROWTH = 10240KB&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;GO&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;USE&lt;/span&gt; &lt;span style=&quot;color: #808080;&quot;&gt;&amp;#91;&lt;/span&gt;EXE_PLANS&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;br /&gt;GO&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;CREATE&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;TABLE&lt;/span&gt; ITEMS&lt;br /&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;ITEMCODE &lt;span style=&quot;color: #0000FF;&quot;&gt;INT&lt;/span&gt;,&lt;br /&gt;&amp;nbsp;ITEMNAME &lt;span style=&quot;color: #0000FF;&quot;&gt;VARCHAR&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000;&quot;&gt;50&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt;,&lt;br /&gt;&amp;nbsp;LASTMODIFY &lt;span style=&quot;color: #0000FF;&quot;&gt;DATETIME&lt;/span&gt;,&lt;br /&gt;&amp;nbsp;CREATEDATE &lt;span style=&quot;color: #0000FF;&quot;&gt;DATE&lt;/span&gt;,&lt;br /&gt;&amp;nbsp;CREATETIME &lt;span style=&quot;color: #0000FF;&quot;&gt;TIME&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;GO&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;INSERT&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;INTO&lt;/span&gt; ITEMS&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;SELECT&lt;/span&gt; &lt;br /&gt;&amp;nbsp;Prods.&lt;span style=&quot;color: #202020;&quot;&gt;ProductID&lt;/span&gt;,&lt;br /&gt;&amp;nbsp;Prods.&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#91;&lt;/span&gt;Name&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#93;&lt;/span&gt;,&lt;br /&gt;&amp;nbsp;&lt;span style=&quot;color: #FF00FF;&quot;&gt;GETDATE&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt;,&lt;br /&gt;&amp;nbsp;&lt;span style=&quot;color: #FF00FF;&quot;&gt;GETDATE&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt;,&lt;br /&gt;&amp;nbsp;&lt;span style=&quot;color: #FF00FF;&quot;&gt;GETDATE&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;FROM&lt;/span&gt; &lt;br /&gt;AdventureWorks.&lt;span style=&quot;color: #202020;&quot;&gt;Production&lt;/span&gt;.&lt;span style=&quot;color: #202020;&quot;&gt;Product&lt;/span&gt; Prods&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb73449&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;p&gt;Now that we have our testing area, we can create some common indexes that may be found on a table like the items tables.&lt;/p&gt;

&lt;p&gt;First a nonclustered index on the ITEMCODE&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;tsql&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;tsql&quot; id=&quot;cb85208&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;CREATE&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;UNIQUE&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;NONCLUSTERED&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;INDEX&lt;/span&gt; IDX_ITEMID &lt;span style=&quot;color: #0000FF;&quot;&gt;ON&lt;/span&gt; ITEMS&lt;br /&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;ITEMCODE&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;WITH&lt;/span&gt; &lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;FILLFACTOR&lt;/span&gt; = &lt;span style=&quot;color: #000;&quot;&gt;85&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb24199&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Next, a nonclustered index on CREATETIME, ITEMCODE and CREATEDATE&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;tsql&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;tsql&quot; id=&quot;cb64945&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;CREATE&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;NONCLUSTERED&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;INDEX&lt;/span&gt; IDX_PRODID_DATE_ASC &lt;span style=&quot;color: #0000FF;&quot;&gt;ON&lt;/span&gt; ITEMS&lt;br /&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;CREATETIME,ITEMCODE,CREATEDATE&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;INCLUDE &lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;ITEMNAME&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;WITH&lt;/span&gt; &lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;FILLFACTOR&lt;/span&gt; = &lt;span style=&quot;color: #000;&quot;&gt;80&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb69196&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Once these indexes are created we can run a basic query to extract ITEMNAME and CREATETIME with a WHERE clause only looking at a specific ITEMCODE value.  &lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;tsql&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;tsql&quot; id=&quot;cb68&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;SELECT&lt;/span&gt;&lt;br /&gt;&amp;nbsp;ITEMS.&lt;span style=&quot;color: #202020;&quot;&gt;ITEMNAME&lt;/span&gt;,&lt;br /&gt;&amp;nbsp;ITEMS.&lt;span style=&quot;color: #202020;&quot;&gt;CREATETIME&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;FROM&lt;/span&gt; ITEMS&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;WHERE&lt;/span&gt; ITEMCODE = &lt;span style=&quot;color: #000;&quot;&gt;1&lt;/span&gt;&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb61398&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;

&lt;p&gt;We should be fine as the nonclustered index, &quot;IDX_ITEMID&quot; should be used in an index seek given the WHERE clause on ITEMCODE.  However, when we run this query to check the estimated execution plan, we can see we have a lookup occurring.&lt;/p&gt;

&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/DataMgmt/rid_2.gif&quot; alt=&quot;&quot; title=&quot;&quot; width=&quot;624&quot; height=&quot;368&quot; /&gt;&lt;/div&gt;

&lt;p&gt;The lookup is caused by the fact that there is not a covering index to fulfill the entire needs of the query.  The WHERE clause and columns returned combined equate to, &quot;covering&quot;.  In order to satisfy this query and remove the RID Lookup, we need to create a covering index or a clustered index on the ITEMCODE.   Creating a clustered index physically orders the data under the conditions of the index and in some cases (like this) that was not possible.  An effective solution in this case is a nonclustered index covering the entire query requirements.&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;&lt;span class=&quot;MT_red&quot;&gt;Note: Let's say that the table in question isn't a HEAP and there is an existing clustered index on a different key.  Since we can only have one clustered index per table, the resolution of ITEMCODE becoming a clustered index to resolve our RID Lookup is not possible.  A nonclustered index is then the only way to resolve (or remove) the RID Lookup.  &lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;&lt;p&gt;To create a covering index we can do the following&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;tsql&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;tsql&quot; id=&quot;cb20747&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;CREATE&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;NONCLUSTERED&lt;/span&gt; &lt;span style=&quot;color: #0000FF;&quot;&gt;INDEX&lt;/span&gt; IDX_COVERING_ASC &lt;span style=&quot;color: #0000FF;&quot;&gt;ON&lt;/span&gt; ITEMS&lt;br /&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;ITEMCODE,LASTMODIFY,ITEMNAME,CREATETIME&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;WITH&lt;/span&gt; &lt;span style=&quot;color: #808080;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000FF;&quot;&gt;FILLFACTOR&lt;/span&gt;=&lt;span style=&quot;color: #000;&quot;&gt;80&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb34362&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;

&lt;p&gt;After looking at our execution plan, we should see only the index seek operation being performed&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/DataMgmt/rid_5.gif&quot; alt=&quot;&quot; title=&quot;&quot; width=&quot;628&quot; height=&quot;229&quot; /&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;p&gt;Let's put things into perspective.  We all know an index seek is optimal (in most cases).  We do see our index seek in the execution plan prior to our resolution of a covering index but we have the handicap of the RID Lookup being performed in a nested loop with the index seek.  This will result in the cost of the index seek operation plus essentially the same effect of a table scan under a nested loop operation.  For each record we find in the index seek, we have to run out to the disk, find the remaining data we need in order to fulfill the needs of the query.  &lt;br /&gt;
This is all reflected in a nested loop operation.&lt;/p&gt;  &lt;br /&gt;
&lt;br /&gt;
&lt;p&gt;What is shown below is the Index Seek retrieving the data directly based on the index pointers and requiring a need to loop back to the data to fulfill all of the data needed by the request.  This causes the query to perform slowly and also increases the possibility for high CPU utilization and high IO.  &lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/DataMgmt/rid_4.gif&quot; alt=&quot;&quot; title=&quot;&quot; /&gt;&lt;/div&gt; &lt;/p&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;p&gt;Basic troubleshooting steps of query performance like this should be a daily part of database tuning and monitoring.  Allowing changes to go directly into production database servers without the initiative of code reviews and heavy testing will allow these types of problems to happen.  The best resolution of all is to prevent these types of problems by not bypassing those normal transport objectives.&lt;/p&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;p&gt;&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/DataMgmt/rid_grant.gif&quot; alt=&quot;&quot; title=&quot;&quot; width=&quot;137&quot; height=&quot;137&quot; align=&quot;left&quot; /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;For learning more on Execution Plans, I highly recommend purchasing, &lt;a href=&quot;http://www.amazon.com/Server-Execution-Plans-Grant-Fritchey/dp/1906434026&quot;&gt;SQL Server Execution Plans&lt;/a&gt; by Grant Fritchey.  This book goes into each operation you will encounter in plans and some ways to resolve operations that are not optimal.  Grant (&lt;a href=&quot;http://twitter.com/gfritchey&quot;&gt;Twitter&lt;/a&gt; | &lt;a href=&quot;http://scarydba.wordpress.com/&quot;&gt;Blog&lt;/a&gt;) is also a widely known and respected expert on Execution Plans and database tuning.  Reading his blog and following him will greatly benefit your daily work as a DBA or Developer on SQL Server.&lt;/p&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;a href=&quot;http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/DataMgmt/DBAdmin/rid-lookup-sql-tuning&quot;&gt;&lt;img src=&quot;http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/DataMgmt/DBAdmin/rid-lookup-sql-tuning&amp;source=LessThanDot&quot; height=&quot;61&quot; width=&quot;51&quot; /&gt;&lt;/a&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blogs.lessthandot.com/index.php/DataMgmt/DBAdmin/rid-lookup-sql-tuning&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://lessthandot.com/&quot;&gt;LessThanDot&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[				<h3>by <a href="http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;author=68"> Ted Krueger (onpnt) </a></h3>
				<p>This is your query on a rollercoaster.  Not a fun trip and sometimes bringing a paper bag with you is a necessity.<br />
<br />
<div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/DataMgmt/rid_1.gif" alt="" title="" width="361" height="248" /></div></p>

<p><strong>It really happens</strong></p>

<p>The scenario starts with a phone call from the support desk reporting failed integrations from the ERP system to the WMS system.  This integration process is critical for the production of items with the company to fulfill orders and build inventory.  Without the process, finished goods inventory is not posted and thus does not become available for sale.  This causes a more detrimental effect on financial reporting and filters down to the revolving reason we are in business - making money.</p>

<p>In a normal IT team structure, there are three high-level components we all start with to troubleshoot backend systems process failures:  Network, Systems/Applications and Database Server Performance.  Each team sector should work together and focus on their specialty to document possibly causes.  This will benefit the situation the best and also create a collaboration point where the team can compile everything found in order to proceed with the fix.   As a DBA you will find yourself in this situation often and there are a couple of key points you can focus on to quickly determine if the cause is the database server.  After your findings the DBA can then focus on areas to alter, tune or repair.</p>

<p>In the scenario that my own team found themselves in recently, the troubleshooting steps lead to find timeouts occurring within the integration processing of the application.  The application was kind enough to have built in logging to show the query that was being timed out which greatly lowered the analytical stage in finding the root cause.  In most cases this isn't logged but with the combination of profiler and monitoring during these timeouts, the query can be extracted in order to proceed with determining if it is the cause and possible resolution.</p>

<p>Once looking at the execution plan of the query that was in the log related to the timeouts, an RID Lookup operation was found with an Index Seek.  In some cases an RID Lookup may not cause any problems with performance and go without notice.  However is this case, the table in question that the query was requesting data from was roughly five millions rows.  This type of table size will cause the RID Lookup to slow the performance of even the simplest queries.</p>

<p><strong>Showing is learning</strong></p>

<p>To portray the data, indexes and query we will step through recreating the exact situation that occurred.</p>

<p>First step will be to create a database that we can work in.  We will then create an item table and load the item table from use of the AdventureWorks database table, "Production.Product".</p>

<blockquote><p><span class="MT_red">Note: AdventureWorks can be used for this entire recreation but to retain the database as it is the secondary database was created for example purposes.</span></p></blockquote>

<p>Run the following to prepare the database and needed objects:</p>

<div class="codebox"><div class="codeheader">Code: <span>tsql</span></div><div class="codeholder"><div class="tsql" id="cb48837" style="display: block; color: rgb(0, 0, 0);"><span style="color: #0000FF;">USE</span> master<br />GO<br /><span style="color: #0000FF;">CREATE</span> <span style="color: #0000FF;">DATABASE</span> <span style="color: #808080;">&#91;</span>EXE_PLANS<span style="color: #808080;">&#93;</span> <span style="color: #0000FF;">ON</span> &nbsp;<span style="color: #0000FF;">PRIMARY</span> <br /><span style="color: #808080;">&#40;</span>NAME = N<span style="color: #FF0000;">'EXE_PLANS'</span>, <br />&nbsp;FILENAME = N<span style="color: #FF0000;">'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\EXE_PLANS.mdf'</span>, <br />&nbsp;<span style="color: #0000FF;">SIZE</span> = 2048KB, <br />&nbsp;MAXSIZE = 1024000KB, <br />&nbsp;FILEGROWTH = 409600KB<span style="color: #808080;">&#41;</span><br />&nbsp;<span style="color: #FF00FF;">LOG</span> <span style="color: #0000FF;">ON</span> <br /><span style="color: #808080;">&#40;</span>NAME = N<span style="color: #FF0000;">'EXE_PLANS_log'</span>, <br />&nbsp;FILENAME = N<span style="color: #FF0000;">'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\EXE_PLANS_log.ldf'</span>, <br />&nbsp;<span style="color: #0000FF;">SIZE</span> = 1024KB, <br />&nbsp;MAXSIZE = 102400KB, <br />&nbsp;FILEGROWTH = 10240KB<span style="color: #808080;">&#41;</span><br />GO<br />&nbsp;<br /><span style="color: #0000FF;">USE</span> <span style="color: #808080;">&#91;</span>EXE_PLANS<span style="color: #808080;">&#93;</span><br />GO<br /><span style="color: #0000FF;">CREATE</span> <span style="color: #0000FF;">TABLE</span> ITEMS<br /><span style="color: #808080;">&#40;</span>ITEMCODE <span style="color: #0000FF;">INT</span>,<br />&nbsp;ITEMNAME <span style="color: #0000FF;">VARCHAR</span><span style="color: #808080;">&#40;</span><span style="color: #000;">50</span><span style="color: #808080;">&#41;</span>,<br />&nbsp;LASTMODIFY <span style="color: #0000FF;">DATETIME</span>,<br />&nbsp;CREATEDATE <span style="color: #0000FF;">DATE</span>,<br />&nbsp;CREATETIME <span style="color: #0000FF;">TIME</span><span style="color: #808080;">&#41;</span><br />GO<br />&nbsp;<br /><span style="color: #0000FF;">INSERT</span> <span style="color: #0000FF;">INTO</span> ITEMS<br /><span style="color: #0000FF;">SELECT</span> <br />&nbsp;Prods.<span style="color: #202020;">ProductID</span>,<br />&nbsp;Prods.<span style="color: #808080;">&#91;</span>Name<span style="color: #808080;">&#93;</span>,<br />&nbsp;<span style="color: #FF00FF;">GETDATE</span><span style="color: #808080;">&#40;</span><span style="color: #808080;">&#41;</span>,<br />&nbsp;<span style="color: #FF00FF;">GETDATE</span><span style="color: #808080;">&#40;</span><span style="color: #808080;">&#41;</span>,<br />&nbsp;<span style="color: #FF00FF;">GETDATE</span><span style="color: #808080;">&#40;</span><span style="color: #808080;">&#41;</span><br /><span style="color: #0000FF;">FROM</span> <br />AdventureWorks.<span style="color: #202020;">Production</span>.<span style="color: #202020;">Product</span> Prods<br /><br /></div><div id="cb96872" style="display: none; color: red;"></div></div></div>

<p><p>Now that we have our testing area, we can create some common indexes that may be found on a table like the items tables.</p>

<p>First a nonclustered index on the ITEMCODE</p>

<div class="codebox"><div class="codeheader">Code: <span>tsql</span></div><div class="codeholder"><div class="tsql" id="cb26789" style="display: block; color: rgb(0, 0, 0);"><span style="color: #0000FF;">CREATE</span> <span style="color: #0000FF;">UNIQUE</span> <span style="color: #0000FF;">NONCLUSTERED</span> <span style="color: #0000FF;">INDEX</span> IDX_ITEMID <span style="color: #0000FF;">ON</span> ITEMS<br /><span style="color: #808080;">&#40;</span>ITEMCODE<span style="color: #808080;">&#41;</span><br /><span style="color: #0000FF;">WITH</span> <span style="color: #808080;">&#40;</span><span style="color: #0000FF;">FILLFACTOR</span> = <span style="color: #000;">85</span><span style="color: #808080;">&#41;</span><br />GO<br /><br /></div><div id="cb95932" style="display: none; color: red;"></div></div></div>

<p>Next, a nonclustered index on CREATETIME, ITEMCODE and CREATEDATE</p>

<div class="codebox"><div class="codeheader">Code: <span>tsql</span></div><div class="codeholder"><div class="tsql" id="cb66985" style="display: block; color: rgb(0, 0, 0);"><span style="color: #0000FF;">CREATE</span> <span style="color: #0000FF;">NONCLUSTERED</span> <span style="color: #0000FF;">INDEX</span> IDX_PRODID_DATE_ASC <span style="color: #0000FF;">ON</span> ITEMS<br /><span style="color: #808080;">&#40;</span>CREATETIME,ITEMCODE,CREATEDATE<span style="color: #808080;">&#41;</span><br />INCLUDE <span style="color: #808080;">&#40;</span>ITEMNAME<span style="color: #808080;">&#41;</span><br /><span style="color: #0000FF;">WITH</span> <span style="color: #808080;">&#40;</span><span style="color: #0000FF;">FILLFACTOR</span> = <span style="color: #000;">80</span><span style="color: #808080;">&#41;</span><br />GO<br /><br /></div><div id="cb94413" style="display: none; color: red;"></div></div></div>
<p>Once these indexes are created we can run a basic query to extract ITEMNAME and CREATETIME with a WHERE clause only looking at a specific ITEMCODE value.  </p>

<div class="codebox"><div class="codeheader">Code: <span>tsql</span></div><div class="codeholder"><div class="tsql" id="cb7244" style="display: block; color: rgb(0, 0, 0);"><span style="color: #0000FF;">SELECT</span><br />&nbsp;ITEMS.<span style="color: #202020;">ITEMNAME</span>,<br />&nbsp;ITEMS.<span style="color: #202020;">CREATETIME</span><br /><span style="color: #0000FF;">FROM</span> ITEMS<br /><span style="color: #0000FF;">WHERE</span> ITEMCODE = <span style="color: #000;">1</span><br />GO<br /><br /></div><div id="cb98036" style="display: none; color: red;"></div></div></div><p></p>

<p>We should be fine as the nonclustered index, "IDX_ITEMID" should be used in an index seek given the WHERE clause on ITEMCODE.  However, when we run this query to check the estimated execution plan, we can see we have a lookup occurring.</p>

<div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/DataMgmt/rid_2.gif" alt="" title="" width="624" height="368" /></div>

<p>The lookup is caused by the fact that there is not a covering index to fulfill the entire needs of the query.  The WHERE clause and columns returned combined equate to, "covering".  In order to satisfy this query and remove the RID Lookup, we need to create a covering index or a clustered index on the ITEMCODE.   Creating a clustered index physically orders the data under the conditions of the index and in some cases (like this) that was not possible.  An effective solution in this case is a nonclustered index covering the entire query requirements.</p>

<blockquote><p><span class="MT_red">Note: Let's say that the table in question isn't a HEAP and there is an existing clustered index on a different key.  Since we can only have one clustered index per table, the resolution of ITEMCODE becoming a clustered index to resolve our RID Lookup is not possible.  A nonclustered index is then the only way to resolve (or remove) the RID Lookup.  </span></p></blockquote>

<p><p>To create a covering index we can do the following</p>

<div class="codebox"><div class="codeheader">Code: <span>tsql</span></div><div class="codeholder"><div class="tsql" id="cb66026" style="display: block; color: rgb(0, 0, 0);"><span style="color: #0000FF;">CREATE</span> <span style="color: #0000FF;">NONCLUSTERED</span> <span style="color: #0000FF;">INDEX</span> IDX_COVERING_ASC <span style="color: #0000FF;">ON</span> ITEMS<br /><span style="color: #808080;">&#40;</span>ITEMCODE,LASTMODIFY,ITEMNAME,CREATETIME<span style="color: #808080;">&#41;</span><br /><span style="color: #0000FF;">WITH</span> <span style="color: #808080;">&#40;</span><span style="color: #0000FF;">FILLFACTOR</span>=<span style="color: #000;">80</span><span style="color: #808080;">&#41;</span><br />GO<br /><br /></div><div id="cb95616" style="display: none; color: red;"></div></div></div><p></p>

<p>After looking at our execution plan, we should see only the index seek operation being performed<br />
<br />
<div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/DataMgmt/rid_5.gif" alt="" title="" width="628" height="229" /></div><br />
<br />
<p>Let's put things into perspective.  We all know an index seek is optimal (in most cases).  We do see our index seek in the execution plan prior to our resolution of a covering index but we have the handicap of the RID Lookup being performed in a nested loop with the index seek.  This will result in the cost of the index seek operation plus essentially the same effect of a table scan under a nested loop operation.  For each record we find in the index seek, we have to run out to the disk, find the remaining data we need in order to fulfill the needs of the query.  <br />
This is all reflected in a nested loop operation.</p>  <br />
<br />
<p>What is shown below is the Index Seek retrieving the data directly based on the index pointers and requiring a need to loop back to the data to fulfill all of the data needed by the request.  This causes the query to perform slowly and also increases the possibility for high CPU utilization and high IO.  <br />
<br />
<div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/DataMgmt/rid_4.gif" alt="" title="" /></div> </p><br />
<br />
<p>Basic troubleshooting steps of query performance like this should be a daily part of database tuning and monitoring.  Allowing changes to go directly into production database servers without the initiative of code reviews and heavy testing will allow these types of problems to happen.  The best resolution of all is to prevent these types of problems by not bypassing those normal transport objectives.</p><br />
<br />
<p><div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/DataMgmt/rid_grant.gif" alt="" title="" width="137" height="137" align="left" /></div><br /><br />For learning more on Execution Plans, I highly recommend purchasing, <a href="http://www.amazon.com/Server-Execution-Plans-Grant-Fritchey/dp/1906434026">SQL Server Execution Plans</a> by Grant Fritchey.  This book goes into each operation you will encounter in plans and some ways to resolve operations that are not optimal.  Grant (<a href="http://twitter.com/gfritchey">Twitter</a> | <a href="http://scarydba.wordpress.com/">Blog</a>) is also a widely known and respected expert on Execution Plans and database tuning.  Reading his blog and following him will greatly benefit your daily work as a DBA or Developer on SQL Server.</p><br />
<br /><br /><br /><br /></p><a href="http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/DataMgmt/DBAdmin/rid-lookup-sql-tuning"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/DataMgmt/DBAdmin/rid-lookup-sql-tuning&amp;source=LessThanDot" height="61" width="51" /></a><div class="item_footer"><p><small><a href="http://blogs.lessthandot.com/index.php/DataMgmt/DBAdmin/rid-lookup-sql-tuning">Original post</a> blogged on <a href="http://lessthandot.com/">LessThanDot</a>.</small></p></div>]]></content:encoded>
								<comments>http://blogs.lessthandot.com/index.php/DataMgmt/DBAdmin/rid-lookup-sql-tuning#comments</comments>
		</item>
				<item>
			<title>WPF and wordwrap/wordtrimming in a listbox</title>
			<link>http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/wpf-and-wordwrap-wordtrimming-in-a-listb</link>
			<pubDate>Fri, 16 Jul 2010 12:26:49 +0000</pubDate>			<dc:creator>chrissie1</dc:creator>
			<category domain="main">Microsoft Technologies</category>
<category domain="alt">VB.NET</category>
<category domain="alt">C#</category>			<guid isPermaLink="false">903@http://blogs.lessthandot.com/</guid>
						<description>&lt;h3&gt;by &lt;a href=&quot;http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;amp;author=7&quot;&gt; chrissie1 &lt;/a&gt;&lt;/h3&gt;&lt;p&gt;I have been doing most of my frontend in windowsforms but I thought it was time to switch to WPF after all it is already at version 4.0 so most of the little quirks should be gone by now. &lt;/p&gt;

&lt;p&gt;First thing I did was to convert my dashboard over to it. I can use all the same controllers and model so I only need to worry about the views.&lt;br /&gt;
On my dashboard there is a ListBox which shows the user some messages of the system (not that anybody really reads them, but it looks cool).&lt;/p&gt;

&lt;p&gt;The text for each item can be longer than the width of the ListBox. This is no problem since there is a horizontal scrollbar that can be seen. But I don't like that.&lt;/p&gt;

&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/DesktopDev/WPFListBox/WPFListBox1.png&quot; alt=&quot;&quot; title=&quot;&quot; width=&quot;219&quot; height=&quot;326&quot; /&gt;&lt;/div&gt;&lt;p&gt; &lt;/p&gt;

&lt;p&gt;And this is the XAML you use for this.&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;xml&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;xml&quot; id=&quot;cb73826&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;ListBox&lt;/span&gt; Name =&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;lstMessages&amp;quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb49600&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And I filled the ListBox via this method. Which is an event coming from the ViewModel. Witch needs to be made threadsafe.&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;vbnet&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;vbnet&quot; id=&quot;cb44450&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;Private&lt;/span&gt; Delegate &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt; MessagesCallBack&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;ByVal&lt;/span&gt; Messages &lt;span style=&quot;color: #0600FF;&quot;&gt;As&lt;/span&gt; System.&lt;span style=&quot;color: #000000;&quot;&gt;Collections&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;Generic&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;Queue&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;Of &lt;span style=&quot;color: #0600FF;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Private&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt; _Messages_MessageAdded&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;ByVal&lt;/span&gt; Messages &lt;span style=&quot;color: #0600FF;&quot;&gt;As&lt;/span&gt; System.&lt;span style=&quot;color: #000000;&quot;&gt;Collections&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;Generic&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;Queue&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;Of &lt;span style=&quot;color: #0600FF;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Handles&lt;/span&gt; _Messages.&lt;span style=&quot;color: #000000;&quot;&gt;MessageAdded&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If lstMessages.&lt;span style=&quot;color: #000000;&quot;&gt;Dispatcher&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;CheckAccess&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Then&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lstMessages.&lt;span style=&quot;color: #000000;&quot;&gt;ItemsSource&lt;/span&gt; = Messages.&lt;span style=&quot;color: #000000;&quot;&gt;Reverse&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;ToArray&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Else&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Dim&lt;/span&gt; d = &lt;span style=&quot;color: #0600FF;&quot;&gt;New&lt;/span&gt; MessagesCallBack&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;AddressOf _Messages_MessageAdded&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lstMessages.&lt;span style=&quot;color: #000000;&quot;&gt;Dispatcher&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;Invoke&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;d, &lt;span style=&quot;color: #0600FF;&quot;&gt;New&lt;/span&gt; Object&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt;Messages&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;End&lt;/span&gt; If&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb22479&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So I'm using the Itemsource for this.&lt;/p&gt;

&lt;p&gt;I would prefer some text trimming (the three dots) and a tooltip with the complete text. &lt;/p&gt;

&lt;p&gt;In Windowsforms this would just be difficult to do. In WPF this is very easy.&lt;/p&gt;

&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/DesktopDev/WPFListBox/WPFListBox2.png&quot; alt=&quot;&quot; title=&quot;&quot; width=&quot;280&quot; height=&quot;120&quot; /&gt;&lt;/div&gt;&lt;p&gt; &lt;/p&gt;

&lt;p&gt;You just need to add a Datatemplate like this.&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;xml&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;xml&quot; id=&quot;cb95956&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;DataTemplate&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;x:Key&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;itemTemplate&amp;quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;TextBlock&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;TextTrimming&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;CharacterEllipsis&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;Text&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;{Binding}&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;ToolTip&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;{Binding}&amp;quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/TextBlock&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/DataTemplate&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb38019&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And then change your ListBox a little.&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;xml&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;xml&quot; id=&quot;cb9299&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;ListBox&lt;/span&gt; Name =&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;lstMessages&amp;quot;&lt;/span&gt; ScrollViewer.&lt;span style=&quot;color: #000066;&quot;&gt;HorizontalScrollBarVisibility&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Disabled&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;ItemTemplate&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;{StaticResource itemTemplate}&amp;quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb68166&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And that is it. As you can see I removed the Horizontalscrollbar and added an ItemTemplate.&lt;/p&gt;

&lt;p&gt;Or you can make it wrap instead. Just a little change in the XAML.&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;xml&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;xml&quot; id=&quot;cb40619&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;DataTemplate&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;x:Key&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;itemTemplate&amp;quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;TextBlock&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;TextWrapping&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Wrap&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;Text&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;{Binding}&amp;quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/TextBlock&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/DataTemplate&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb41365&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And then it looks like this. I guess you could then do without the tooltip so I removed that.&lt;/p&gt;

&lt;div class=&quot;image_block&quot;&gt;&lt;img src=&quot;http://blogs.lessthandot.com/media/blogs/DesktopDev/WPFListBox/WPFListBox3.png&quot; alt=&quot;&quot; title=&quot;&quot; width=&quot;217&quot; height=&quot;147&quot; /&gt;&lt;/div&gt;&lt;p&gt; &lt;/p&gt;

&lt;p&gt;The hardest thing to find on the internets was the Text=&quot;{Binding}&quot;. I actually didn't find it on the internets I just got lucky.&lt;/p&gt;&lt;a href=&quot;http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/wpf-and-wordwrap-wordtrimming-in-a-listb&quot;&gt;&lt;img src=&quot;http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/wpf-and-wordwrap-wordtrimming-in-a-listb&amp;source=LessThanDot&quot; height=&quot;61&quot; width=&quot;51&quot; /&gt;&lt;/a&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/wpf-and-wordwrap-wordtrimming-in-a-listb&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://lessthandot.com/&quot;&gt;LessThanDot&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[				<h3>by <a href="http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;author=7"> chrissie1 </a></h3>
				<p>I have been doing most of my frontend in windowsforms but I thought it was time to switch to WPF after all it is already at version 4.0 so most of the little quirks should be gone by now. </p>

<p>First thing I did was to convert my dashboard over to it. I can use all the same controllers and model so I only need to worry about the views.<br />
On my dashboard there is a ListBox which shows the user some messages of the system (not that anybody really reads them, but it looks cool).</p>

<p>The text for each item can be longer than the width of the ListBox. This is no problem since there is a horizontal scrollbar that can be seen. But I don't like that.</p>

<div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/DesktopDev/WPFListBox/WPFListBox1.png" alt="" title="" width="219" height="326" /></div><p> </p>

<p>And this is the XAML you use for this.</p>

<div class="codebox"><div class="codeheader">Code: <span>xml</span></div><div class="codeholder"><div class="xml" id="cb19806" style="display: block; color: rgb(0, 0, 0);"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;ListBox</span> Name =<span style="color: #ff0000;">&quot;lstMessages&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span><br /><br /></div><div id="cb80941" style="display: none; color: red;"></div></div></div>

<p>And I filled the ListBox via this method. Which is an event coming from the ViewModel. Witch needs to be made threadsafe.</p>

<div class="codebox"><div class="codeheader">Code: <span>vbnet</span></div><div class="codeholder"><div class="vbnet" id="cb46849" style="display: block; color: rgb(0, 0, 0);"><span style="color: #0600FF;">Private</span> Delegate <span style="color: #0600FF;">Sub</span> MessagesCallBack<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">ByVal</span> Messages <span style="color: #0600FF;">As</span> System.<span style="color: #000000;">Collections</span>.<span style="color: #000000;">Generic</span>.<span style="color: #000000;">Queue</span><span style="color: #000000;">&#40;</span>Of <span style="color: #0600FF;">String</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Private</span> <span style="color: #0600FF;">Sub</span> _Messages_MessageAdded<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">ByVal</span> Messages <span style="color: #0600FF;">As</span> System.<span style="color: #000000;">Collections</span>.<span style="color: #000000;">Generic</span>.<span style="color: #000000;">Queue</span><span style="color: #000000;">&#40;</span>Of <span style="color: #0600FF;">String</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #0600FF;">Handles</span> _Messages.<span style="color: #000000;">MessageAdded</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If lstMessages.<span style="color: #000000;">Dispatcher</span>.<span style="color: #000000;">CheckAccess</span> <span style="color: #0600FF;">Then</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lstMessages.<span style="color: #000000;">ItemsSource</span> = Messages.<span style="color: #000000;">Reverse</span>.<span style="color: #000000;">ToArray</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> d = <span style="color: #0600FF;">New</span> MessagesCallBack<span style="color: #000000;">&#40;</span>AddressOf _Messages_MessageAdded<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lstMessages.<span style="color: #000000;">Dispatcher</span>.<span style="color: #000000;">Invoke</span><span style="color: #000000;">&#40;</span>d, <span style="color: #0600FF;">New</span> Object<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>Messages<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> If<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span><br /><br /></div><div id="cb68174" style="display: none; color: red;"></div></div></div>

<p>So I'm using the Itemsource for this.</p>

<p>I would prefer some text trimming (the three dots) and a tooltip with the complete text. </p>

<p>In Windowsforms this would just be difficult to do. In WPF this is very easy.</p>

<div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/DesktopDev/WPFListBox/WPFListBox2.png" alt="" title="" width="280" height="120" /></div><p> </p>

<p>You just need to add a Datatemplate like this.</p>

<div class="codebox"><div class="codeheader">Code: <span>xml</span></div><div class="codeholder"><div class="xml" id="cb89834" style="display: block; color: rgb(0, 0, 0);"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;DataTemplate</span> <span style="color: #000066;">x:Key</span>=<span style="color: #ff0000;">&quot;itemTemplate&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span><br />&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;TextBlock</span> <span style="color: #000066;">TextTrimming</span>=<span style="color: #ff0000;">&quot;CharacterEllipsis&quot;</span> <span style="color: #000066;">Text</span>=<span style="color: #ff0000;">&quot;{Binding}&quot;</span> <span style="color: #000066;">ToolTip</span>=<span style="color: #ff0000;">&quot;{Binding}&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/TextBlock<span style="font-weight: bold; color: black;">&gt;</span></span></span><br /><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/DataTemplate<span style="font-weight: bold; color: black;">&gt;</span></span></span><br /><br /></div><div id="cb73170" style="display: none; color: red;"></div></div></div>

<p>And then change your ListBox a little.</p>

<div class="codebox"><div class="codeheader">Code: <span>xml</span></div><div class="codeholder"><div class="xml" id="cb83052" style="display: block; color: rgb(0, 0, 0);"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;ListBox</span> Name =<span style="color: #ff0000;">&quot;lstMessages&quot;</span> ScrollViewer.<span style="color: #000066;">HorizontalScrollBarVisibility</span>=<span style="color: #ff0000;">&quot;Disabled&quot;</span> <span style="color: #000066;">ItemTemplate</span>=<span style="color: #ff0000;">&quot;{StaticResource itemTemplate}&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span><br /><br /></div><div id="cb80013" style="display: none; color: red;"></div></div></div>

<p>And that is it. As you can see I removed the Horizontalscrollbar and added an ItemTemplate.</p>

<p>Or you can make it wrap instead. Just a little change in the XAML.</p>

<div class="codebox"><div class="codeheader">Code: <span>xml</span></div><div class="codeholder"><div class="xml" id="cb10745" style="display: block; color: rgb(0, 0, 0);"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;DataTemplate</span> <span style="color: #000066;">x:Key</span>=<span style="color: #ff0000;">&quot;itemTemplate&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span><br />&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;TextBlock</span> <span style="color: #000066;">TextWrapping</span>=<span style="color: #ff0000;">&quot;Wrap&quot;</span> <span style="color: #000066;">Text</span>=<span style="color: #ff0000;">&quot;{Binding}&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/TextBlock<span style="font-weight: bold; color: black;">&gt;</span></span></span><br /><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/DataTemplate<span style="font-weight: bold; color: black;">&gt;</span></span></span><br /><br /></div><div id="cb229" style="display: none; color: red;"></div></div></div>

<p>And then it looks like this. I guess you could then do without the tooltip so I removed that.</p>

<div class="image_block"><img src="http://blogs.lessthandot.com/media/blogs/DesktopDev/WPFListBox/WPFListBox3.png" alt="" title="" width="217" height="147" /></div><p> </p>

<p>The hardest thing to find on the internets was the Text="{Binding}". I actually didn't find it on the internets I just got lucky.</p><a href="http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/wpf-and-wordwrap-wordtrimming-in-a-listb"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/wpf-and-wordwrap-wordtrimming-in-a-listb&amp;source=LessThanDot" height="61" width="51" /></a><div class="item_footer"><p><small><a href="http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/wpf-and-wordwrap-wordtrimming-in-a-listb">Original post</a> blogged on <a href="http://lessthandot.com/">LessThanDot</a>.</small></p></div>]]></content:encoded>
								<comments>http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/wpf-and-wordwrap-wordtrimming-in-a-listb#comments</comments>
		</item>
				<item>
			<title>WPF and Silverlight difference</title>
			<link>http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/wpf-and-silverlight-difference</link>
			<pubDate>Thu, 15 Jul 2010 13:43:07 +0000</pubDate>			<dc:creator>chrissie1</dc:creator>
			<category domain="main">Microsoft Technologies</category>
<category domain="alt">VB.NET</category>
<category domain="alt">C#</category>			<guid isPermaLink="false">902@http://blogs.lessthandot.com/</guid>
						<description>&lt;h3&gt;by &lt;a href=&quot;http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;amp;author=7&quot;&gt; chrissie1 &lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Today I was in the process of making my own copy-paste Analog clock. I went aruond the internet and found &lt;a href=&quot;http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx&quot;&gt;this pretty thing&lt;/a&gt;. Of course I could have used that code and gone on with life. But that was not the point of the exercise. I wanted to learn something of this. &lt;/p&gt;

&lt;p&gt;I liked the way he did the animations, no more need for a timer to update the angles, all is done in XAML. &lt;/p&gt;

&lt;p&gt;So his project is Silverlight. And he has this to aniamte the hands of the clock.&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;xml&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;xml&quot; id=&quot;cb27397&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;Canvas&lt;/span&gt;.Resources&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;Storyboard&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;x:Name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;SecondsHandStoryboard&amp;quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;DoubleAnimation&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;From&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;0&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;To&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;360&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;Duration&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;00:01:00&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;RepeatBehavior&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Forever&amp;quot;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Storyboard.&lt;span style=&quot;color: #000066;&quot;&gt;TargetProperty&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;(Polygon.RenderTransform).(RotateTransform.Angle)&amp;quot;&lt;/span&gt; Storyboard.&lt;span style=&quot;color: #000066;&quot;&gt;TargetName&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;SecondHand&amp;quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/Storyboard&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/Canvas&lt;/span&gt;.Resources&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb35295&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and this in his codebehind&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;csharp&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;csharp&quot; id=&quot;cb61091&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;void&lt;/span&gt; SecondsHandCanvas_Loaded&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;object&lt;/span&gt; sender, RoutedEventArgs e &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;SecondsHandStoryboard&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;Begin&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;SecondsHandStoryboard&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;Seek&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt; DateTime.&lt;span style=&quot;color: #0000FF;&quot;&gt;Now&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;TimeOfDay&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb50693&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;vbnet&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;vbnet&quot; id=&quot;cb68353&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;Private&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt; SecondsHandCanvas_Loaded&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: #0600FF;&quot;&gt;As&lt;/span&gt; object, &lt;span style=&quot;color: #0600FF;&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: #0600FF;&quot;&gt;As&lt;/span&gt; RoutedEventArgs&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Me&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;SecondsHandStoryboard&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;Begin&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Me&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;SecondsHandStoryboard&lt;/span&gt;.&lt;span style=&quot;color: #0600FF;&quot;&gt;Seek&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt; DateTime.&lt;span style=&quot;color: #000000;&quot;&gt;Now&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;TimeOfDay&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb7446&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Cool I can just copy paste that and get on with it.&lt;/p&gt;

&lt;p&gt;But Silverlight and WPF aren't exactly the same they just look the same.&lt;/p&gt;

&lt;p&gt;In WPF A name is no good for a resource apparently. It needs a Key.&lt;br /&gt;
So the above XAML becomes this instead of the above Silverlight code.&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;xml&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;xml&quot; id=&quot;cb55048&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;Canvas&lt;/span&gt;.Resources&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;Storyboard&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;x:Key&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;HourHandStoryboard&amp;quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;DoubleAnimation&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;From&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;0&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;To&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;360&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;Duration&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;12:00:00&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;RepeatBehavior&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Forever&amp;quot;&lt;/span&gt; Storyboard.&lt;span style=&quot;color: #000066;&quot;&gt;TargetProperty&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;(Polygon.RenderTransform).(RotateTransform.Angle)&amp;quot;&lt;/span&gt; Storyboard.&lt;span style=&quot;color: #000066;&quot;&gt;TargetName&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;HourHand&amp;quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/Storyboard&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/Canvas&lt;/span&gt;.Resources&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb42246&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And then you find out that the code you have doesn't work either. YOu need to change it to this.&lt;/p&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;vbnet&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;vbnet&quot; id=&quot;cb26575&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;Private&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt; HoursHandCanvas_Loaded&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: #0600FF;&quot;&gt;As&lt;/span&gt; System.&lt;span style=&quot;color: #000000;&quot;&gt;Object&lt;/span&gt;, &lt;span style=&quot;color: #0600FF;&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: #0600FF;&quot;&gt;As&lt;/span&gt; System.&lt;span style=&quot;color: #000000;&quot;&gt;Windows&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;RoutedEventArgs&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;Dim&lt;/span&gt; s = CType&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;Me&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;HoursHandCanvas&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;Resources&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;&amp;quot;SecondHandStoryboard&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;, Storyboard&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; s.&lt;span style=&quot;color: #000000;&quot;&gt;Begin&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; s.&lt;span style=&quot;color: #0600FF;&quot;&gt;Seek&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;DateTime.&lt;span style=&quot;color: #000000;&quot;&gt;Now&lt;/span&gt;.&lt;span style=&quot;color: #000000;&quot;&gt;TimeOfDay&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF;&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb74825&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;codebox&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code: &lt;span&gt;csharp&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;codeholder&quot;&gt;&lt;div class=&quot;csharp&quot; id=&quot;cb19493&quot; style=&quot;display: block; color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #0600FF;&quot;&gt;void&lt;/span&gt; HoursHandCanvas_Loaded&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;System&lt;/span&gt;.&lt;span style=&quot;color: #FF0000;&quot;&gt;Object&lt;/span&gt;, sender,&lt;span style=&quot;color: #000000;&quot;&gt;System&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;Windows&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;RoutedEventArgs&lt;/span&gt; e&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; var s = &lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;StoryBoard&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #0600FF;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;HoursHandCanvas&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;Resources&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;&amp;quot;SecondHandStoryboard&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; s.&lt;span style=&quot;color: #0000FF;&quot;&gt;Begin&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;nbsp; s.&lt;span style=&quot;color: #0000FF;&quot;&gt;Seek&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#40;&lt;/span&gt;DateTime.&lt;span style=&quot;color: #0000FF;&quot;&gt;Now&lt;/span&gt;.&lt;span style=&quot;color: #0000FF;&quot;&gt;TimeOfDay&lt;/span&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div id=&quot;cb80649&quot; style=&quot;display: none; color: red;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And BTW doing s.Begin(Me, True) does not work whatever MSDN say.&lt;/p&gt;&lt;a href=&quot;http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/wpf-and-silverlight-difference&quot;&gt;&lt;img src=&quot;http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/wpf-and-silverlight-difference&amp;source=LessThanDot&quot; height=&quot;61&quot; width=&quot;51&quot; /&gt;&lt;/a&gt;&lt;div class=&quot;item_footer&quot;&gt;&lt;p&gt;&lt;small&gt;&lt;a href=&quot;http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/wpf-and-silverlight-difference&quot;&gt;Original post&lt;/a&gt; blogged on &lt;a href=&quot;http://lessthandot.com/&quot;&gt;LessThanDot&lt;/a&gt;.&lt;/small&gt;&lt;/p&gt;&lt;/div&gt;</description>
			<content:encoded><![CDATA[				<h3>by <a href="http://blogs.lessthandot.com/index.php/All/?disp=authdir&amp;author=7"> chrissie1 </a></h3>
				<p>Today I was in the process of making my own copy-paste Analog clock. I went aruond the internet and found <a href="http://www.silverlightshow.net/items/Developing-Silverlight-AnalogClock-part-2-Enhancing-the-view.aspx">this pretty thing</a>. Of course I could have used that code and gone on with life. But that was not the point of the exercise. I wanted to learn something of this. </p>

<p>I liked the way he did the animations, no more need for a timer to update the angles, all is done in XAML. </p>

<p>So his project is Silverlight. And he has this to aniamte the hands of the clock.</p>

<div class="codebox"><div class="codeheader">Code: <span>xml</span></div><div class="codeholder"><div class="xml" id="cb5002" style="display: block; color: rgb(0, 0, 0);"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Canvas</span>.Resources<span style="font-weight: bold; color: black;">&gt;</span></span><br />&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Storyboard</span> <span style="color: #000066;">x:Name</span>=<span style="color: #ff0000;">&quot;SecondsHandStoryboard&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span><br />&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;DoubleAnimation</span> <span style="color: #000066;">From</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">To</span>=<span style="color: #ff0000;">&quot;360&quot;</span> <span style="color: #000066;">Duration</span>=<span style="color: #ff0000;">&quot;00:01:00&quot;</span> <span style="color: #000066;">RepeatBehavior</span>=<span style="color: #ff0000;">&quot;Forever&quot;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Storyboard.<span style="color: #000066;">TargetProperty</span>=<span style="color: #ff0000;">&quot;(Polygon.RenderTransform).(RotateTransform.Angle)&quot;</span> Storyboard.<span style="color: #000066;">TargetName</span>=<span style="color: #ff0000;">&quot;SecondHand&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span><br />&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Storyboard<span style="font-weight: bold; color: black;">&gt;</span></span></span><br /><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Canvas</span>.Resources<span style="font-weight: bold; color: black;">&gt;</span></span><br /><br /></div><div id="cb11454" style="display: none; color: red;"></div></div></div>

<p>and this in his codebehind</p>

<div class="codebox"><div class="codeheader">Code: <span>csharp</span></div><div class="codeholder"><div class="csharp" id="cb64055" style="display: block; color: rgb(0, 0, 0);"><span style="color: #0600FF;">private</span> <span style="color: #0600FF;">void</span> SecondsHandCanvas_Loaded<span style="color: #000000;">&#40;</span> <span style="color: #FF0000;">object</span> sender, RoutedEventArgs e <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">SecondsHandStoryboard</span>.<span style="color: #0000FF;">Begin</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">SecondsHandStoryboard</span>.<span style="color: #0000FF;">Seek</span><span style="color: #000000;">&#40;</span> DateTime.<span style="color: #0000FF;">Now</span>.<span style="color: #0000FF;">TimeOfDay</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br /><br /></div><div id="cb83032" style="display: none; color: red;"></div></div></div>

<div class="codebox"><div class="codeheader">Code: <span>vbnet</span></div><div class="codeholder"><div class="vbnet" id="cb94118" style="display: block; color: rgb(0, 0, 0);"><span style="color: #0600FF;">Private</span> <span style="color: #0600FF;">Sub</span> SecondsHandCanvas_Loaded<span style="color: #000000;">&#40;</span> <span style="color: #0600FF;">ByVal</span> sender <span style="color: #0600FF;">As</span> object, <span style="color: #0600FF;">ByVal</span> e <span style="color: #0600FF;">As</span> RoutedEventArgs<span style="color: #000000;">&#41;</span><br />&nbsp; <span style="color: #0600FF;">Me</span>.<span style="color: #000000;">SecondsHandStoryboard</span>.<span style="color: #000000;">Begin</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; <span style="color: #0600FF;">Me</span>.<span style="color: #000000;">SecondsHandStoryboard</span>.<span style="color: #0600FF;">Seek</span><span style="color: #000000;">&#40;</span> DateTime.<span style="color: #000000;">Now</span>.<span style="color: #000000;">TimeOfDay</span> <span style="color: #000000;">&#41;</span>;<br /><span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span><br /><br /></div><div id="cb75789" style="display: none; color: red;"></div></div></div>

<p>Cool I can just copy paste that and get on with it.</p>

<p>But Silverlight and WPF aren't exactly the same they just look the same.</p>

<p>In WPF A name is no good for a resource apparently. It needs a Key.<br />
So the above XAML becomes this instead of the above Silverlight code.</p>

<div class="codebox"><div class="codeheader">Code: <span>xml</span></div><div class="codeholder"><div class="xml" id="cb76875" style="display: block; color: rgb(0, 0, 0);"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Canvas</span>.Resources<span style="font-weight: bold; color: black;">&gt;</span></span><br />&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Storyboard</span> <span style="color: #000066;">x:Key</span>=<span style="color: #ff0000;">&quot;HourHandStoryboard&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span><br />&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;DoubleAnimation</span> <span style="color: #000066;">From</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">To</span>=<span style="color: #ff0000;">&quot;360&quot;</span> <span style="color: #000066;">Duration</span>=<span style="color: #ff0000;">&quot;12:00:00&quot;</span> <span style="color: #000066;">RepeatBehavior</span>=<span style="color: #ff0000;">&quot;Forever&quot;</span> Storyboard.<span style="color: #000066;">TargetProperty</span>=<span style="color: #ff0000;">&quot;(Polygon.RenderTransform).(RotateTransform.Angle)&quot;</span> Storyboard.<span style="color: #000066;">TargetName</span>=<span style="color: #ff0000;">&quot;HourHand&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span><br />&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Storyboard<span style="font-weight: bold; color: black;">&gt;</span></span></span><br /><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Canvas</span>.Resources<span style="font-weight: bold; color: black;">&gt;</span></span><br /><br /></div><div id="cb84432" style="display: none; color: red;"></div></div></div>

<p>And then you find out that the code you have doesn't work either. YOu need to change it to this.</p>

<div class="codebox"><div class="codeheader">Code: <span>vbnet</span></div><div class="codeholder"><div class="vbnet" id="cb91533" style="display: block; color: rgb(0, 0, 0);"><span style="color: #0600FF;">Private</span> <span style="color: #0600FF;">Sub</span> HoursHandCanvas_Loaded<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">ByVal</span> sender <span style="color: #0600FF;">As</span> System.<span style="color: #000000;">Object</span>, <span style="color: #0600FF;">ByVal</span> e <span style="color: #0600FF;">As</span> System.<span style="color: #000000;">Windows</span>.<span style="color: #000000;">RoutedEventArgs</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> s = CType<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">Me</span>.<span style="color: #000000;">HoursHandCanvas</span>.<span style="color: #000000;">Resources</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">&quot;SecondHandStoryboard&quot;</span><span style="color: #000000;">&#41;</span>, Storyboard<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s.<span style="color: #000000;">Begin</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s.<span style="color: #0600FF;">Seek</span><span style="color: #000000;">&#40;</span>DateTime.<span style="color: #000000;">Now</span>.<span style="color: #000000;">TimeOfDay</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span><br /><br /></div><div id="cb64883" style="display: none; color: red;"></div></div></div>

<div class="codebox"><div class="codeheader">Code: <span>csharp</span></div><div class="codeholder"><div class="csharp" id="cb18878" style="display: block; color: rgb(0, 0, 0);"><span style="color: #0600FF;">private</span> <span style="color: #0600FF;">void</span> HoursHandCanvas_Loaded<span style="color: #000000;">&#40;</span><span style="color: #000000;">System</span>.<span style="color: #FF0000;">Object</span>, sender,<span style="color: #000000;">System</span>.<span style="color: #0000FF;">Windows</span>.<span style="color: #0000FF;">RoutedEventArgs</span> e<span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; var s = <span style="color: #000000;">&#40;</span>StoryBoard<span style="color: #000000;">&#41;</span><span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">HoursHandCanvas</span>.<span style="color: #0000FF;">Resources</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;SecondHandStoryboard&quot;</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; s.<span style="color: #0000FF;">Begin</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; s.<span style="color: #0000FF;">Seek</span><span style="color: #000000;">&#40;</span>DateTime.<span style="color: #0000FF;">Now</span>.<span style="color: #0000FF;">TimeOfDay</span><span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /></div><div id="cb9012" style="display: none; color: red;"></div></div></div>

<p>And BTW doing s.Begin(Me, True) does not work whatever MSDN say.</p><a href="http://api.tweetmeme.com/share?url=http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/wpf-and-silverlight-difference"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/wpf-and-silverlight-difference&amp;source=LessThanDot" height="61" width="51" /></a><div class="item_footer"><p><small><a href="http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/wpf-and-silverlight-difference">Original post</a> blogged on <a href="http://lessthandot.com/">LessThanDot</a>.</small></p></div>]]></content:encoded>
								<comments>http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/wpf-and-silverlight-difference#comments</comments>
		</item>
			</channel>
</rss>
