<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4702502957422480559</id><updated>2011-11-28T08:17:35.804+08:00</updated><category term='Microsoft Popfly'/><category term='.Net 2.0'/><category term='Visual Studio 2008'/><category term='Mashup'/><category term='C# .Net'/><category term='IIS 7'/><category term='VB .Net'/><category term='SSAS'/><category term='AJAX .Net'/><category term='ClientScriptManager'/><category term='Visual Studio 2005'/><category term='SQL Server 2005'/><category term='Repository Factory'/><category term='Window Vista'/><category term='MembershipProvider'/><category term='ReportViewer'/><category term='Silverlight 2'/><category term='Web Client Software Factory v1.1'/><title type='text'>Chris Par's - Microsoft .Net</title><subtitle type='html'>Chris Par's Blog and it is all about Microsoft .Net, ASP .Net, SQL Server Analysis Service, SQL Server Intergration Services, SQL Server Reporting Service, Pattern and Practises, Web Client Software Factory, and alot more.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>35</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-2506558299795986368</id><published>2008-12-20T16:15:00.001+08:00</published><updated>2008-12-20T16:15:59.492+08:00</updated><title type='text'>Sorting with IComparable and Comparison Delegate on List&lt;T&gt;</title><content type='html'>&lt;p&gt;One of the popular generic collection types in .Net 2.0 is List&amp;lt;T&amp;gt;, which we use to store a list of T items. For example, List&amp;lt;Country&amp;gt; stores a list of countries that defined by Country class. It works perfectly to bind the collection to a datasource to be displayed on, for instance drop down or grid view. But you may want the list to be sorted before it is bound to the datasource. Yes, List collection support a method called List&amp;lt;T&amp;gt;.sort() but in order to use sort() method, T must inherit IComparable interface.&lt;/p&gt;  &lt;p&gt;To read more about this, visit &lt;a title="MSDN: IComparable" href="http://msdn.microsoft.com/en-us/library/system.icomparable(VS.71).aspx" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;So let's take Country as the example. A typical Business Entity will look like:-&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Country&lt;br /&gt;    {&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; Country()&lt;br /&gt;        {&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; Country(System.String countryName, System.Int32 id)&lt;br /&gt;        {&lt;br /&gt;            &lt;span class="kwrd"&gt;this&lt;/span&gt;.countryNameField = countryName;&lt;br /&gt;            &lt;span class="kwrd"&gt;this&lt;/span&gt;.idField = id;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;private&lt;/span&gt; System.String countryNameField;&lt;br /&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; System.String CountryName&lt;br /&gt;        {&lt;br /&gt;            get { &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;this&lt;/span&gt;.countryNameField; }&lt;br /&gt;            set { &lt;span class="kwrd"&gt;this&lt;/span&gt;.countryNameField = &lt;span class="kwrd"&gt;value&lt;/span&gt;; }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;private&lt;/span&gt; System.Int32 idField;&lt;br /&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; System.Int32 Id&lt;br /&gt;        {&lt;br /&gt;            get { &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;this&lt;/span&gt;.idField; }&lt;br /&gt;            set { &lt;span class="kwrd"&gt;this&lt;/span&gt;.idField = &lt;span class="kwrd"&gt;value&lt;/span&gt;; }&lt;br /&gt;        }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;Next step is to inherit IComparable &lt;a title="MSDN: Interface" href="http://msdn.microsoft.com/en-us/library/87d83y5b.aspx" target="_blank"&gt;interface&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Country: IComparable&amp;lt;Country&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Once you have inherit the Interface, you are required to implement the definitions. In C#, you can right click on the Interface, and select Implement Interface &amp;gt; Implement Interface. Then the required method will be automatically added to your class. It will look similar to this:-&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;span class="preproc"&gt;#region&lt;/span&gt; IComparable&amp;lt;Country&amp;gt; Members&lt;br /&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; CompareTo(Country other)&lt;br /&gt;        {&lt;br /&gt;            &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; Exception(&lt;span class="str"&gt;&amp;quot;The method or operation is not implemented.&amp;quot;&lt;/span&gt;);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;&lt;span class="preproc"&gt;#endregion&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Alright, you are almost done with a simple sorting. Now you need to implement the CompareTo method like this:-&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;span class="preproc"&gt;#region&lt;/span&gt; IComparable&amp;lt;Country&amp;gt; Members&lt;br /&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; CompareTo(Country other)&lt;br /&gt;        {&lt;br /&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; CountryName.CompareTo(other.CountryName);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;&lt;span class="preproc"&gt;#endregion&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;To test it, simply fill the List&amp;lt;Country&amp;gt; with data and call List&amp;lt;Country&amp;gt;.sort() method. It will automatically sort the list. Now is this what we need? If yes, move on to others. If no, what is the problem? Come to think of it, we may have different comparison in different scenario. For example, we may want to sort by ID in a GridView, and we may want to sort by Name (ASC or DESC) in a drop down box. So we want a more dynamic implementation. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Here, we need to use &lt;a href="http://msdn.microsoft.com/en-us/library/tfakywbh.aspx" target="_blank"&gt;Generic Comparison delegate&lt;/a&gt; to provide different comparison methods. We may want to sort by ID or sort by Name in Descending order. Alright, you may simple need to write this:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;span class="preproc"&gt;#region&lt;/span&gt; Comparison Function&lt;br /&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; Comparison&amp;lt;Country&amp;gt; SortById = &lt;span class="kwrd"&gt;delegate&lt;/span&gt;(Country c1, Country c2)&lt;br /&gt;        {&lt;br /&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; c1.Id.CompareTo(c2.Id);&lt;br /&gt;        };&lt;br /&gt;        &lt;br /&gt;        &lt;span class="rem"&gt;// Sort by Name in DESC order&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; Comparison&amp;lt;Country&amp;gt; SortByName_DESC = &lt;span class="kwrd"&gt;delegate&lt;/span&gt;(Country c1, Country c2)&lt;br /&gt;        {&lt;br /&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; c2.CountryName.CompareTo(c1.CountryName);&lt;br /&gt;        };&lt;br /&gt;&lt;br /&gt;&lt;span class="preproc"&gt;#endregion&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;So with Comparison delegates, you can come out with different kind of comparison to help you sort the list in your own way. The methods are being called in this way:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;List&amp;lt;Country&amp;gt; list = &lt;span class="kwrd"&gt;new&lt;/span&gt; List&amp;lt;Country&amp;gt;();&lt;br /&gt;&lt;br /&gt;list = GetCountries();&lt;br /&gt;&lt;br /&gt;&lt;span class="rem"&gt;// Default Sorting&lt;/span&gt;&lt;br /&gt;list.sort();&lt;br /&gt;&lt;br /&gt;&lt;span class="rem"&gt;//Sort By ID&lt;/span&gt;&lt;br /&gt;list.sort(Country.SortById);&lt;br /&gt;&lt;br /&gt;&lt;span class="rem"&gt;//Sort By Name DESC&lt;/span&gt;&lt;br /&gt;list.sort(Country.SortByName_DESC);&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Done! If the above example does not help to solve your problem, you may want to consider creating a custom comparer class by inheriting from &lt;a href="http://msdn.microsoft.com/en-us/library/system.collections.icomparer.aspx" target="_blank"&gt;IComparer&lt;/a&gt; interface.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Cheers.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-2506558299795986368?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/2506558299795986368/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=2506558299795986368' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/2506558299795986368'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/2506558299795986368'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/12/sorting-with-icomparable-and-comparison.html' title='Sorting with IComparable and Comparison Delegate on List&amp;lt;T&amp;gt;'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-3269580794471792414</id><published>2008-12-01T14:59:00.002+08:00</published><updated>2008-12-01T15:02:31.761+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AJAX .Net'/><category scheme='http://www.blogger.com/atom/ns#' term='.Net 2.0'/><title type='text'>'Sys' is Undefined. Javascript error when you use AJAX extension</title><content type='html'>&lt;p&gt;You probably will notice a scripting error when using ASP.Net AJAX Extension in your web pages. &lt;/p&gt;  &lt;p&gt;Error: 'Sys' is undefined.&lt;/p&gt;  &lt;p&gt;It is due to the ajax extension is not properly registered and configured in your web.config.&lt;/p&gt;  &lt;p&gt;Solution: &lt;/p&gt;  &lt;p&gt;There are a few things that you need to have in your web config.&lt;/p&gt;  &lt;p&gt;1.) Make sure you have add below line to your assembly under &amp;lt;compilation&amp;gt;&amp;lt;assemblies&amp;gt;&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;add&lt;/span&gt; &lt;span class="attr"&gt;assembly&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt; font-size: small;&lt;br /&gt; color: black;&lt;br /&gt; font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt; background-color: #ffffff;&lt;br /&gt; /*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt; background-color: #f4f4f4;&lt;br /&gt; width: 100%;&lt;br /&gt; margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;2.) Add following lines under &amp;lt;system.web&amp;gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;httpHandlers&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;          &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;add&lt;/span&gt; &lt;span class="attr"&gt;verb&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;*&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;path&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;*.asmx&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;validate&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;false&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;          &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;add&lt;/span&gt; &lt;span class="attr"&gt;verb&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;GET,HEAD&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;path&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;ScriptResource.axd&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;validate&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;false&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;httpHandlers&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt; font-size: small;&lt;br /&gt; color: black;&lt;br /&gt; font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt; background-color: #ffffff;&lt;br /&gt; /*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt; background-color: #f4f4f4;&lt;br /&gt; width: 100%;&lt;br /&gt; margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;3.) Add following line under &amp;lt;system.web&amp;gt;&amp;lt;httpModules&amp;gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;add&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;ScriptModule&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt; font-size: small;&lt;br /&gt; color: black;&lt;br /&gt; font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt; background-color: #ffffff;&lt;br /&gt; /*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt; background-color: #f4f4f4;&lt;br /&gt; width: 100%;&lt;br /&gt; margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Cheers. This has solve my problem. I hope it does the same to you.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Some updates from Scott.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a title="http://weblogs.asp.net/scottgu/archive/2006/10/29/tip_2f00_trick_3a00_-handling-errors-with-the-updatepanel-control-using-asp.net-ajax.aspx" href="http://weblogs.asp.net/scottgu/archive/2006/10/29/tip_2f00_trick_3a00_-handling-errors-with-the-updatepanel-control-using-asp.net-ajax.aspx"&gt;http://weblogs.asp.net/scottgu/archive/2006/10/29/tip_2f00_trick_3a00_-handling-errors-with-the-updatepanel-control-using-asp.net-ajax.aspx&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-3269580794471792414?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/3269580794471792414/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=3269580794471792414' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/3269580794471792414'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/3269580794471792414'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/12/is-undefined-javascript-error-when-you.html' title='&amp;#39;Sys&amp;#39; is Undefined. Javascript error when you use AJAX extension'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-7342056990209958179</id><published>2008-10-14T13:08:00.002+08:00</published><updated>2008-10-14T13:13:58.363+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MembershipProvider'/><category scheme='http://www.blogger.com/atom/ns#' term='.Net 2.0'/><title type='text'>Store a type String value into type Guid</title><content type='html'>&lt;p&gt;Sometimes, it is a good practice to use uniqueidentifier data type as your primary key in your database so that it eases your job when you are trying to merge your data from multiple data sources/locations.&lt;/p&gt;  &lt;p&gt;however, the value is displayed as string in your application and when you want retrieve a data using the uniqueidentifier/Guid, the application will throw an exception because it does not allow you to input string for the type of Guid. Most of the function will look like:&lt;/p&gt;  &lt;p&gt;&lt;em&gt;public MembershipUser GetUserById(object key);&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;so if you call below statement will cause you an error:&lt;/p&gt;  &lt;p&gt;&lt;em&gt;MembershipUser user = GetUserById(&amp;quot;23c46d23-8459-46fe-9e19-2da6800ef654&amp;quot;); &lt;strong&gt;//wrong&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;In fact, you need to use this:&lt;/p&gt;  &lt;p&gt;&lt;em&gt;MembershipUser user = GetUserById(new Guid(&amp;quot;23c46d23-8459-46fe-9e19-2da6800ef654&amp;quot;)); &lt;strong&gt;//Correct&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-7342056990209958179?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/7342056990209958179/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=7342056990209958179' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/7342056990209958179'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/7342056990209958179'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/10/store-type-string-value-into-type-guid.html' title='Store a type String value into type Guid'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-5859531521647898276</id><published>2008-10-13T17:54:00.001+08:00</published><updated>2008-10-14T13:10:57.143+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MembershipProvider'/><category scheme='http://www.blogger.com/atom/ns#' term='.Net 2.0'/><title type='text'>How to Generate Validation Key and Decryption Key for Encryption</title><content type='html'>&lt;p&gt;Usually when you deal with Membership Provider in ASP.Net, you will need to supply validation key and decryption key manually for Password Format using Hashed or Encryption. AutoGenerate is only valid for Password Format = Clear.&lt;/p&gt;  &lt;p&gt;before you generate the keys, you have to keep in mind that&lt;/p&gt;  &lt;p&gt;1.) ValidationKey is 64bit of hex value. So you will require varchar(128).&lt;/p&gt;  &lt;p&gt;2.) DescryptionKey is 24bit of hex value. So you will require varchar(48).&lt;/p&gt;  &lt;p&gt;You either choose to assign your own value or use this link to generate a random value for your application.&lt;/p&gt;  &lt;p&gt;&lt;a title="http://www.eggheadcafe.com/articles/GenerateMachineKey/GenerateMachineKey.aspx" href="http://www.eggheadcafe.com/articles/GenerateMachineKey/GenerateMachineKey.aspx"&gt;http://www.eggheadcafe.com/articles/GenerateMachineKey/GenerateMachineKey.aspx&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-5859531521647898276?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/5859531521647898276/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=5859531521647898276' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/5859531521647898276'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/5859531521647898276'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/10/how-to-generate-validation-key-and.html' title='How to Generate Validation Key and Decryption Key for Encryption'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-8781176567431161259</id><published>2008-09-05T15:40:00.003+08:00</published><updated>2008-09-05T15:44:28.733+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft Popfly'/><category scheme='http://www.blogger.com/atom/ns#' term='Mashup'/><title type='text'>Microsoft Popfly (Mashup) Sample</title><content type='html'>Recently, I have created a mashup sample using Microsoft Popfly. Here is a video player that play a list of Youtube videos with the keyword "Mister Cupid".&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;iframe allowtransparency="true" style="width:700px; height:500px;" frameborder="no" src="http://www.popfly.com/users/chrispar/Youtube-MisterCupid.small"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-8781176567431161259?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/8781176567431161259/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=8781176567431161259' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/8781176567431161259'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/8781176567431161259'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/09/microsoft-popfly-mashup-sample.html' title='Microsoft Popfly (Mashup) Sample'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-6335805729276080662</id><published>2008-08-30T16:48:00.000+08:00</published><updated>2008-08-30T17:08:57.504+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C# .Net'/><category scheme='http://www.blogger.com/atom/ns#' term='.Net 2.0'/><title type='text'>Cross-Page Posting for handling some combination of user input</title><content type='html'>&lt;blockquote&gt;   &lt;p&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I believe everybody know ASP .Net supports same page Postback function by default. For example, same page posting back to the same page. For those that do not know, ASP .Net 2.0 introduces a new capability whereby pages can post to pages other than themselves. We call this Cross-Page posting and usually it gives a tight coupling for these pages.&lt;/p&gt;  &lt;p&gt;Now, let's see what we need to create here.&lt;/p&gt;  &lt;p&gt;Let's use Page 1 as a Posting Page and Page 2 as the Receiving Page.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;To create a Cross Page posting, we can use PostbackURL from the button (LinkButton, Button, ImageButton) in Page 1 and point it to Page 2.&lt;/li&gt;    &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:Button&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Button1&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Button&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;PostBackUrl&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;~/Page 2.aspx&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;  &lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;In Page 2, add a PreviousPageType directive. This will allow you know set your previous page to Page 1.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="asp"&gt;&amp;lt;%@ PreviousPageType VirtualPath=&amp;quot;~/Page 1.aspx&amp;quot; %&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;  &lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;  &lt;p&gt;Or Use TypeName to Class name &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="asp"&gt;&amp;lt;%@ PreviousPageType TypeName=&amp;quot;_Page_1&amp;quot; %&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Above steps will let you set the tight coupling relationship between Page 1 and Page 2 and you can access the properties, control or functions in Page 1 from Page 2. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Page_2 : System.Web.UI.Page&lt;br /&gt;{&lt;br /&gt;        _Page_1 PostingPage;&lt;br /&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Page_Load(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, EventArgs e)&lt;br /&gt;        {&lt;br /&gt;            &lt;span class="kwrd"&gt;if&lt;/span&gt; (&lt;span class="kwrd"&gt;this&lt;/span&gt;.PreviousPage != &lt;span class="kwrd"&gt;null&lt;/span&gt;)&lt;br /&gt;            {&lt;br /&gt;                PostingPage = &lt;span class="kwrd"&gt;this&lt;/span&gt;.PreviousPage;&lt;br /&gt;&lt;br /&gt;                Label1.Text = PostingPage.Page1_Propertise;&lt;br /&gt;            }&lt;br /&gt;            &lt;span class="kwrd"&gt;else&lt;/span&gt;&lt;br /&gt;            {&lt;br /&gt;                Label1.Text = &lt;span class="str"&gt;&amp;quot;Previous Page is Null&amp;quot;&lt;/span&gt;;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt; }&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Usually you can use when creating wizard or pages that required tight coupling. You have to set PreviousPageType directive in order to access Page 1 properties.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Okie now, you might ask how to access a page's properties, control, or function without using PreviousPageType directive. The answer is..you may use Reference directive. Let's create the scenario now.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Now, we do not want to use PostbackURL at the button in Page 1, instead, we use a normal navigation method.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:Button&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Button1&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Button&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt;OnClick&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Button1_Click&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;In the Page 1 code behind,&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Button1_Click(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;    Server.Transfer(&lt;span class="str"&gt;&amp;quot;~/Page 2.aspx&amp;quot;&lt;/span&gt;);&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Now, we need to add reference in Page 2 so that it can access Page 1 with no problem.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;span class="asp"&gt;&amp;lt;%@ Reference Page=&amp;quot;~/_Page_1.aspx&amp;quot; %&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;By using reference page, you may need to cast your page object like the code below.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Page_2 : System.Web.UI.Page&lt;br /&gt;    {&lt;br /&gt;        _Page_1 PostingPage;&lt;br /&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Page_Load(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, EventArgs e)&lt;br /&gt;        {&lt;br /&gt;            &lt;span class="kwrd"&gt;if&lt;/span&gt; (&lt;span class="kwrd"&gt;this&lt;/span&gt;.PreviousPage != &lt;span class="kwrd"&gt;null&lt;/span&gt;)&lt;br /&gt;            {&lt;br /&gt;                PostingPage = (_Page_1)&lt;span class="kwrd"&gt;this&lt;/span&gt;.PreviousPage;&lt;br /&gt;&lt;br /&gt;                Label1.Text = ((Label)PostingPage.FindControl(&lt;span class="str"&gt;&amp;quot;Label2&amp;quot;&lt;/span&gt;)).Text;&lt;br /&gt;            }&lt;br /&gt;            &lt;span class="kwrd"&gt;else&lt;/span&gt;&lt;br /&gt;            {&lt;br /&gt;                Label1.Text = &lt;span class="str"&gt;&amp;quot;Previous Page is Null&amp;quot;&lt;/span&gt;;&lt;br /&gt;            }    &lt;br /&gt;        }&lt;br /&gt;    }&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Now, Questions raised when come to validation and Cross Page posting. If client-side validation (using javascript) is disabled on a web form, the validation will greatly depend on server-side validation. But using PostbackUrl on button will redirect to a new page. Although the server side validation has been in place, the problem is being ignored.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;What you can do here is to use PreviousPage.IsValid() function.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;See the samples below:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Page_Load(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (PreviousPage != &lt;span class="kwrd"&gt;null&lt;/span&gt;)&lt;br /&gt;    {&lt;br /&gt;        &lt;span class="kwrd"&gt;if&lt;/span&gt; (PreviousPage.IsValid == &lt;span class="kwrd"&gt;true&lt;/span&gt; )&lt;br /&gt;        {&lt;br /&gt;            &lt;span class="rem"&gt;//Continue&lt;/span&gt;&lt;br /&gt;        }&lt;br /&gt;        &lt;span class="kwrd"&gt;else&lt;/span&gt;&lt;br /&gt;        {&lt;br /&gt;            &lt;span class="rem"&gt;//Return to previous page&lt;/span&gt;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;Hope the content helps. Cross Page posting may come handy when you really need a tight coupling pages like Wizards.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;/ol&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-6335805729276080662?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/6335805729276080662/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=6335805729276080662' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/6335805729276080662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/6335805729276080662'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/08/cross-page-posting-for-handling-some.html' title='Cross-Page Posting for handling some combination of user input'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-1368457293915910407</id><published>2008-08-21T12:09:00.001+08:00</published><updated>2008-08-21T12:09:51.117+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Window Vista'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2005'/><title type='text'>SQL Server FullText Search service could not be started</title><content type='html'>&lt;p&gt;After you have installed SQL Server 2005 on Window Vista, you might find your the service above could not be started, and it returns you error like &amp;quot;the dependency service is missing or marked for future deletion&amp;quot;.&lt;/p&gt;  &lt;p&gt;The problem is that one of the service named &amp;quot;NTLMSSP&amp;quot; does not exist in Window Vista environment. If you want to know better about NTLMSSP, Live-Search it. &lt;/p&gt;  &lt;p&gt;The solution is simple, install SQL Server SP2 for Vista. Then you will find the dependency service removed.&lt;/p&gt;  &lt;p&gt;If the problem persisted, DIY method at below:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;type in &amp;quot;regedit&amp;quot; in Search to open Registry Editor.&lt;/li&gt;    &lt;li&gt;Go to HKEY_LOCAL_MACHINE -&amp;gt; SYSTEM -&amp;gt; CurrentControlSet -&amp;gt; Services&lt;/li&gt;    &lt;li&gt;Select msftesql. Check that the display name is SQL Server FullText Search.&lt;/li&gt;    &lt;li&gt;Find the item named &amp;quot;DependOnService&amp;quot;. Right Click -&amp;gt; Modify&lt;/li&gt;    &lt;li&gt;remove the NTLMSSP from the list and Click Ok&lt;/li&gt;    &lt;li&gt;Reboot and you can try starting the service again.&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Hope it helps.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-1368457293915910407?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/1368457293915910407/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=1368457293915910407' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/1368457293915910407'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/1368457293915910407'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/08/sql-server-fulltext-search-service.html' title='SQL Server FullText Search service could not be started'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-7855949299934683630</id><published>2008-08-21T11:52:00.001+08:00</published><updated>2008-08-21T11:52:52.232+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Window Vista'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2005'/><title type='text'>SQL Server Management Studio missing after installing SQL Server 2005 on Window Vista</title><content type='html'>&lt;p&gt;Sometimes this could happen when you install or reinstall SQL Server on Window Vista. I am not very sure what is the cause of it but it took away 1-3 days to figure out what was wrong with all these. It will be even worst when you find your Business Intelligence Development Studio missing as well. &lt;/p&gt;  &lt;p&gt;Ok, do not worry about it.&lt;/p&gt;  &lt;p&gt;What you need to do is&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Do not uninstall it.&lt;/li&gt;    &lt;li&gt;Go to your Microsoft SQL Server folder -&amp;gt; 90 -&amp;gt; Tools. And rename the Tools folder name to Tools-Bak&lt;/li&gt;    &lt;li&gt;Insert your SQL Server DVD and Browse it.&lt;/li&gt;    &lt;li&gt;Find a folder named Tools and execute the installer in the folder. It will basically install the missing tools (Management Studio, etc) and Sample Database.&lt;/li&gt;    &lt;li&gt;if you have problem with the SQL Server instance attaching the sample databases, do not install it else it will bring more headaches to you.&lt;/li&gt;    &lt;li&gt;Once you have finished installing the tools.. you will find a new Tools folder appear in your Microsoft SQL Server -&amp;gt; 90 folder. &lt;/li&gt;    &lt;li&gt;Now it should solve your headaches. Do not think it is finished, Apply Service Pack 2. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Hope It helps.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-7855949299934683630?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/7855949299934683630/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=7855949299934683630' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/7855949299934683630'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/7855949299934683630'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/08/sql-server-management-studio-missing.html' title='SQL Server Management Studio missing after installing SQL Server 2005 on Window Vista'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-7812865220346275151</id><published>2008-08-07T15:36:00.000+08:00</published><updated>2008-08-07T15:37:10.702+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight 2'/><category scheme='http://www.blogger.com/atom/ns#' term='IIS 7'/><title type='text'>How to deploy Silverlight component on IIS</title><content type='html'>&lt;p&gt;When you publish your website to IIS, most probably you will find your xap file copied along into the server. But when you open it in your web browser, you may not be able to see the Silverlight component in your website. There is one thing that you may need to do in order to see it, it is to &lt;/p&gt;  &lt;p&gt;&lt;b&gt;Register your silverlight extension to MIME type&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Go to your IIS, Add MIME type&lt;/p&gt;  &lt;p&gt;Extension: .xap&lt;/p&gt;  &lt;p&gt;Application: application/x-silverlight-app&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-7812865220346275151?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/7812865220346275151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=7812865220346275151' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/7812865220346275151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/7812865220346275151'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/08/how-to-deploy-silverlight-component-on.html' title='How to deploy Silverlight component on IIS'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-1182481621952061772</id><published>2008-08-07T15:34:00.001+08:00</published><updated>2008-08-07T15:34:50.371+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net 2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight 2'/><title type='text'>How to integrate Silverlight component into ASP.Net Website</title><content type='html'>&lt;p&gt;To integrate your Silverlight component into ASP.Net Website, all you need is your xap file. You may find it under Bin folder inside your Silverlight project folder. Before you copy it, make sure you have build and compiled it.&lt;/p&gt;  &lt;p&gt;Steps:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;In your Website project, create a folder named &amp;#8220;ClientBin&amp;#8221;.&lt;/li&gt;    &lt;li&gt;Copy the xap file from your Silverlight application project into the ClientBin folder.&lt;/li&gt;    &lt;li&gt;Open your Website project in VS 2008, and include the ClientBin folder into the solution. To include it, you need to open your Solution Explorer, click on the &amp;#8220;Show All File&amp;#8221; icon, and then right click on the invisible (ClientBin) folder and select &amp;#8220;Include In Project&amp;#8221;.&lt;/li&gt;    &lt;li&gt;Then open the web page that you want to insert your silverlight component. &lt;/li&gt;    &lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;&amp;lt;!-- If ASPX page, use ScriptManager and Silverlight control --&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;form&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;form1&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;height:100%;&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:ScriptManager&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;ScriptManager1&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:ScriptManager&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;  &lt;span class="attr"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;height:100%;&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;          &amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:Silverlight&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Xaml1&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Source&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;~/ClientBin/Sample.xap&amp;quot; &lt;/span&gt;&lt;span class="attr"&gt;MinimumVersion&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;2.0.30523&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Width&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;100%&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Height&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;100%&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;      &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;form&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;br /&gt;&lt;span class="rem"&gt;&amp;lt;!-- If HTML page, use Object control --&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;silverlightControlHost&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;object&lt;/span&gt; &lt;span class="attr"&gt;data&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;data:application/x-silverlight,&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;application/x-silverlight-2-b2&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;width&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;100%&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;height&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;100%&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;param&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;source&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;value&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;ClientBin/Sample.xap&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;param&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;background&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;value&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;white&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;a&lt;/span&gt; &lt;span class="attr"&gt;href&lt;/span&gt;=&lt;span class="attr"&gt;http:&lt;/span&gt;//&lt;span class="attr"&gt;go&lt;/span&gt;.&lt;span class="attr"&gt;microsoft&lt;/span&gt;.&lt;span class="attr"&gt;com&lt;/span&gt;/&lt;span class="attr"&gt;fwlink&lt;/span&gt;/?&lt;span class="attr"&gt;LinkID&lt;/span&gt;=&lt;span class="attr"&gt;115261&lt;/span&gt; &lt;span class="attr"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;text-decoration: none;&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;img&lt;/span&gt; &lt;span class="attr"&gt;src&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;http://o.microsoft.com/fwlink/?LinkId=108181&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;alt&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Gt Microsoft Silverlight&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;border-style: none&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;a&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;object&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;iframe&lt;/span&gt; &lt;span class="attr"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;='visibility:hidden;height:0;width:0;border:0px'&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;iframe&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;  &lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;Verify it by debugging your website project and view the page.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-1182481621952061772?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/1182481621952061772/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=1182481621952061772' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/1182481621952061772'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/1182481621952061772'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/08/how-to-integrate-silverlight-component.html' title='How to integrate Silverlight component into ASP.Net Website'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-4072609490699619626</id><published>2008-08-07T15:28:00.001+08:00</published><updated>2008-08-07T15:28:49.551+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C# .Net'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight 2'/><title type='text'>How to control an animation to be on/off at certain time</title><content type='html'>&lt;p&gt;I find this useful when you want to catch your web user&amp;#8217;s attention when they are browsing your website. Besides, animation can make your website look more lively and interactive.&lt;/p&gt;  &lt;p&gt;In this section, I am not going to explain how to create an animation but how to control it to begin and stop in code behind using C#.&lt;/p&gt;  &lt;p&gt;Before we go there, we need to create an animation in the first place and name it accordingly. You can create an animation easily using &lt;i&gt;Expression Blend&lt;/i&gt;. You just have to click on the Add New Storyboard icon under the &lt;i&gt;Objects and Timeline&lt;/i&gt; section and it will start recording. You may try to scale up and down an object or change its color. Let&amp;#8217;s look at the following screenshot as an example:-&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/howkuang.par/SJqkKJhYtTI/AAAAAAAAAN0/ROkK8sy2EBw/s1600-h/clip_image002%5B3%5D.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="128" alt="clip_image002" src="http://lh4.ggpht.com/howkuang.par/SJqkKsODfkI/AAAAAAAAAN4/OM_7mPeSGXI/clip_image002_thumb.jpg?imgmax=800" width="138" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/howkuang.par/SJqkLdSqXEI/AAAAAAAAAN8/u6uzmFd7TPc/s1600-h/clip_image004%5B3%5D.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="133" alt="clip_image004" src="http://lh5.ggpht.com/howkuang.par/SJqkL_ULJZI/AAAAAAAAAOA/gav8Nu5yZbE/clip_image004_thumb.jpg?imgmax=800" width="140" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;If you notice it, you may see the &amp;#8220;Bip!&amp;#8221; text coming out to represent ringing. So how do I set the animation begin time and stop time? The answer is &amp;#8220;&lt;i&gt;it depends on how you want it to be&lt;/i&gt;&amp;#8221;.&lt;/p&gt;  &lt;p&gt;Okay now, go to your Page.xaml.cs file.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Create a &lt;i&gt;Storyboard&lt;/i&gt; object and set it to null under &lt;i&gt;Page&lt;/i&gt; class. &lt;/li&gt;    &lt;pre class="csharpcode"&gt;Storyboard PhoneBip = &lt;span class="kwrd"&gt;null&lt;/span&gt;;&lt;/pre&gt;&lt;br /&gt;  &lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;Under the &lt;i&gt;Public Page()&lt;/i&gt; constructor, instantiate a &lt;i&gt;Storyboard&lt;/i&gt; object. &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre class="csharpcode"&gt;PhoneBip = &lt;span class="kwrd"&gt;new&lt;/span&gt; Storyboard();&lt;/pre&gt;&lt;br /&gt;  &lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;&lt;i&gt;PhoneBip&lt;/i&gt; object is a new object that does not have any animation set. So now I want to reference it to the one that I have already created in XAML. &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre class="csharpcode"&gt;PhoneBip = (Storyboard)&lt;span class="kwrd"&gt;base&lt;/span&gt;.FindName(&lt;span class="str"&gt;&amp;quot;PhoneRing&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;br /&gt;  &lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;I also want to set its behavior to &lt;i&gt;Stop&lt;/i&gt; once it has finished the animation. &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre class="csharpcode"&gt;PhoneBip.FillBehavior = FillBehavior.Stop;&lt;/pre&gt;&lt;br /&gt;  &lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;You have done the necessary set-up, you may try to begin the animation.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre class="csharpcode"&gt;PhoneBip.Begin();&lt;/pre&gt;&lt;br /&gt;  &lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;You may want to start the animation at certain time, then you can use DispatcherTimer object to control the tick count.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Below is the sample code:-&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Page : UserControl&lt;br /&gt;    {&lt;br /&gt;        Storyboard PhoneBip = &lt;span class="kwrd"&gt;null&lt;/span&gt;;&lt;br /&gt;        DispatcherTimer t = &lt;span class="kwrd"&gt;null&lt;/span&gt;;&lt;br /&gt;        &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; tickCount = 0;&lt;br /&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; Page()&lt;br /&gt;        {&lt;br /&gt;            InitializeComponent();&lt;br /&gt;&lt;br /&gt;            PhoneBip = &lt;span class="kwrd"&gt;new&lt;/span&gt; Storyboard();&lt;br /&gt;            PhoneBip = (Storyboard)&lt;span class="kwrd"&gt;base&lt;/span&gt;.FindName(&lt;span class="str"&gt;&amp;quot;PhoneRing&amp;quot;&lt;/span&gt;);&lt;br /&gt;            PhoneBip.FillBehavior = FillBehavior.Stop;&lt;br /&gt;&lt;br /&gt;            t = &lt;span class="kwrd"&gt;new&lt;/span&gt; DispatcherTimer();&lt;br /&gt;            t.Interval = TimeSpan.Zero; &lt;br /&gt;            t.Tick += &lt;span class="kwrd"&gt;new&lt;/span&gt; EventHandler(t_Tick); &lt;br /&gt;            t.Start();&lt;br /&gt;            &lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; t_Tick(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, EventArgs e)&lt;br /&gt;        {&lt;br /&gt;            tickCount += 1;&lt;br /&gt;            &lt;span class="kwrd"&gt;this&lt;/span&gt;.Update();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Update()&lt;br /&gt;        {&lt;br /&gt;            &lt;br /&gt;            &lt;span class="kwrd"&gt;if&lt;/span&gt; (tickCount &amp;gt; 300)&lt;br /&gt;            {&lt;br /&gt;                PhoneBip.Begin();&lt;br /&gt;                tickCount = 0;&lt;br /&gt;                &lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&amp;#8230;&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-4072609490699619626?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/4072609490699619626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=4072609490699619626' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/4072609490699619626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/4072609490699619626'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/08/how-to-control-animation-to-be-onoff-at.html' title='How to control an animation to be on/off at certain time'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/howkuang.par/SJqkKsODfkI/AAAAAAAAAN4/OM_7mPeSGXI/s72-c/clip_image002_thumb.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-3941153532715458397</id><published>2008-08-07T15:16:00.000+08:00</published><updated>2008-08-07T15:22:40.753+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight 2'/><title type='text'>How to create a template for a button type with visual states</title><content type='html'>&lt;p&gt;Silverlight allows user to create template for button with visual states. For example let&amp;#8217;s look at the following screenshot:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/howkuang.par/SJqh9NFTKPI/AAAAAAAAANc/ngYOYhb_MlY/s1600-h/clip_image002%5B3%5D.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="82" alt="clip_image002" src="http://lh4.ggpht.com/howkuang.par/SJqh9-qelPI/AAAAAAAAANg/F00ylPShUC4/clip_image002_thumb.jpg?imgmax=800" width="169" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;It is an image button that contains customized template. XAML will look like the following&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Button&lt;/span&gt; &lt;span class="attr"&gt;Height&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Auto&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Width&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Auto&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Content&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Contact&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Margin&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;10,0,10,0&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;x:Name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Contact&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Template&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;{StaticResource LeftHeader_Top_Contact}&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Cursor&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Hand&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Click&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Contact_Click&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Button&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;&lt;/h4&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;  &lt;li&gt;To create this using Expression Blend,&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;Drag a button into the page.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;Select the button, Right Click and Select &lt;i&gt;Edit Control Parts (Template)&lt;/i&gt; -&amp;gt; &lt;i&gt;Create Empty&lt;/i&gt;.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;The button is now assigned with an empty template and the XAML will look similar to the code above.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;In the &lt;i&gt;Edit Template&lt;/i&gt; section, you can put in image, text or create animation using visual states.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;All of the states are remained in Base state, it means no animation. You may want to create a bit of animation during MouseOver state.&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;a href="http://lh6.ggpht.com/howkuang.par/SJqh-kvJ4FI/AAAAAAAAANk/TPXkFdLC77E/s1600-h/clip_image004%5B6%5D.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="321" alt="clip_image004" src="http://lh3.ggpht.com/howkuang.par/SJqh_Lt4u4I/AAAAAAAAANo/FlKFpB-7gts/clip_image004_thumb%5B3%5D.jpg?imgmax=800" width="336" border="0" /&gt;&lt;/a&gt; &lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;To do that, click on the MouseOver state and it will start recording each change into key frame. For e.g Change color, Scale up and down, etc.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://lh4.ggpht.com/howkuang.par/SJqiAOR1rgI/AAAAAAAAANs/6lp6Vz8AdL4/s1600-h/clip_image006%5B8%5D.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="484" alt="clip_image006" src="http://lh5.ggpht.com/howkuang.par/SJqiBNHm_NI/AAAAAAAAANw/0D0LQUtMumE/clip_image006_thumb%5B5%5D.jpg?imgmax=800" width="511" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Once you have done, click on the Base state to stop recording.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-3941153532715458397?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/3941153532715458397/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=3941153532715458397' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/3941153532715458397'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/3941153532715458397'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/08/how-to-create-template-for-button-type.html' title='How to create a template for a button type with visual states'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/howkuang.par/SJqh9-qelPI/AAAAAAAAANg/F00ylPShUC4/s72-c/clip_image002_thumb.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-945872071055027806</id><published>2008-08-07T15:13:00.000+08:00</published><updated>2008-08-07T15:14:00.841+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight 2'/><title type='text'>How to create a tooltip with customized style</title><content type='html'>&lt;p&gt;Tooltip is a very useful tool to provide brief information about an object (usually during mouse hover action) in a web application and Silverlight is flexible enough to let you customized its style. In my case, I am using it on image button.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/howkuang.par/SJqgtbcZixI/AAAAAAAAANU/dfJmMalv6Aw/s1600-h/clip_image002%5B3%5D.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="82" alt="clip_image002" src="http://lh3.ggpht.com/howkuang.par/SJqgt7_hjAI/AAAAAAAAANY/R5AR5FM51Gk/clip_image002_thumb.jpg?imgmax=800" width="169" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;By looking at 3 image button above, you may not understand where the buttons will lead you to. Thus, if you are using tooltip, you will know the information about the image button. For example, above image shown a mouse hover action on a &amp;#8220;mail-like&amp;#8221; icon, and tooltip appeared and shows &amp;#8220;Contacts&amp;#8221;.&lt;/p&gt;  &lt;p&gt;&lt;u&gt;XAML&lt;/u&gt;&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Button&lt;/span&gt; &lt;span class="attr"&gt;Height&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Auto&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Width&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Auto&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Content&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Contact&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Margin&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;10,0,10,0&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;x:Name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Contact&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Template&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;{StaticResource LeftHeader_Top_Contact}&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Cursor&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Hand&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Click&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Contact_Click&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ToolTipService.ToolTip&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;TextBlock&lt;/span&gt; &lt;span class="attr"&gt;Height&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Auto&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Width&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Auto&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Contacts&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;TextWrapping&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Wrap&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Style&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;{StaticResource ToolTipStyle}&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ToolTipService.ToolTip&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Button&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Above code shown inheriting a style from a StaticResource named TooltipStyle. To create a Page level style:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&amp;lt;UserControl.Resources&amp;gt;&lt;br /&gt;    &amp;lt;Style x:Key=&lt;span class="str"&gt;&amp;quot;ToolTipStyle&amp;quot;&lt;/span&gt; TargetType=&lt;span class="str"&gt;&amp;quot;TextBlock&amp;quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;        &amp;lt;Setter Property=&lt;span class="str"&gt;&amp;quot;Foreground&amp;quot;&lt;/span&gt; Value=&lt;span class="str"&gt;&amp;quot;#FF9A9898&amp;quot;&lt;/span&gt; /&amp;gt;&lt;br /&gt;        &amp;lt;Setter Property=&lt;span class="str"&gt;&amp;quot;FontSize&amp;quot;&lt;/span&gt; Value=&lt;span class="str"&gt;&amp;quot;10&amp;quot;&lt;/span&gt;/&amp;gt;&lt;br /&gt;        &amp;lt;Setter Property=&lt;span class="str"&gt;&amp;quot;VerticalAlignment&amp;quot;&lt;/span&gt; Value=&lt;span class="str"&gt;&amp;quot;Bottom&amp;quot;&lt;/span&gt;/&amp;gt;&lt;br /&gt;        &amp;lt;Setter Property=&lt;span class="str"&gt;&amp;quot;FontFamily&amp;quot;&lt;/span&gt; Value=&lt;span class="str"&gt;&amp;quot;Times New Roman&amp;quot;&lt;/span&gt;/&amp;gt;&lt;br /&gt;    &amp;lt;/Style&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;#8230;&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-945872071055027806?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/945872071055027806/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=945872071055027806' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/945872071055027806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/945872071055027806'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/08/how-to-create-tooltip-with-customized.html' title='How to create a tooltip with customized style'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/howkuang.par/SJqgt7_hjAI/AAAAAAAAANY/R5AR5FM51Gk/s72-c/clip_image002_thumb.jpg?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-6168203519166169505</id><published>2008-08-07T15:10:00.000+08:00</published><updated>2008-08-07T15:11:18.602+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight 2'/><title type='text'>How to create shadow</title><content type='html'>&lt;p&gt;Shadow effect gives 3D experience to the user and it greatly increases UX (user experience) during browsing. Unlike WPF, Silverlight does not have a pre-defined object that can create the effect for you. So to create shadow, you may need to create a shape and color it with black.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/howkuang.par/SJqgEqloqwI/AAAAAAAAANM/9sYf1YU5py0/s1600-h/clip_image002%5B7%5D.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="34" alt="clip_image002" src="http://lh6.ggpht.com/howkuang.par/SJqgFd66RjI/AAAAAAAAANQ/R8qmQ2PDdvM/clip_image002_thumb%5B4%5D.jpg?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Let&amp;#8217;s look at the MENU Bar again, when mouse hover over, the menu item will raise and leave a shadow below it. (&amp;#8220;About Us&amp;#8221;)&lt;/p&gt;  &lt;p&gt;The shadow is created using Ellipse. XAML looks like this:&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Ellipse&lt;/span&gt; &lt;span class="attr"&gt;Height&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;4&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;x:Name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;ellipse&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Width&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;50&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Opacity&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;0.5&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;RenderTransformOrigin&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;0.5,0.5&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;StrokeThickness&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;0&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Margin&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;0,0,0,0&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;VerticalAlignment&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Stretch&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Ellipse.Fill&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;RadialGradientBrush&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;GradientStop&lt;/span&gt; &lt;span class="attr"&gt;Color&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;#00000000&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;GradientStop&lt;/span&gt; &lt;span class="attr"&gt;Color&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;#FFFFFFFF&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Offset&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;1&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;       &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;RadialGradientBrush&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Ellipse.Fill&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Ellipse&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;*Noticed that I am using a RadialGradientBrush to create the fading effect at the outer area.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-6168203519166169505?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/6168203519166169505/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=6168203519166169505' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/6168203519166169505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/6168203519166169505'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/08/how-to-create-shadow.html' title='How to create shadow'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/howkuang.par/SJqgFd66RjI/AAAAAAAAANQ/R8qmQ2PDdvM/s72-c/clip_image002_thumb%5B4%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-4675459166081415000</id><published>2008-08-07T15:08:00.001+08:00</published><updated>2008-08-07T15:08:54.859+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight 2'/><title type='text'>How to create a Silverlight Application</title><content type='html'>&lt;h4&gt;&lt;/h4&gt;  &lt;h4&gt;Technology&lt;/h4&gt;  &lt;p&gt;Technology Used:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;     &lt;div align="justify"&gt;Microsoft Silverlight 2.0 Beta 2&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;Microsoft Silverlight 2.0 SDK Beta 2&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;Microsoft Silverlight 2.0 Tools Beta 2 for Visual Studio 2008&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;Microsoft Expression Blend 2.5 June 2008 Preview&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;Microsoft Visual Studio 2008&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;IIS 7&lt;/div&gt;   &lt;/li&gt; &lt;/ol&gt;  &lt;h3&gt;Implementation&lt;/h3&gt;  &lt;h4&gt;How to create a Silverlight Application&lt;/h4&gt;  &lt;p&gt;Silverlight Application can be created in both Visual Studio 2008 and Expression Blend. It can be opened in both programs too.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Visual Studio 2008&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;To create in VS 2008,&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Run Visual Studio 2008 (if Win Vista, run as Administrator)&lt;/li&gt;    &lt;li&gt;Go to &lt;i&gt;File&lt;/i&gt; -&amp;gt; &lt;i&gt;New&lt;/i&gt; and click on &lt;i&gt;Project&lt;/i&gt;.&lt;/li&gt;    &lt;li&gt;Select &lt;i&gt;Silverlight&lt;/i&gt; at the Project Type panel, and then select &lt;i&gt;Silverlight Application&lt;/i&gt; at the Template List panel.&lt;/li&gt;    &lt;li&gt;Noticed that it prompts you a new window with the title &amp;#8220;Add a Silverlight Application&amp;#8221;, in this window you may select a default settings and it will create a Website Project and a Silverlight Application Project.&lt;/li&gt;    &lt;li&gt;Build the solution, and you will notice that a file with the extension .xap is created in the &lt;i&gt;ClientBin&lt;/i&gt; folder under the website project.&lt;a href="http://lh5.ggpht.com/howkuang.par/SJpzmRC5sCI/AAAAAAAAAMk/whJzu47IiQs/s1600-h/clip_image002%5B8%5D.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="385" alt="clip_image002" src="http://lh3.ggpht.com/howkuang.par/SJpzpfnjWNI/AAAAAAAAAMo/imkTx0hRN80/clip_image002_thumb%5B5%5D.jpg?imgmax=800" width="644" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;You can find 2 XAML files under Silverlight Application project. App.xaml is a XAML file that stores application level resources while Page.xaml is a main page that stores the resources and page elements at page level. To View the Page.xaml file, you will see:-     &lt;br /&gt;&lt;/li&gt; &lt;/ol&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;UserControl&lt;/span&gt; &lt;span class="attr"&gt;x:Class&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;SilverlightApplication6.Page&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;    &lt;span class="attr"&gt;xmlns&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;&lt;/span&gt; &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre class="alt"&gt;    &lt;span class="attr"&gt;xmlns:x&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;&lt;/span&gt; &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;    &lt;span class="attr"&gt;Width&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;400&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Height&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;300&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Grid&lt;/span&gt; &lt;span class="attr"&gt;x:Name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;LayoutRoot&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Background&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;White&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre class="alt"&gt;  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Grid&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;UserControl&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;pre&gt;&lt;br /&gt;&lt;br /&gt; &lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;b&gt;Expression Blend&lt;/b&gt; &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;To create in Expression Blend, &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;  &lt;li&gt;Run Expression Blend 2.5 (if Win Vista, run as Administrator.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;Click on New Project on the start-up menu.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;You will see 4 options, &lt;i&gt;WPF Application (.exe)&lt;/i&gt;, &lt;i&gt;WPF Control Library&lt;/i&gt;, &lt;i&gt;Silverlight 1 Site&lt;/i&gt;, and&lt;i&gt; Silverlight 2 Application&lt;/i&gt;. You need to select &lt;i&gt;Silverlight 2 Application.&lt;/i&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;After it is completed, you will see the same file structure as in Visual Studio 2008 but without the website project. If you build and debug it, it will dynamically generate a test page to display the result.&lt;br /&gt;    &lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:531c331a-2dab-4e00-85a0-00b951e96248" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;del.icio.us Tags: &lt;a href="http://del.icio.us/popular/Silverlight%202" rel="tag"&gt;Silverlight 2&lt;/a&gt;,&lt;a href="http://del.icio.us/popular/Visual%20Studio%202008" rel="tag"&gt;Visual Studio 2008&lt;/a&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-4675459166081415000?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/4675459166081415000/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=4675459166081415000' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/4675459166081415000'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/4675459166081415000'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/08/how-to-create-silverlight-application.html' title='How to create a Silverlight Application'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/howkuang.par/SJpzpfnjWNI/AAAAAAAAAMo/imkTx0hRN80/s72-c/clip_image002_thumb%5B5%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-7395348753532468788</id><published>2008-08-07T15:08:00.000+08:00</published><updated>2008-08-07T15:08:09.206+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight 2'/><title type='text'>How to use Grid Layout to partition the layout of the website</title><content type='html'>&lt;p&gt;Grid Layout is one of the widely used layouts in Silverlight application. It allows the user to partition it into structural grid like TABLE element in HTML.  &lt;p&gt;To create columns/rows, user needs to define the columns and rows first under the &lt;i&gt;Grid&lt;/i&gt; tag.&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Grid&lt;/span&gt; &lt;span class="attr"&gt;x:Name&lt;/span&gt;&lt;span class="kwrd"&gt;="LayoutRoot"&lt;/span&gt; &lt;span class="attr"&gt;Background&lt;/span&gt;&lt;span class="kwrd"&gt;="White"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ColumnDefinition&lt;/span&gt; &lt;span class="attr"&gt;Width&lt;/span&gt;&lt;span class="kwrd"&gt;="0.5*"&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ColumnDefinition&lt;/span&gt; &lt;span class="attr"&gt;Width&lt;/span&gt;&lt;span class="kwrd"&gt;="*"&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ColumnDefinition&lt;/span&gt; &lt;span class="attr"&gt;Width&lt;/span&gt;&lt;span class="kwrd"&gt;="0.5*"&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;     &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;RowDefinition&lt;/span&gt; &lt;span class="attr"&gt;Height&lt;/span&gt;&lt;span class="kwrd"&gt;="0.3*"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;RowDefinition&lt;/span&gt; &lt;span class="attr"&gt;Height&lt;/span&gt;&lt;span class="kwrd"&gt;="*"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Grid&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br&gt;&lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt; font-size: small;&lt;br /&gt; color: black;&lt;br /&gt; font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt; background-color: #ffffff;&lt;br /&gt; /*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt&lt;br /&gt;{&lt;br /&gt; background-color: #f4f4f4;&lt;br /&gt; width: 100%;&lt;br /&gt; margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br&gt;&lt;pre class="alt"&gt;&lt;/pre&gt;&lt;br&gt;&lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt; font-size: small;&lt;br /&gt; color: black;&lt;br /&gt; font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt; background-color: #ffffff;&lt;br /&gt; /*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt&lt;br /&gt;{&lt;br /&gt; background-color: #f4f4f4;&lt;br /&gt; width: 100%;&lt;br /&gt; margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br&gt;&lt;br&gt;&lt;br /&gt;&lt;p&gt;The value “*” means the rest of the remaining space but if value like “0.5*”, it works as a percentage. User may also use pixels as value, for e.g. “300”.&lt;br&gt;&lt;br /&gt;&lt;p&gt;Once you have finished definining the layout, you can assign them to elements. You can imagine them like Array, their index starts with value “0”. The Border element must be inside the Grid tag.&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Border&lt;/span&gt; &lt;span class="attr"&gt;Grid&lt;/span&gt;.&lt;span class="attr"&gt;Column&lt;/span&gt;&lt;span class="kwrd"&gt;="0"&lt;/span&gt; &lt;span class="attr"&gt;Grid&lt;/span&gt;.&lt;span class="attr"&gt;Row&lt;/span&gt;&lt;span class="kwrd"&gt;="0"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;...&lt;br&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Border&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br&gt;&lt;br /&gt;&lt;p&gt;Or if you want to work with RowSpan or ColumnSpan,&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;Border Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="2"&lt;/pre&gt;&lt;br&gt;&lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt; font-size: small;&lt;br /&gt; color: black;&lt;br /&gt; font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt; background-color: #ffffff;&lt;br /&gt; /*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt&lt;br /&gt;{&lt;br /&gt; background-color: #f4f4f4;&lt;br /&gt; width: 100%;&lt;br /&gt; margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br&gt;&lt;br&gt;&lt;br /&gt;&lt;p&gt;If you do not want to define the columns and spans, the items under the Grid element can overlap each other, and this can give another type of good effect like&lt;br&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://lh3.ggpht.com/howkuang.par/SJp7068JG_I/AAAAAAAAAMs/Po7TacSiFxM/s1600-h/clip_image002%5B6%5D.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="216" alt="clip_image002" src="http://lh4.ggpht.com/howkuang.par/SJp72UwUmAI/AAAAAAAAAMw/H2nTgFMRooI/clip_image002_thumb%5B3%5D.jpg?imgmax=800" width="541" border="0"&gt;&lt;/a&gt;&lt;br&gt;&lt;br /&gt;&lt;p&gt;The above picture shows 3 Border elements under a Grid element.&lt;br&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br&gt;&lt;br /&gt;&lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:f7df76a0-32b5-45b0-a753-1844cfcdd88d" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;del.icio.us Tags: &lt;a href="http://del.icio.us/popular/Silverlight%202" rel="tag"&gt;Silverlight 2&lt;/a&gt;,&lt;a href="http://del.icio.us/popular/Visual%20Studio%202008" rel="tag"&gt;Visual Studio 2008&lt;/a&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-7395348753532468788?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/7395348753532468788/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=7395348753532468788' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/7395348753532468788'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/7395348753532468788'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/08/how-to-use-grid-layout-to-partition.html' title='How to use Grid Layout to partition the layout of the website'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/howkuang.par/SJp72UwUmAI/AAAAAAAAAMw/H2nTgFMRooI/s72-c/clip_image002_thumb%5B3%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-9033734151962512135</id><published>2008-08-07T15:07:00.000+08:00</published><updated>2008-08-07T15:07:48.204+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight 2'/><title type='text'>How to use StackPanel Layout to arrange the items</title><content type='html'>&lt;p&gt;StackPanel layout is another one of the widely used layouts but its behavior differs from other layouts. As the name speaks (Stack), it can stack child elements vertically or horizontally. Thus, you can find it neat and you do not need to adjust the position manually.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Stack Horizontally&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;One scenario that I can think of is Horizontal Menu Bar. Let&amp;#8217;s look at the sample screenshot below for more feel of it.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/howkuang.par/SJp9hm8bUbI/AAAAAAAAAM0/oflifpNPTj8/s1600-h/clip_image002%5B8%5D.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="40" alt="clip_image002" src="http://lh3.ggpht.com/howkuang.par/SJp9i2N5LZI/AAAAAAAAAM4/LQWGJH6T998/clip_image002_thumb%5B5%5D.jpg?imgmax=800" width="644" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;u&gt;XAML&lt;/u&gt;&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;StackPanel&lt;/span&gt; &lt;span class="attr"&gt;Orientation&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Horizontal&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;x:Name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;stackPanel_Name&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;HorizontalAlignment&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Right&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Margin&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;0,5,0,0&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;#8230;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;StackPanel&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt; font-size: small;&lt;br /&gt; color: black;&lt;br /&gt; font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt; background-color: #ffffff;&lt;br /&gt; /*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt&lt;br /&gt;{&lt;br /&gt; background-color: #f4f4f4;&lt;br /&gt; width: 100%;&lt;br /&gt; margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;b&gt;Stack Vertically&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;I used this quite often when I was creating shadow effect or reflection effect, and it works perfectly. Let&amp;#8217;s look at the next screenshot.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://lh5.ggpht.com/howkuang.par/SJp9jyJbrUI/AAAAAAAAAM8/vzks6K9awys/s1600-h/clip_image004%5B3%5D.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="50" alt="clip_image004" src="http://lh5.ggpht.com/howkuang.par/SJp9k8M_UTI/AAAAAAAAANA/ZYYazGclhGY/clip_image004_thumb.jpg?imgmax=800" width="213" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;XAML&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;StackPanel&lt;/span&gt; &lt;span class="attr"&gt;Orientation&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Vertical&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;VerticalAlignment&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Stretch&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;HorizontalAlignment&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Stretch&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;#8230;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;StackPanel&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt; font-size: small;&lt;br /&gt; color: black;&lt;br /&gt; font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt; background-color: #ffffff;&lt;br /&gt; /*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt&lt;br /&gt;{&lt;br /&gt; background-color: #f4f4f4;&lt;br /&gt; width: 100%;&lt;br /&gt; margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:3a933101-3499-4c8d-977e-60810d19f286" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;del.icio.us Tags: &lt;a href="http://del.icio.us/popular/Silverlight%202" rel="tag"&gt;Silverlight 2&lt;/a&gt;,&lt;a href="http://del.icio.us/popular/Visual%20Studio%202008" rel="tag"&gt;Visual Studio 2008&lt;/a&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-9033734151962512135?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/9033734151962512135/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=9033734151962512135' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/9033734151962512135'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/9033734151962512135'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/08/how-to-use-stackpanel-layout-to-arrange.html' title='How to use StackPanel Layout to arrange the items'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/howkuang.par/SJp9i2N5LZI/AAAAAAAAAM4/LQWGJH6T998/s72-c/clip_image002_thumb%5B5%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-8050162057033430043</id><published>2008-08-07T15:05:00.000+08:00</published><updated>2008-08-07T15:06:52.535+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight 2'/><title type='text'>How to create reflection on images and objects</title><content type='html'>&lt;p&gt;Different type of objects may have different way to create reflection in Silverlight. If you wish to brush an image, you may need to use ImageBrush object. Or if you need to brush a video, you may need to use VideoBrush. Or otherwise, just duplicate the object, turn it around by using transform. &lt;/p&gt;  &lt;p&gt;We are going to use the same sample here.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/howkuang.par/SJqfCTSPZYI/AAAAAAAAANE/Z2JAc3liO-k/s1600-h/clip_image002%5B3%5D.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="50" alt="clip_image002" src="http://lh5.ggpht.com/howkuang.par/SJqfC9QT5uI/AAAAAAAAANI/W9zLVWUYlJk/clip_image002_thumb.jpg?imgmax=800" width="213" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Inside the StackPanel, the code will look like this&lt;/p&gt;  &lt;pre class="csharpcode"&gt;//Create an Image inside a ContentPresenter&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ContentPresenter&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Image&lt;/span&gt; &lt;span class="attr"&gt;x:Name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;imgLogo&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Source&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;images/logo.jpg&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Image&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ContentPresenter&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;//Create a Rectangle that will use ImageBrush on the jpg file&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Rectangle&lt;/span&gt; &lt;span class="attr"&gt;x:Name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;rectReflect&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Height&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;28&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Width&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;190&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Opacity&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;0.5&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Rectangle.OpacityMask&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;LinearGradientBrush&lt;/span&gt; &lt;span class="attr"&gt;EndPoint&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;0.5,1&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;StartPoint&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;0.5,0&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;GradientStop&lt;/span&gt; &lt;span class="attr"&gt;Color&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;#00000000&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Offset&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;0.5&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;GradientStop&lt;/span&gt; &lt;span class="attr"&gt;Color&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;#FF000000&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Offset&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;1&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;LinearGradientBrush&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Rectangle.OpacityMask&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Rectangle.Fill&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ImageBrush&lt;/span&gt; &lt;span class="attr"&gt;ImageSource&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;images/logo.jpg&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Stretch&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Uniform&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Rectangle.Fill&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Rectangle.RenderTransform&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;TransformGroup&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ScaleTransform&lt;/span&gt; &lt;span class="attr"&gt;CenterY&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;0.5&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;ScaleX&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;1&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;ScaleY&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;-1&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;TransformGroup&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Rectangle.RenderTransform&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Rectangle&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-8050162057033430043?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/8050162057033430043/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=8050162057033430043' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/8050162057033430043'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/8050162057033430043'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/08/how-to-create-reflection-on-images-and.html' title='How to create reflection on images and objects'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/howkuang.par/SJqfC9QT5uI/AAAAAAAAANI/W9zLVWUYlJk/s72-c/clip_image002_thumb.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-2988666769289035799</id><published>2008-07-30T16:55:00.003+08:00</published><updated>2008-07-31T11:15:54.388+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2005'/><title type='text'>SQL Server 2005 SP2 for Window Vista</title><content type='html'>&lt;p&gt;In order for SQL Server 2005 to run in Window Vista environment, you need to apply SQL Server 2005 Service Pack 2.&lt;/p&gt;&lt;p&gt;You may find the download page &lt;a title="Microsoft SQL Server 2005 SP2" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=D07219B2-1E23-49C8-8F0C-63FA18F26D3A&amp;amp;displaylang=en" target="_blank" rel="tag"&gt;here&lt;/a&gt;&lt;/p&gt;&lt;h2&gt;Overview&lt;/h2&gt;&lt;p&gt;&lt;a name="Description"&gt;&lt;/a&gt;Service Pack 2 for Microsoft SQL Server 2005 is now available. SQL Server 2005 service packs are cumulative, and this service pack upgrades all service levels of SQL Server 2005 to SP2. You can use these packages to upgrade any of the following SQL Server 2005 editions:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Enterprise &lt;/li&gt;&lt;li&gt;Enterprise Evaluation &lt;/li&gt;&lt;li&gt;Developer &lt;/li&gt;&lt;li&gt;Standard &lt;/li&gt;&lt;li&gt;Workgroup &lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-2988666769289035799?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/2988666769289035799/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=2988666769289035799' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/2988666769289035799'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/2988666769289035799'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/07/sql-server-2005-sp2-for-window-vista.html' title='SQL Server 2005 SP2 for Window Vista'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-5585233069746634276</id><published>2008-07-28T22:37:00.003+08:00</published><updated>2008-07-30T16:18:57.310+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSAS'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2005'/><title type='text'>SSAS service couldnt be started after applying SQL Server 2005 SP 2</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_m_bPMRM-lFc/SJAjNNA418I/AAAAAAAAAMY/5WSKI3Hva5E/s1600-h/RegionalLanguage.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5228717877115803586" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_m_bPMRM-lFc/SJAjNNA418I/AAAAAAAAAMY/5WSKI3Hva5E/s320/RegionalLanguage.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;You may find errors when trying to start the Analysis Services service after you have applying SQL Server 2005 Service Pack 2 under Window Vista environment. Usually you will come across it when trying to run the User Provisioning Tool right after the SP2 installation as it requires the services to be started.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;To solve the problem,&lt;/p&gt;&lt;p&gt;1.) Go to Control Panel-&gt;Regional and Language.&lt;/p&gt;&lt;p&gt;2.) Click on Administrative tab&lt;/p&gt;&lt;p&gt;3.) Change System Locale to English (United States)&lt;/p&gt;&lt;p&gt;4.) Click on Copy to Reserved Accounts, and apply it to appropriate accounts.&lt;/p&gt;&lt;p&gt;5.) Restart your Window and try to start the SSAS service again.&lt;/p&gt;&lt;p&gt;It should work fine now.&lt;/p&gt;&lt;p&gt;Cheers &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-5585233069746634276?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/5585233069746634276/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=5585233069746634276' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/5585233069746634276'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/5585233069746634276'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/07/ssas-service-couldnt-be-started-after.html' title='SSAS service couldnt be started after applying SQL Server 2005 SP 2'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_m_bPMRM-lFc/SJAjNNA418I/AAAAAAAAAMY/5WSKI3Hva5E/s72-c/RegionalLanguage.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-1575997576375102676</id><published>2008-07-25T11:36:00.004+08:00</published><updated>2008-07-30T16:21:14.798+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Repository Factory'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2008'/><title type='text'>Repository Factory for VS 2008</title><content type='html'>This has been awhile and Thanks Daniel for pointing it out!! Guys, whoever wanting this for a long time, please visit the link below and leave a comment.&lt;br /&gt;&lt;br /&gt;Thanks a lot to Ratnakar.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://ratnakarg.wordpress.com/2008/04/07/repository-factory-for-vs-2008/#comment-52"&gt;http://ratnakarg.wordpress.com/2008/04/07/repository-factory-for-vs-2008/#comment-52&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You may also leave a comment here and I can email it to you.&lt;br /&gt;&lt;br /&gt;Cheers&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-1575997576375102676?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/1575997576375102676/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=1575997576375102676' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/1575997576375102676'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/1575997576375102676'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/07/repository-factory-for-vs-2008.html' title='Repository Factory for VS 2008'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-3251115823583461354</id><published>2008-06-23T14:00:00.007+08:00</published><updated>2008-07-30T16:31:51.481+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Repository Factory'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2005'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Client Software Factory v1.1'/><title type='text'>Intergrating Web Client Software Factory and Repository Factory</title><content type='html'>For those who uses Web Client Software Factory, you may find that it doesnt create a Data Access Layer for you and you might have wasted more than 1 day to write all the data access classes. Thanks to Codeplex, we have a repository factory that handle all them the data access functions for you.&lt;br /&gt;&lt;br /&gt;If you are new to Repository Factory, please read the &lt;a href="http://chrispar.blogspot.com/2008/06/creating-data-access-layer-using.html"&gt;introduction &lt;/a&gt;first.&lt;br /&gt;&lt;br /&gt;In this post, I will explain on how to integrate both of them into a web application to speed up your development as well as to cut down your maintenance cost.&lt;br /&gt;&lt;br /&gt;First, Create Web Client Software Factory solution, and name it. Let's say "SampleWebApp". WCSF will generate all the default structures and files for ya.&lt;br /&gt;&lt;br /&gt;Now, right click on the Solution, and Select Add-&gt; New Project. You need to create 3 Class Library projects and name it as following:-&lt;br /&gt;1.) Repository.Host&lt;br /&gt;2.) Repository.DataAccess&lt;br /&gt;3.) Repository.BusinessEntities&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;You may want to ask why 3? Good question, usually 1 is&lt;br /&gt;sufficient but there are some bugs with the Connection String. Repository&lt;br /&gt;Factory requires you to use a project to host the connection string and most of&lt;br /&gt;us uses website project to hold the reponsibility, but Connection String couldnt&lt;br /&gt;be found by the Repository Factory wizards when we create Business Modules/Views&lt;br /&gt;using WCSF first before creating data repository class files. So if you are&lt;br /&gt;using 1 Class Library project, make sure you start from repository project&lt;br /&gt;first.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Besides, using 3 Class Library projects are alot easier to&lt;br /&gt;maintain. For example, when you are creating Data Access or Business Entities,&lt;br /&gt;the namespace of the class files will follow the Class Library project name, for&lt;br /&gt;instance "Repository". So it will be very messy if Business Entities and Data&lt;br /&gt;Access files fall into the same namespace. If you want to split them up in the&lt;br /&gt;namespace, it will take some time for you to manually change the namespace of&lt;br /&gt;each file into Repository.DataAccess or&lt;br /&gt;Repository.BusinessEntities.&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;br /&gt;Next, assign the Reponsibility of each Class Library projects by right click each Class Library projects and select Repository Factory -&gt; specify project responsibility&lt;br /&gt;1.) Repository.Host -&gt; Host&lt;br /&gt;2.) Repository.DataAccess -&gt; Data Access&lt;br /&gt;3.) Repository.BusinessEntities -&gt; Business Entities&lt;br /&gt;&lt;br /&gt;Now, setup the database:-&lt;br /&gt;1.) Create database&lt;br /&gt;2.) Create tables&lt;br /&gt;&lt;br /&gt;You have done all the necessary setup. You may start with :-&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Create and Assign Connection String&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;em&gt;1.) Connection String for Repository Factory&lt;/em&gt;&lt;br /&gt;Right Click the Repository.Host project, Select Repository Factory -&gt; Add Database Connection&lt;br /&gt;&lt;br /&gt;&lt;em&gt;2.) Connection String for Website&lt;/em&gt;&lt;br /&gt;Go to the website node, and search for the master web.config. Right Click and Select Repository Factory -&gt; Add Database Connection to Configuration file. Once you have created it, Right Click the web.config and Select Edit Enterprise Library Configuration. Select Data Access Application Block node and open Properties. Assign the default Database to the Connection String that you just created.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Create a business module and a page under the module&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;Using WCSF, right click Modules section and select Web Client Factory -&gt; Add a Business Module(C#/VB). For example, named it "Member".&lt;br /&gt;&lt;br /&gt;Under the website node, you will noticed that a Member folder is created. Right Click and select Web Client Factory -&gt; Add a View(C#/VB). Then an aspx page will be created under Member module. To verify it, you will notice that a presenter class file is created along under the Member module node. For instance, "CreateMember.aspx"&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Create Business Entities&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;Go to Repository.BusinessEntities project, right click and select Repository Factory-&gt;Create business entities from database. It will prompt you a wizard. Follow the wizards and complete the process.&lt;br /&gt;&lt;br /&gt;1.) First, select the Host Project, it should be Repository.Host, and the connection string and then Click Next.&lt;br /&gt;2.) Then, select the tables that you want.&lt;br /&gt;3.) View the attributes and Click Finish.&lt;br /&gt;&lt;br /&gt;The business entities class files for the tables you want are created under the project.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Create Stored Procedure&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;Go to Repository.DataAccess project, right click and select Repository Factory-&gt;Create CRUD Stored Procedure. Follow through the wizard again.&lt;br /&gt;&lt;br /&gt;1.) First, select the Host Project, and the connection string and then click next.&lt;br /&gt;2.) Select the tables that you want.&lt;br /&gt;3.) Then you will notice that the wizard provide 5 common operations for each table. If there is any that you do not need, uncheck the checkbox for the particular operation. Change the SP name if necessary. Then click Next.&lt;br /&gt;4.) In the last screen, input a file name. And click Finish.&lt;br /&gt;&lt;br /&gt;Repository Factory has created a SQL file for you to create the stored procedures. Copy and Paste the script into Management Studio and execute it.&lt;br /&gt;&lt;br /&gt;Before you execute it, make sure to change all the Alter Procedure to Create Procedure. Click Check and Execute. If there are errors saying procedures' names existed, Change all the Create Procedure back to Alter. Then execute it again.&lt;br /&gt;&lt;br /&gt;Note that if you are using SQL Server 2000, there are some syntax taht you need to remove, for example, remove&lt;br /&gt;&lt;br /&gt;&lt;em&gt;begin try, end try, begin catch, end catch, RethrowError procedure&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;and replace&lt;br /&gt;&lt;br /&gt;&lt;em&gt;sys.objects-&gt;sysobjects&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Once you have successfully execute the script, you can find all SP in the database. If you want to create a customized SP, you may need to create them manually in the Management Studio.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Create Data Repository Classes&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;Now it's time to create Data Repository classes. Right Click Repository.DataAccess and select Repository Factory-&gt;Create data repository classes from business entities.&lt;br /&gt;&lt;br /&gt;Go through the wizard again.&lt;br /&gt;1.) Select the Host project and connection string and click Next&lt;br /&gt;2.) Select the business entities project and click Next&lt;br /&gt;3.) Select the entity that you want and click Next&lt;br /&gt;4.) Then, in this screen you will find that the wizard has created all the common operations for you except GetBy operations.&lt;br /&gt;&lt;br /&gt;Auto Created Operations: Insert, Update, Delete, and GetAll&lt;br /&gt;&lt;br /&gt;5.) Now you need to create GetByPK (Get One) by clicking add, select the right stored proc and check the mapping. if correct click finish.&lt;br /&gt;6.)Then you need to create GetByFK (this one usually Get Many) if applicable.&lt;br /&gt;&lt;br /&gt;I assume you know how to create them. Once you have done, click finish and all the data repository classes will be created.&lt;br /&gt;&lt;br /&gt;If you want to modify the namespace, you may do so. Else save and build it. Make sure you do not have any error.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;NOTE: Do not overwrite any repository classes. Must Remember! Delete it before you copy over.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Create function to access Data Access Layer&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;Go to Module section, look for Member module (if you are working on member module)&lt;br /&gt;1.) right click References and select Add References.&lt;br /&gt;2.) under the Projects tab, add Repository.BusinessEntities and Repository.DataAccess. (So that you have the reference to those projects and use their fucntions).&lt;br /&gt;3.) you will also need to add reference for Microsoft.Practises.Repository.dll into the module references. you can find it in C:/Program Files/Microsoft Patterns &amp;amp; Practices/Data Access Guidance Package Setup/.&lt;br /&gt;4.) Open the controller file. In this case, MemberController.cs and insert the following codes:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;using Repository.BusinessEntities;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;using Repository.DataAccess;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;using Repository.DataAccess.MemberRepositoryArtifacts;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;//In the MemberController Class, insert the following codes:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;IMemberRepository _member;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;public void CreateMember(member obj)&lt;br /&gt;{&lt;br /&gt;_member = new memberRepository();&lt;br /&gt;_member.Add(obj);&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;br /&gt;5.) Save and Close.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Create a business function for insert member operation in Presenter&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;If you have created a View/Page under Member module, for e.g. CreateMember.aspx, you will notice a CreateMemberPresenter file in the same module under View folder.&lt;br /&gt;&lt;br /&gt;1.) Open it and if the controller object is commented, uncomment it.&lt;br /&gt;2.) Create a function as follow:-&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;public void OnCreateMember(member obj)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;_controller.CreateMember(obj);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;To simulate the outcome&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;1.) create a link button in Default.aspx under Member folder in the website node.&lt;br /&gt;2.) In the code behind, insert the following codes into the link button OnClick event handler.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;Response.Redirect("/DevelopmentWebsite/Member/CreateMember.aspx");&lt;/span&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;br /&gt;Then, Im going to simulate an insert during a page initialize/load.&lt;br /&gt;&lt;br /&gt;3.) Open CreateMemberPresenter.cs or vb.&lt;br /&gt;4.) Look for the function OnViewInitialized().&lt;br /&gt;5.) In the function write the following codes:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;public override void OnViewInitialized()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;member mem = new member();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;// I did not insert value for "id" because it is set auto-increment in the table.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;mem.name = "Chris";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;mem.age = 26; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;this.OnCreateMember(mem);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Finish&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;In real project, you may want to supply the data using form or by user input. So you may ignore the Simulate section as it is just to verify the result.&lt;br /&gt;&lt;br /&gt;Hope it helps.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-3251115823583461354?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/3251115823583461354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=3251115823583461354' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/3251115823583461354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/3251115823583461354'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/06/intergrating-web-client-software.html' title='Intergrating Web Client Software Factory and Repository Factory'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-575456017155673286</id><published>2008-06-23T09:58:00.006+08:00</published><updated>2008-06-23T13:59:52.511+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2005'/><category scheme='http://www.blogger.com/atom/ns#' term='.Net 2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Client Software Factory v1.1'/><title type='text'>Performing Insert, Update and Delete using ObjectContainerDataSource</title><content type='html'>It is very easy and effective to use &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;ObjectContainerDataSource&lt;/span&gt; to handle insert, update and delete event. When the user performs an update operations, insert operation, or delete operation in a data-bound control, the data source control raises the following events.&lt;br /&gt;&lt;br /&gt;C#&lt;br /&gt;&lt;br /&gt;public event &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;EventHandler&lt;/span&gt;&lt;objectcontainerdatasourcestatuseventargs&gt; Updated;&lt;br /&gt;public event &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;EventHandler&lt;/span&gt;&lt;objectcontainerdatasourcestatuseventargs&gt; Inserted;&lt;br /&gt;public event &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;EventHandler&lt;/span&gt;&lt;objectcontainerdatasourcestatuseventargs&gt; Deleted;&lt;br /&gt;&lt;br /&gt;For example, if you are using &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;DetailsView&lt;/span&gt; and &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;ObjectContainerDataSource&lt;/span&gt; in your page to create a Insert form,&lt;br /&gt;&lt;br /&gt;1.) Named your &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;ObjectContainerDataSource&lt;/span&gt;, like &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;MemberDataSource&lt;/span&gt;&lt;br /&gt;2.) Set your &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;DataObjectTypeName&lt;/span&gt;.&lt;br /&gt;3.) Named your Details View, like &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;dvCreateMember&lt;/span&gt;&lt;br /&gt;4.) Set the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;DataKeyNames&lt;/span&gt;="id" in Details View, most of the time it should be the primary key.&lt;br /&gt;5.) Set the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;DataSourceID&lt;/span&gt;="&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;MemberDataSource&lt;/span&gt;" Details View&lt;br /&gt;6.) Set the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;DefaultMode&lt;/span&gt;="Insert" in Details View&lt;br /&gt;7.) In the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;ObjectContainerDataSource&lt;/span&gt;, set the &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_15"&gt;OnInserted&lt;/span&gt; event name.&lt;br /&gt;&lt;br /&gt;Codes will look like this:-&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&amp;lt;div&amp;gt;&lt;br /&gt;&amp;lt;asp:DetailsView ID="dvCreateMember" DataKeyNames="id" DefaultMode="Insert" runat="server" AutoGenerateRows="False" DataSourceID="MemberDataSource"&amp;gt;&lt;br /&gt;&amp;lt;Fields&amp;gt;&lt;br /&gt;&amp;lt;asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" /&amp;gt;&lt;br /&gt;&amp;lt;asp:BoundField DataField="age" HeaderText="Age" SortExpression="age" /&amp;gt;&lt;br /&gt;&amp;lt;asp:CommandField ButtonType="Button" InsertText="Create" NewText="Add New" ShowInsertButton="True" /&amp;gt;&lt;br /&gt;&amp;lt;/Fields&amp;gt;&lt;br /&gt;&amp;lt;/asp:DetailsView&amp;gt;&lt;br /&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;pp:ObjectContainerDataSource ID="MemberDataSource" runat="server" DataObjectTypeName="Repository.BusinessEntities.member" OnInserted="MemberDataSource_Inserted" /&amp;gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/span&gt;In the Code Behind Page, the event handler function will look like this:-&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;blockquote&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;using Microsoft.Practices.Web.UI.WebControls;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;protected void MemberDataSource_Inserted(object sender,&lt;br /&gt;ObjectContainerDataSourceStatusEventArgs&lt;br /&gt;e)&lt;br /&gt;{&lt;br /&gt;_presenter.onCreateMember((member)e.Instance);&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;br /&gt;The data that inserted into the details view will be automatically stored into the e.instance when it is passed to ObjectContainerDataSource. Hence, there is no need to have extra code to map the data from UI to back end codes.&lt;br /&gt;&lt;br /&gt;Noticed that there is a function onCreateMember() being called in the Inserted event. It is the function defined in Presenter Layer.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;### Presenter Class File###&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;public void onCreateMember(member&lt;br /&gt;obj)&lt;br /&gt;{&lt;br /&gt;_controller.CreateMember(obj);&lt;br /&gt;}&lt;/span&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;br /&gt;And, CreateMember() function is defined in Controller layer.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;###Controller Class File###&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;public void CreateMember(member obj)&lt;br /&gt;{&lt;br /&gt;_member = new memberRepository();&lt;br /&gt;_member.Add(obj);&lt;br /&gt;}&lt;/span&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;br /&gt;In the above function, it is call the add function from Data Access layer. You may use Repository Factory to generate those.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-575456017155673286?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/575456017155673286/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=575456017155673286' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/575456017155673286'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/575456017155673286'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/06/performing-insert-update-and-delete.html' title='Performing Insert, Update and Delete using ObjectContainerDataSource'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-5067641757395426903</id><published>2008-06-20T16:47:00.009+08:00</published><updated>2008-06-23T09:57:05.622+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2005'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Client Software Factory v1.1'/><title type='text'>ObjectContainerDataSource in Web Client Software Factory</title><content type='html'>The Web Client Software Factory contains the data source control ObjectContainerDataSource. This control implements data binding in a way that easily integrates with the View-Presenter pattern.&lt;br /&gt;&lt;br /&gt;You can think of the ObjectContainerDataSource control as a container of objects. You programmatically populate the container, and the container raises events when changes occur to any of the contained objects. This design allows the view (Web page) to delegate the responsibility of performing select operations, update operations, delete operations, and insert operations to the presenter.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;How to Use ObjectContainerDataSource?&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;To add ObjectContainerDataSource controll into the toolbox:&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;right-click the Data tab in the Toolbox, and then select Choose Items. On the .NET FrameworkComponents tab, click Browse, select the Microsoft.Practices.Web.UI.WebControls.dll assembly, and then click Open. Select the ObjectContainerDataSource control in the list of components, and then click OK.&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;to use it, Drag and drop the control into the UI. Then&lt;br /&gt;1.) Go into Design Mode and click on the Show Smart Tag, and select Configure Data Source..&lt;br /&gt;2.) Noticed that you need to specify a Data Object Type. Select an appropriate object.&lt;br /&gt;3.) Named the container. for instance, MemberDataSource.&lt;br /&gt;&lt;br /&gt;For example, to show items when view loads:-&lt;br /&gt;1.) First create a property for set operation in the page code behind.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Public IList&lt;member&gt; memberDS&lt;br /&gt;{&lt;br /&gt;set { MemberDataSource.DataSource = value};&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;2.)To be visible in Presenter, Open IMemberView in the Member module and add a definition as following:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;IList&lt;member&gt; memberDS {set;}&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;3.) go to MemberPresenter, inside the OnViewInitialized method, put this the code.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;This.View.memberDS = data... ;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;4.) In the page, drag and drop a Grid View, and set its data source attribute to MemberDataSource.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-5067641757395426903?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/5067641757395426903/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=5067641757395426903' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/5067641757395426903'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/5067641757395426903'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/06/objectcontainerdatasource-in-web-client.html' title='ObjectContainerDataSource in Web Client Software Factory'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-1243183200143711030</id><published>2008-06-20T15:46:00.003+08:00</published><updated>2008-06-20T16:42:35.442+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2005'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Client Software Factory v1.1'/><title type='text'>Business Module, Foundation Module and Page in Web Client Software Factory v1.1</title><content type='html'>Dear all,&lt;br /&gt;&lt;br /&gt;It has been some time I have not posted anything about web client software factory as I was busy with my rl work. Web Client Software Factory is my favourite tool when creating a web client. I suggest everybody should give a try on it.&lt;br /&gt;&lt;br /&gt;Recently, I have given a sharing session about Web Client Software Factory for a bunch of interns who are about to graduate from university (Multimedia University) and I realized I should continue writing more about it so that it can help others to get more details on what exactly WCSF does.&lt;br /&gt;&lt;br /&gt;If you do not know what Web Client Software Factory is, please visit Introduction to &lt;a href="http://chrispar.blogspot.com/2008/03/1.html"&gt;Web Client Software Factory&lt;/a&gt; post to have some kick starts. Web Client Software Factory uses Model-View-Presenter architectural pattern to encourage reuse of the individual User Controls (referred to in CAB as "SmartParts") by not coupling them with their underlying data elements or presentation code.&lt;br /&gt;&lt;br /&gt;The structure will look like this:&lt;br /&gt;&lt;br /&gt;Page &lt;--&gt; Presenter &lt;--&gt; Controller&lt;br /&gt;&lt;br /&gt;In this post, I will cover a few essential fundamentals about WCSF.&lt;br /&gt;1.) Business Modules&lt;br /&gt;2.) Foundational Modules&lt;br /&gt;3.) Page/View&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;1.0 What is a Business Modules?&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;Business Module is a type of Module that encapsulate a set of concerns of the application at Module Level. The logics created in a particular business module will be shared accross the module. When a user create a business module in WCSF, a default web page will be created under the website node in the module name's folder.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Files Created by WCSF:-&lt;/strong&gt;&lt;br /&gt;&lt;em&gt;Website Node:&lt;/em&gt; a folder named as the module name which contains a web.config, Default.aspx and Default.aspx Code Behind.&lt;br /&gt;&lt;em&gt;Module Node:&lt;/em&gt; a folder named as the module name which contains a Presenter Class file for Default.aspx, and View Interface for Default.aspx, Controller Class file and ModuleIntializer Class file.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;1.1 How to Create a Business Modules&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;To Create a Business Module, select the MODULE node and right Click. You will notice a menu item named "Web Client Factory". Click on it and Select "Add Business Module (C# or VB)".&lt;br /&gt;&lt;br /&gt;An add business module wizard will appear:-&lt;br /&gt;1.) Add New Project: Give a name to the module and give a path(if it is different from the default).&lt;br /&gt;2.) Module Details: Check the checkbox for Unit Test if you require it.&lt;br /&gt;3.) Click Finish.&lt;br /&gt;4.) Debug it and you will notice a new menu named as the module name added into the website.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;2.0 What is Foundational Module&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;It is quite similar to Business Module, but it does not allow you to create Page/View under this module. Which means, Foundational Module does not have Presenters nor have Controller. It also will not create a folder with default page in the website node like how Business Module does. The set of concerns that encapsulate in this type of module is shared across the whole application. Usually, Global services are created in this module and each application will have only 1 foundational module.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;2.1 How to create a Foundational Module&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;To Create a Foundational Module, select the MODULE node and right Click. You will notice a menu item named "Web Client Factory". Click on it and Select "Add Foundational Module (C# or VB)".&lt;br /&gt;&lt;br /&gt;An add foundational module wizard will appear:-&lt;br /&gt;1.) Add New Project: Give a name to the module and give a path(if it is different from the default).&lt;br /&gt;2.) Module Details: Check the checkbox for Unit Test if you require it.&lt;br /&gt;3.) Click Finish and Verify it at the MODULE node.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;strong&gt;3.0 What is a Page/View&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;Page is a web page so it has .aspx extension and a Code Behind Class file. User can add UI elements to a page.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;3.1 How to Create a Page&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;To create a page, you need to consider which business module it belongs to. For instance, a CreateMember.aspx will fall into Member module or it is directly under the root node (Website node).&lt;br /&gt;1.) Right click on the module folder under the website node or right click on the root node&lt;br /&gt;2.) Select "Web Client Factory" and Click on Add a View(C#/VB).&lt;br /&gt;&lt;br /&gt;a Wizard will be appeared and Change the name for the particular View and click Finish.&lt;br /&gt;&lt;br /&gt;You will notice that (for e.g CreateMember) a CreateMember.aspx created under the Member folder(if it is created in Member folder), and under the Member module, CreateMemberPresenter and ICreateMemberView are created.&lt;br /&gt;&lt;br /&gt;I hope this will give you more understanding on how Web Client Software Factory does.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-1243183200143711030?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/1243183200143711030/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=1243183200143711030' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/1243183200143711030'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/1243183200143711030'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/06/business-module-foundation-module-and.html' title='Business Module, Foundation Module and Page in Web Client Software Factory v1.1'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-1229901686464629603</id><published>2008-06-10T16:26:00.003+08:00</published><updated>2008-06-10T16:38:22.118+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Repository Factory'/><title type='text'>Repository Factory Error: Object reference not set to an instance of an object.</title><content type='html'>&lt;strong&gt;Problem Statement&lt;/strong&gt;&lt;br /&gt;If you are using repository factory to create your data access layer and you get error in page showing&lt;br /&gt;&lt;br /&gt;"Object reference not set to an instance of an object.&lt;br /&gt;Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.&lt;br /&gt;&lt;br /&gt;Exception Details: System.NullReferenceException: Object reference not set to an instance of an object."&lt;br /&gt;&lt;br /&gt;And the problem is pointing you at the Repository Object, for example:&lt;br /&gt;&lt;br /&gt;Line xx: public sampleRepository()&lt;br /&gt;Line xx: : base()&lt;br /&gt;&lt;br /&gt;The problem comes from the connection string. You have not specified a default connection that you are using.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution&lt;/strong&gt;&lt;br /&gt;1.) Open your web.config with your Enterprise Library Editor, and select Data Access Application Block node and open it in Propertise.&lt;br /&gt;2.) In the DefaultDatabase field, select your connection string that you have created.&lt;br /&gt;&lt;br /&gt;Compile the project and run again. It should work now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-1229901686464629603?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/1229901686464629603/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=1229901686464629603' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/1229901686464629603'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/1229901686464629603'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/06/repository-factory-error-object.html' title='Repository Factory Error: Object reference not set to an instance of an object.'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-5896264459831552969</id><published>2008-06-10T15:31:00.003+08:00</published><updated>2008-06-10T16:22:32.460+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Repository Factory'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2005'/><category scheme='http://www.blogger.com/atom/ns#' term='.Net 2.0'/><title type='text'>Creating Data Access Layer using Repository Factory</title><content type='html'>Repository Factory is a guidance package that automates creation of entity classes that map to database tables and repository classes to read and write those entity classes.&lt;br /&gt;&lt;br /&gt;There is an existing blog that has done a good job in demostrating how it works so I dont think I need to rewrite a new one. Please visit &lt;a href="http://developer.bracora.com/Articles/DataAccessLayer.aspx"&gt;http://developer.bracora.com/Articles/DataAccessLayer.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If the link is broken, do let me know and I shall consider writing a new one.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-5896264459831552969?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/5896264459831552969/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=5896264459831552969' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/5896264459831552969'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/5896264459831552969'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/06/creating-data-access-layer-using.html' title='Creating Data Access Layer using Repository Factory'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-6810335109201142702</id><published>2008-06-10T15:01:00.004+08:00</published><updated>2008-06-10T15:10:34.992+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web Client Software Factory v1.1'/><title type='text'>Web Client Software Factory error "Failed to map the path /" in Vista</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_m_bPMRM-lFc/SE4n7YCIW8I/AAAAAAAAALU/5OmzPoQjMT4/s1600-h/Failedtomapthepath.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210145719931395010" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_m_bPMRM-lFc/SE4n7YCIW8I/AAAAAAAAALU/5OmzPoQjMT4/s200/Failedtomapthepath.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;There is a problem when developer trying to debug a WCSF project in Vista. The page will show something similiar above. "Server Error in '/DevelopmentWebsite' Application" and "Failed to map the path '/'"&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;But not too worry, to solve the problem, you have to quit the Visual Studio program and restart the Visual Studio program (either 2005 or 2008) by right clicking the exe and select RUN AS ADMINISTRATOR.&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Then it should work fine.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-6810335109201142702?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/6810335109201142702/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=6810335109201142702' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/6810335109201142702'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/6810335109201142702'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/06/web-client-software-factory-error.html' title='Web Client Software Factory error &quot;Failed to map the path /&quot; in Vista'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_m_bPMRM-lFc/SE4n7YCIW8I/AAAAAAAAALU/5OmzPoQjMT4/s72-c/Failedtomapthepath.jpg' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-7150787800364589057</id><published>2008-06-09T16:58:00.005+08:00</published><updated>2008-06-09T17:18:43.020+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Repository Factory'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2005'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2008'/><title type='text'>How to make Repository Factory supported in VS 2008?</title><content type='html'>I believe this has been an issue to alot of developers that have used to build the data access layer using Repository Factory for the past years using VS 2005. Unforturenately, Microsoft has shown no more interest in upgrading the current package to support VS 2008 and .net 3.0 above.&lt;br /&gt;&lt;br /&gt;However, the community has taken alot of test to move it to VS 2008. I wish to give a big thank to 2 developers who have provided us a workaround, Jose Escrich and Noel Anderton!&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Noel Anderton 's piece&lt;/strong&gt;&lt;br /&gt;"So we have taken the Source for the Guidance and opened in vs2008 this updated the guidance to vs2008 projects with out incident. We made sure we had the VS 2008 Guidance package for creating guidance packages installed and enabled the package. We then ran the Register guidance recipe which successfully registered the Repository Package Guidance. We opened another version of VS2008 and used the repository guidance to create a solution.. Great. So we tried the installer. We updated the registry paths in the launch conditions of the set up project and after unregistering in vs the guidance package we ran the installer. The installation was ran without error but when we attempted to use the repository guidance package we could not enable it. It did not show up. "&lt;br /&gt;&lt;br /&gt;the above content can be found in &lt;a href="http://www.codeplex.com/RepositoryFactory/Thread/View.aspx?ThreadId=23088"&gt;http://www.codeplex.com/RepositoryFactory/Thread/View.aspx?ThreadId=23088&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Jose Escrich's piece&lt;/strong&gt;&lt;br /&gt;To achieve that you must add/change some arguments in all the custom actions as follow:&lt;br /&gt;&lt;br /&gt;/Hive=9.0 /Configuration="[TARGETDIR]MyGP.xml"&lt;br /&gt;&lt;br /&gt;the argument that you have to change is /Hive=9.0 and also you can specify something like /Hive=9.0Exp /RANU in case that if you want to register the guidance package into the experimental hive and RANU mode. Note that changes applies just for the installer so, if you want to change the registration hive in design time, that's when you register a GP through Visual Studio, you have to add under the GuidancePackage element a HostData child element as follow:&lt;br /&gt;&lt;hostdata&gt;&amp;lt;HostData&amp;gt;&lt;br /&gt;&amp;lt;RegistrationSettings&amp;gt;/Hive=9.0&amp;lt;/RegistrationSettings&amp;gt;&lt;br /&gt;&amp;lt;/HostData&amp;gt;&lt;/hostdata&gt;&lt;br /&gt;&lt;br /&gt;the above content can be found in &lt;a href="http://forums.msdn.microsoft.com/en-US/vsgatk/thread/194e5c70-aa51-4de6-96df-cfda1c8832be"&gt;http://forums.msdn.microsoft.com/en-US/vsgatk/thread/194e5c70-aa51-4de6-96df-cfda1c8832be&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-7150787800364589057?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/7150787800364589057/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=7150787800364589057' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/7150787800364589057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/7150787800364589057'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/06/how-to-make-repository-factory.html' title='How to make Repository Factory supported in VS 2008?'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-4563033166873715949</id><published>2008-04-01T17:28:00.002+08:00</published><updated>2008-04-01T17:37:59.017+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2005'/><title type='text'>Write Locked File error during installation of SQL Server 2005 SP 1</title><content type='html'>During the installation of SQL Server 2005 SP 1 (Service Pack 1), you may encounter the following error:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;color:#ff0000;"&gt;&lt;blockquote&gt;&lt;p&gt;&lt;span style="font-size:85%;color:#ff0000;"&gt;The following files are currently locked. In order to prevent a necessary reboot at the end of the patch install process, close down all other applications before proceeding.&lt;/span&gt;&lt;span style="font-size:85%;color:#ff0000;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;color:#ff0000;"&gt;&lt;br /&gt;Write locked file: C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\msftesql.exe (msftesql.exe)&lt;br /&gt;Write locked file: C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\msftepxy.dll (msftesql.exe)&lt;br /&gt;Write locked file: C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\msfte.dll (msftesql.exe)&lt;br /&gt;Write locked file: C:\Program Files\Microsoft SQL Server\90\Shared\sqlbrowser.exe (sqlbrowser.exe)&lt;br /&gt;Write locked file: C:\Program Files\Microsoft SQL Server\90\Shared\svenumapi.dll (wmiprvse.exe)&lt;/span&gt; &lt;/p&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;br /&gt;To solve this. go to Control Panel-&gt;Administrative Tools-&gt;Services and Stop the following services.&lt;br /&gt;&lt;br /&gt;1.) SQL Server FullText Search (MSSQLSERVER)&lt;br /&gt;2.) SQL Server Browser&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-4563033166873715949?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/4563033166873715949/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=4563033166873715949' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/4563033166873715949'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/4563033166873715949'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/04/write-locked-file-error-during.html' title='Write Locked File error during installation of SQL Server 2005 SP 1'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-8700470787757860414</id><published>2008-04-01T16:23:00.002+08:00</published><updated>2008-04-01T16:29:40.574+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Window Vista'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2005'/><title type='text'>Installation of SQL Server 2005 on Vista - Warning Message "IIS Feature Requirement" during System Configuration Check</title><content type='html'>&lt;p id="vkab"&gt;&lt;b id="madq"&gt;&lt;span style="font-family:arial;"&gt;Installation of SQL Server 2005 on Vista - Warning Message "IIS Feature Requirement" during System Configuration Check&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p id="l82i"&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p id="jj1-"&gt;&lt;span style="font-family:arial;"&gt;- If you click on the message, you will see:-&lt;/span&gt;&lt;/p&gt;&lt;p id="mpjx"&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;blockquote id="gv5c" dir="ltr" style="MARGIN-RIGHT: 0px"&gt;&lt;p class="MsoNormal" id="crcc" style="MARGIN: 0in 0in 0pt"&gt;&lt;span id="y33m"    style="font-family:arial;font-size:100%;color:#330099;"&gt;Microsoft Internet Information Services (IIS) is either not installed or is disabled. IIS is required by some SQL Server features. Without IIS, some SQL Server features will not be available for installation. To install all SQL Server features, install IIS from Add or Remove Programs in Control Panel or enable the IIS service through the Control Panel if it is already installed, and then run SQL Server Setup again. For a list of features that depend on IIS, see Features Supported by Editions of SQL Server in Books Online.&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p id="mpjx"&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p id="xksk"&gt;&lt;span style="font-family:arial;"&gt;- If you proceed with the installation, you will find the Checkbox for "Reporting Services" is disabled.&lt;/span&gt;&lt;/p&gt;&lt;p id="psh0"&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p id="n6uq"&gt;&lt;b id="m3a."&gt;&lt;span style="font-family:arial;"&gt;Reason&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p id="eofv"&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p id="f63o"&gt;&lt;span style="font-family:arial;"&gt;1.) IIS not installed or IIS is disabled.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:arial;"&gt;2.) Some of the required features in IIS are not installed.&lt;/span&gt;&lt;/p&gt;&lt;p id="q:xf"&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p id="i:36"&gt;&lt;b id="vywj"&gt;&lt;span style="font-family:arial;"&gt;Solution&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p id="gsel"&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p id="qv9b"&gt;&lt;span style="font-family:arial;"&gt;1.) Log on to Window with Administrative privilege.&lt;/span&gt;&lt;/p&gt;&lt;p id="iai:"&gt;&lt;span style="font-family:arial;"&gt;2.) Go to Start-&amp;gt;Control Panel&lt;/span&gt;&lt;/p&gt;&lt;p id="b6np"&gt;&lt;span style="font-family:arial;"&gt;3.) If Classic View, Go to Programs and Features; Else Go to Programs -&amp;gt; Programs and Features&lt;/span&gt;&lt;/p&gt;&lt;p id="a2nc"&gt;&lt;span style="font-family:arial;"&gt;4.) Click "Turn Windows Features On or Off&lt;/span&gt;&lt;/p&gt;&lt;p id="ns-i"&gt;&lt;span style="font-family:arial;"&gt;5.) Locate the IIS (Internet Information Services).&lt;/span&gt;&lt;/p&gt;&lt;p id="us4t"&gt;&lt;span style="font-family:arial;"&gt;6.) If it is NOT Checked, it means IIS not installed. Then you check it.&lt;/span&gt;&lt;/p&gt;&lt;p id="y3cl"&gt;&lt;span style="font-family:arial;"&gt;7.) If it is filled, it means partially installed. Then you may need to check the following items:-&lt;/span&gt;&lt;/p&gt;&lt;p id="av69"&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p id="wyw4"&gt;&lt;span style="font-family:arial;"&gt;+ Web Management Tools&lt;/span&gt;&lt;/p&gt;&lt;p id="s3k."&gt;&lt;span style="font-family:arial;"&gt;    + IIS 6 Management Compatibility&lt;/span&gt;&lt;/p&gt;&lt;p id="fcvt"&gt;&lt;span style="font-family:arial;"&gt;        +IIS 6 WMI Compatibility&lt;/span&gt;&lt;/p&gt;&lt;p id="csdb"&gt;&lt;span style="font-family:arial;"&gt;        +IIS Metabase and IIS 6 Configurations Compatibility&lt;/span&gt;&lt;/p&gt;&lt;p id="ru6-"&gt;&lt;span style="font-family:arial;"&gt;+ World Wide Web Services&lt;/span&gt;&lt;/p&gt;&lt;p id="vuuy"&gt;&lt;span style="font-family:arial;"&gt;    + Application Development Features&lt;/span&gt;&lt;/p&gt;&lt;p id="uhtk"&gt;&lt;span style="font-family:arial;"&gt;        + ASP .Net&lt;/span&gt;&lt;/p&gt;&lt;p id="e.e5"&gt;&lt;span style="font-family:arial;"&gt;        + ISAPI Extensions (Automatically checked if you check ASP .Net)&lt;/span&gt;&lt;/p&gt;&lt;p id="uuxn"&gt;&lt;span style="font-family:arial;"&gt;        + ISAPI Filters (Automatically checked if you check ASP .Net)&lt;/span&gt;&lt;/p&gt;&lt;p id="l92o"&gt;&lt;span style="font-family:arial;"&gt;    + Common Http Features&lt;/span&gt;&lt;/p&gt;&lt;p id="k:g1"&gt;&lt;span style="font-family:arial;"&gt;        + Default Document&lt;/span&gt;&lt;/p&gt;&lt;p id="mg0m"&gt;&lt;span style="font-family:arial;"&gt;        + Directory Browsing&lt;/span&gt;&lt;/p&gt;&lt;p id="aprf"&gt;&lt;span style="font-family:arial;"&gt;        + Http Redirection&lt;/span&gt;&lt;/p&gt;&lt;p id="ylg-"&gt;&lt;span style="font-family:arial;"&gt;        + Static Content&lt;/span&gt;&lt;/p&gt;&lt;p id="em.3"&gt;&lt;span style="font-family:arial;"&gt;    + Security&lt;/span&gt;&lt;/p&gt;&lt;p id="xfpp"&gt;&lt;span style="font-family:arial;"&gt;        + Windows Authentication&lt;/span&gt;&lt;/p&gt;&lt;p id="poi6"&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p id="i.in"&gt;&lt;span style="font-family:arial;"&gt;If you find some of the other options are needed then you may want to check it as well.&lt;/span&gt;&lt;/p&gt;&lt;p id="sfsh"&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p id="d_j9"&gt;&lt;span style="font-family:arial;"&gt;8.) Click Ok.&lt;/span&gt;&lt;/p&gt;&lt;p id="le4t"&gt;&lt;span style="font-family:arial;"&gt;9.) It will take awhile to install the components, and all these steps does not require a Window CD.&lt;/span&gt;&lt;/p&gt;&lt;p id="vyez"&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p id="pygs"&gt;&lt;span style="font-family:arial;"&gt;After that, you may proceed to install SQL Server 2005. If you find the warning persisted, then you may want to try restarting the IIS or the Window.&lt;/span&gt;&lt;/p&gt;&lt;p id="y616"&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p id="oi2g"&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-8700470787757860414?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/8700470787757860414/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=8700470787757860414' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/8700470787757860414'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/8700470787757860414'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/04/installation-of-sql-server-2005-on.html' title='Installation of SQL Server 2005 on Vista - Warning Message &quot;IIS Feature Requirement&quot; during System Configuration Check'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-2999706449829746453</id><published>2008-03-01T12:36:00.003+08:00</published><updated>2008-03-01T12:40:22.586+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2005'/><category scheme='http://www.blogger.com/atom/ns#' term='C# .Net'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Client Software Factory v1.1'/><category scheme='http://www.blogger.com/atom/ns#' term='VB .Net'/><title type='text'>Introduction to Web Client Software Factory v1.1 June 2007</title><content type='html'>&lt;b&gt;&lt;u&gt;1. What is Web Client Software Factory?&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="k9zf" style="padding: 1em 0pt; text-align: left;"&gt;&lt;img style="width: 379px; height: 359px;" src="http://docs.google.com/File?id=dnvrjcp_12hxkhddm" /&gt;&lt;/div&gt;The Web Client Software Factory (WCSF) provides a set of guidance for architects  and developers building enterprise Web applications. The factory includes  samples, reusable code and a guidance package which automates key development  tasks from within Visual Studio.&lt;br /&gt;&lt;br /&gt;Using the Web Client Software Factory  assets, developers can create Composite  Web applications composed of independently developed and deployed modules.  These modules are dynamically brought together at runtime into a common shell.  Additionally the factory includes support for ASP.NET AJAX thus providing users  with a richer and more responsive user experience.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;A composite Web client application is a Web application that is composed of a  number of discrete and independent pieces. These pieces are integrated together  within a Web server environment; they are presented to the user in a Web browser  as a fully coherent Web client solution. The Composite pattern is a popular and  recurring theme because it provides a flexible and scalable architecture that  provides several key benefits, including the following:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;It allows a higher degree of separation between application infrastructure  and business logic.  &lt;/li&gt;&lt;li&gt;It allows more independent development of the individual business logic  components themselves.  &lt;/li&gt;&lt;li&gt;It provides solution agility because business logic components can be  flexibly combined to quickly yield a specific solution.  &lt;/li&gt;&lt;li&gt;It promotes code re-use because it allows business logic components and the  application infrastructure to be re-used across multiple solutions.  &lt;/li&gt;&lt;li&gt;It provides an excellent architecture for the front-end integration of  line-of-business systems or service-oriented systems into a task-oriented user  experience.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;A composite Web client application consists of functionality from several  different sources. These sources include Web services, functionality in other  applications, or entire systems (often, it interacts with multiple back-end  systems).&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;u&gt;2. Introduction to Web Client Software Factory - June 2007&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="line-height: normal;"&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt; Version: 1.1&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Date Published: 6/15/2007&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Language: English&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;h4&gt;System Requirements&lt;/h4&gt; &lt;div class="downloadInfo"&gt; &lt;ul&gt;&lt;li&gt;&lt;b&gt;Supported Operating Systems: &lt;/b&gt;Windows Server 2003; Windows Vista;  Windows XP&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt; &lt;ul&gt;&lt;li&gt;Microsoft .NET Framework 2.0&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Microsoft .NET Framework 3.0&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a title="Visual Studio 2005 extensions for .NET Framework 3.0 (Windows Workflow  Foundation)" href="http://www.microsoft.com/downloads/info.aspx?na=40&amp;amp;p=2&amp;amp;SrcDisplayLang=en&amp;amp;SrcCategoryId=&amp;amp;SrcFamilyId=dfe00522-2642-4c91-b68a-c91aa9ab3dcd&amp;amp;u=http%3a%2f%2fwww.microsoft.com%2fdownloads%2fdetails.aspx%3fFamilyId%3d5D61409E-1FA3-48CF-8023-E8F38E709BA6%26displaylang%3den" id="qacv"&gt;Visual Studio 2005 extensions for .NET Framework 3.0 (Windows Workflow  Foundation)&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a title="Guidance Automation Extensions" href="http://www.microsoft.com/downloads/info.aspx?na=40&amp;amp;p=3&amp;amp;SrcDisplayLang=en&amp;amp;SrcCategoryId=&amp;amp;SrcFamilyId=dfe00522-2642-4c91-b68a-c91aa9ab3dcd&amp;amp;u=http%3a%2f%2fwww.microsoft.com%2fdownloads%2fdetails.aspx%3ffamilyid%3dC0A394C0-5EEB-47C4-9F7B-71E51866A7ED%26displaylang%3den" id="n821"&gt;Guidance Automation Extensions&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a title="Guidance Automation Toolkit" href="http://www.microsoft.com/downloads/info.aspx?na=40&amp;amp;p=4&amp;amp;SrcDisplayLang=en&amp;amp;SrcCategoryId=&amp;amp;SrcFamilyId=dfe00522-2642-4c91-b68a-c91aa9ab3dcd&amp;amp;u=http%3a%2f%2fwww.microsoft.com%2fdownloads%2fdetails.aspx%3ffamilyid%3dE3D101DB-6EE1-4EC5-884E-97B27E49EAAE%26displaylang%3den" id="alcb"&gt;Guidance Automation Toolkit&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a title="Enterprise Library 3.1 - May 2007" href="http://www.microsoft.com/downloads/info.aspx?na=47&amp;amp;p=1&amp;amp;SrcDisplayLang=en&amp;amp;SrcCategoryId=&amp;amp;SrcFamilyId=dfe00522-2642-4c91-b68a-c91aa9ab3dcd&amp;amp;u=details.aspx%3ffamilyid%3d4C557C63-708F-4280-8F0C-637481C31718%26displaylang%3den" id="w_ou"&gt;Enterprise Library 3.1 - May 2007&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;3. Download and Install&lt;br /&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;You may get the download from &lt;a title="Web Client Software Factory v1.1" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=DFE00522-2642-4C91-B68A-C91AA9AB3DCD&amp;amp;displaylang=en#AffinityDownloads" id="ox_3"&gt;this&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;After you have downloaded it, double click on the exe file and install it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;4. How to create a website using WSCF with one CLICK&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;Steps:-&lt;br /&gt;1.) Open Visual Studio 2005&lt;br /&gt;2.) Click File-&amp;gt;New-&amp;gt;Project&lt;br /&gt;&lt;div id="pj97" style="padding: 1em 0pt; text-align: left;"&gt;&lt;img style="width: 676px; height: 491px;" src="http://docs.google.com/File?id=dnvrjcp_13gfhbk6dx" /&gt;&lt;/div&gt;3.) Select &lt;i&gt;Web Client Development June 2007&lt;/i&gt; as Project Type under Guidance Packages. Then select &lt;i&gt;Web Client Solution (C#/Visual Basic, Web Site)&lt;/i&gt; as Template.&lt;br /&gt;4.) Name the application and press OK button to proceed.&lt;br /&gt;&lt;br /&gt;&lt;div id="l._t" style="padding: 1em 0pt; text-align: left;"&gt;&lt;img style="width: 693px; height: 483px;" src="http://docs.google.com/File?id=dnvrjcp_14gkjnkdqg" /&gt;&lt;/div&gt;5.) Check that all the required assemblies lie in the correct location. Noticed that there is a default &lt;i&gt;Module &lt;/i&gt;created for the project.&lt;br /&gt;6.) Click &lt;i&gt;Finish &lt;/i&gt;button to proceed.&lt;br /&gt;7.) You have successfully created a website. Click RUN to verify.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_m_bPMRM-lFc/R8jdrVIX8SI/AAAAAAAAABI/yG8YSecPlfw/s1600-h/WCSF-Create3.JPG"&gt;&lt;img style="cursor: pointer;" src="http://3.bp.blogspot.com/_m_bPMRM-lFc/R8jdrVIX8SI/AAAAAAAAABI/yG8YSecPlfw/s400/WCSF-Create3.JPG" alt="" id="BLOGGER_PHOTO_ID_5172627908511396130" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-2999706449829746453?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/2999706449829746453/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=2999706449829746453' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/2999706449829746453'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/2999706449829746453'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/03/1.html' title='Introduction to Web Client Software Factory v1.1 June 2007'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_m_bPMRM-lFc/R8jdrVIX8SI/AAAAAAAAABI/yG8YSecPlfw/s72-c/WCSF-Create3.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-9201771538608148861</id><published>2008-02-29T14:29:00.004+08:00</published><updated>2008-02-29T15:26:37.388+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net 2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='ReportViewer'/><title type='text'>How to make your ReportViewer(Local Mode) display in FULL PAGE?</title><content type='html'>.Net Framework Used: .Net 2.0&lt;br /&gt;&lt;br /&gt;Usually when you have created your report using Report Viewer, it has toolbars on top and scrollbars for both horizontal and vertical border. The report will be display inside the body of ReportViewer control and when you write it to printer to print it as image, the printer will render it as how it looks (With both scrollbars and you can not view the report in full).&lt;br /&gt;&lt;br /&gt;To View it in full and remove those scrollbars, simply, set the properties of ReportViewer Control (&lt;b&gt;&lt;i&gt;AsyncRendering&lt;/i&gt;&lt;/b&gt;) to &lt;span style="color: rgb(56, 118, 29);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;&lt;b&gt;false&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;:-&lt;br /&gt;&lt;br /&gt;&amp;lt;rsweb:ReportViewer ID="ReportViewer1" &lt;i&gt;AsyncRendering="false"&lt;/i&gt; runat="server" ...&lt;br /&gt;&lt;br /&gt;Then it will display in full size in a page.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-9201771538608148861?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/9201771538608148861/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=9201771538608148861' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/9201771538608148861'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/9201771538608148861'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/02/how-to-make-your-reportviewerlocal-mode.html' title='How to make your ReportViewer(Local Mode) display in FULL PAGE?'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-212030480699695759</id><published>2008-02-29T13:50:00.009+08:00</published><updated>2008-02-29T15:11:12.529+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net 2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='ReportViewer'/><title type='text'>Create ASP .Net 2.0 ReportViewer (Local Mode)</title><content type='html'>.Net Framework Used: .Net 2.0&lt;br /&gt;Other Components: Web Client Software Factory (WCSF), Repository Factory&lt;br /&gt;&lt;br /&gt;How to create a ReportViewer using Local Mode?&lt;br /&gt;1.) Create a report template file (.RDLC) in your website.&lt;br /&gt;2.) Design your report template file by double click the &lt;i&gt;test&lt;/i&gt;.rdlc&lt;br /&gt;3.) In your report template, you may need to create the dataset so that it can be assigned to your report. To create a dataset, you need to create your store procedure first.&lt;br /&gt;3.) In your aspx page (switch to design mode), drag and drop the ReportViewer control to your page.&lt;br /&gt;4.) Create your datasource and bind to the reportviewer. In my example, It's using ObjectContainerDataSource. Do it in design mode, it will save a lot of times. Moreover, multiple datasources are possible.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;1. Create a report template file (.RDLC)&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;Steps:-&lt;br /&gt;1.)To Create a report template, open Solution Explorer and create a new folder under Development Website. Name the folder "Reports".&lt;br /&gt;2.) Right Click on the &lt;i&gt;Reports&lt;/i&gt; folder and click on &lt;i&gt;Add New Item&lt;/i&gt;.&lt;br /&gt;3.) In the Template window, select &lt;i&gt;Report&lt;/i&gt; and click &lt;i&gt;Add&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_m_bPMRM-lFc/R8eA5VIX8NI/AAAAAAAAAAc/5pOeKC0QSzU/s1600-h/CreateReportTemplate.JPG"&gt;&lt;img src="http://2.bp.blogspot.com/_m_bPMRM-lFc/R8eA5VIX8NI/AAAAAAAAAAc/5pOeKC0QSzU/s400/CreateReportTemplate.JPG" alt="" id="BLOGGER_PHOTO_ID_5172244419471470802" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4.) you will notice a file named SampleReport.rdlc created under the Report folder.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;2. Design your report template file &amp;amp; 3. Create DataSet and Assign it to your report template.&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;Steps:-&lt;br /&gt;1.) Double click on SampleReport.rdlc to open the designer.&lt;br /&gt;2.) In the designer, there is a toolbox on your left side. Open the ToolBox and drag the item you want into the report. For instance, drag a Table.&lt;br /&gt;3.) Notice that there is a datasource window under the toolbox. That's the place where you create your dataset.&lt;br /&gt;&lt;br /&gt;&lt;div id="ye0m" style="padding: 1em 0pt; text-align: left;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_m_bPMRM-lFc/R8eeK1IX8OI/AAAAAAAAAAk/_sX9E6nBGLI/s1600-h/CreateDataSet.JPG"&gt;&lt;img style="cursor: pointer;" src="http://4.bp.blogspot.com/_m_bPMRM-lFc/R8eeK1IX8OI/AAAAAAAAAAk/_sX9E6nBGLI/s400/CreateDataSet.JPG" alt="" id="BLOGGER_PHOTO_ID_5172276605956387042" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;4.) Create your dataset by specifying your connection, Store Procedure and etc.&lt;br /&gt;5.) After you have created your dataset, it will appear on your left panel in Website Data Source window.&lt;br /&gt;6.) Expand it and drag the file to the place you want to place it on the report designer. For example, drag and place it in the Table object.&lt;br /&gt;7.) After you have assigned the attribute, the report template creation is done.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;4. Add ReportViewer control into your ASPX page&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;Steps:-&lt;br /&gt;1.) Create an ASPX page if you do not have one.&lt;br /&gt;2.) Open your Toolbox and drag the ReportViewer control to your ASPX page (Design mode).&lt;br /&gt;&lt;br /&gt;&lt;div id="p92v" style="padding: 1em 0pt; text-align: left;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_m_bPMRM-lFc/R8eedlIX8PI/AAAAAAAAAAs/rJdfd85n8Dk/s1600-h/CreateReportViewerControl.JPG"&gt;&lt;img style="cursor: pointer;" src="http://3.bp.blogspot.com/_m_bPMRM-lFc/R8eedlIX8PI/AAAAAAAAAAs/rJdfd85n8Dk/s400/CreateReportViewerControl.JPG" alt="" id="BLOGGER_PHOTO_ID_5172276928078934258" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;3.) Once you have created the control on your aspx page, select it and click on the arrow on the top right corner to setup the control. For example, Bind it to your RDLC file.&lt;br /&gt;&lt;br /&gt;&lt;div id="towu" style="padding: 1em 0pt; text-align: left;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_m_bPMRM-lFc/R8eexVIX8QI/AAAAAAAAAA0/v5CHCtDK4TA/s1600-h/SetupReportViewerControl.JPG"&gt;&lt;img style="cursor: pointer;" src="http://2.bp.blogspot.com/_m_bPMRM-lFc/R8eexVIX8QI/AAAAAAAAAA0/v5CHCtDK4TA/s400/SetupReportViewerControl.JPG" alt="" id="BLOGGER_PHOTO_ID_5172277267381350658" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;4.) After you have selected a RDLC file, drag and drop an ObjectContainerDataSource control to your page. ObjectContainerDataSource requires the &lt;b&gt;Microsoft.Practices.Web.UI.WebControls.dll&lt;/b&gt; to be added to the toolbox.&lt;br /&gt;5.) Configure the ObjectContainerDataSource. For e.g Name and BusinessEntities. If you are using WCSF and Repository Factory to create your web pages, Business Entities has been created based on your Database.&lt;br /&gt;6.) Now, Choose the Datasource for ReportViewer control and Match it to the right dataset.&lt;br /&gt;&lt;br /&gt;&lt;div id="nc2w" style="padding: 1em 0pt; text-align: left;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_m_bPMRM-lFc/R8efMFIX8RI/AAAAAAAAAA8/E6D4MCXKpls/s1600-h/SetupReportViewerControl1.JPG"&gt;&lt;img style="cursor: pointer;" src="http://1.bp.blogspot.com/_m_bPMRM-lFc/R8efMFIX8RI/AAAAAAAAAA8/E6D4MCXKpls/s400/SetupReportViewerControl1.JPG" alt="" id="BLOGGER_PHOTO_ID_5172277726942851346" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;7.) You have done the setup for your report viewer control, and Now, the final step is to provide the data to your DataSource in your code behind.&lt;br /&gt;&lt;br /&gt;You may also refer to &lt;a href="http://www.codeproject.com/KB/webforms/ReportViewer.aspx"&gt;This Website&lt;/a&gt; as reference.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-212030480699695759?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/212030480699695759/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=212030480699695759' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/212030480699695759'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/212030480699695759'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/02/blog-post.html' title='Create ASP .Net 2.0 ReportViewer (Local Mode)'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_m_bPMRM-lFc/R8eA5VIX8NI/AAAAAAAAAAc/5pOeKC0QSzU/s72-c/CreateReportTemplate.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4702502957422480559.post-8978373608212206230</id><published>2008-02-29T10:11:00.010+08:00</published><updated>2008-02-29T15:23:17.831+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net 2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='ClientScriptManager'/><title type='text'>How to add External Javascript (.js) file to your ASPX page</title><content type='html'>I was having a problem fixing this and it took me 1 day time to search through the net and got it fix nicely.&lt;br /&gt;&lt;br /&gt;.Net Framework used: 2.0&lt;br /&gt;Language used: C#&lt;br /&gt;&lt;br /&gt;To register the Javascript file to your page, you need to :&lt;br /&gt;1.) Register it in your code behind&lt;br /&gt;2.) If it has a function that need you to call from your page, you need to use OnClientClick event for your LinkButton/Button. Once you click then it will call the function in your .js file.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1. Register your external Javascript in Code Behind&lt;/span&gt;&lt;br /&gt;Register your external Javascript in code behind by using &lt;span style="font-style: italic;"&gt;RegisterClientScriptInclude()&lt;/span&gt; function. You may refer to http://msdn2.microsoft.com/en-us/library/system.web.ui.clientscriptmanager.registerclientscriptinclude.aspx  for details.&lt;br /&gt;&lt;br /&gt; protected void Page_Load(object sender, EventArgs e)&lt;br /&gt; {&lt;br /&gt;if (!this.IsPostBack)&lt;br /&gt;{&lt;br /&gt;this._presenter.OnViewInitialized();&lt;br /&gt;this.init();&lt;br /&gt;}&lt;br /&gt;this._presenter.OnViewLoaded();&lt;br /&gt;&lt;br /&gt;     &lt;span style="font-style: italic;"&gt;    String csname = "AreaPrint";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    String csurl = "~/AreaPrintingService.js";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    Type cstype = this.GetType();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    ClientScriptManager cs = Page.ClientScript;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    if (!cs.IsStartupScriptRegistered(cstype, csname))&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    cs.RegisterClientScriptInclude(cstype, csname, ResolveClientUrl(csurl));&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;            }&lt;/span&gt;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2. OnClientClick event to call Javascript function&lt;/span&gt;&lt;br /&gt;You cannot use OnClick event to call javascript function if you are using ASP: LINKBUTTON OR ASP:BUTTON.&lt;br /&gt;&lt;br /&gt;You may use this instead in your ASPX page:&lt;br /&gt;&lt;br /&gt;&lt;asp:button id="lnkPrint" runat="server" text="Print Preview" style="font-style: italic;"&gt;OnClientClick="printPartOfPage('print');" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/asp:button&gt;&lt;asp:button id="lnkPrint" runat="server" text="Print Preview"&gt;DONE.&lt;/asp:button&gt;&lt;asp:button id="lnkPrint" runat="server" text="Print Preview" style="font-style: italic;"&gt;&lt;br /&gt;&lt;br /&gt;My Javascript function &lt;span style="font-style: italic;"&gt;printPartOfPage()&lt;/span&gt; is mainly send the DIV area to printer to print. The content of &lt;span style="font-style: italic;"&gt;AreaPrintingService.js &lt;/span&gt;:-&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;// JScript File&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;function printPartOfPage(elementID)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    var printContent = document.getElementById(elementID);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    var windowURL = "about:blank";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    var windowName = "Preview";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    var printWindow = window.open(windowURL, windowName, "width=800,height=600,scrollbars=yes");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    printWindow.document.write(printContent.innerHTML);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    printWindow.document.close();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    printWindow.moveTo(300,200);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    printWindow.focus();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    printWindow.print();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;}&lt;/span&gt;&lt;br /&gt;-----------------------------------------------------------------------------&lt;br /&gt;Beside using &lt;span style="font-style: italic;"&gt;RegisterClientScriptInclude&lt;/span&gt; Method, you may consider using &lt;span style="font-style: italic;"&gt;RegisterClientScriptBlock&lt;/span&gt; Method if your js code is not too long.&lt;br /&gt;&lt;span style="font-family:monospace;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;        String csname = &lt;span style="color:maroon;"&gt;&lt;span style="color:maroon;"&gt;"PopupScript"&lt;/span&gt;&lt;/span&gt;;&lt;span style="font-family:monospace;"&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;br /&gt;&lt;/span&gt;        Type cstype = &lt;span style="color:blue;"&gt;this&lt;/span&gt;.GetType();&lt;span style="color:green;"&gt;&lt;/span&gt;&lt;span style="font-family:monospace;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;ClientScriptManager cs = Page.ClientScript;&lt;br /&gt;&lt;br /&gt; if (!cs.IsStartupScriptRegistered(cstype, csname1))&lt;br /&gt; {&lt;br /&gt;     String cstext = "alert('Hello World');";&lt;br /&gt;&lt;script&gt;&lt;/script&gt;           cs.RegisterStartupScriptBlock(cstype, csname, cstext, true); // last input argument set to  TRUE  if you do not include  tag in your &lt;span style="font-style: italic;"&gt;cstext&lt;/span&gt;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;OR If you have Longer script use StringBuilder to build to the script before passing it to RegisStartupScriptBlock&lt;br /&gt;&lt;br /&gt;StringBuilder cstext = new StringBuilder();&lt;br /&gt;cstext.Append("text/javascript\"&gt; function DoClick() {");&lt;br /&gt;cstext.Append("Form1.Message.value='Text from client script.'} );&lt;br /&gt;cstext.Append("script&gt;");&lt;br /&gt;cs.RegisterClientScriptBlock(cstype, csname, cstext.ToString(), false); &lt;--  tag already included&lt;/asp:button&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4702502957422480559-8978373608212206230?l=chrispar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chrispar.blogspot.com/feeds/8978373608212206230/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4702502957422480559&amp;postID=8978373608212206230' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/8978373608212206230'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4702502957422480559/posts/default/8978373608212206230'/><link rel='alternate' type='text/html' href='http://chrispar.blogspot.com/2008/02/how-to-add-external-javascript-js-file.html' title='How to add External Javascript (.js) file to your ASPX page'/><author><name>Chris Par</name><uri>http://www.blogger.com/profile/00757434122032023339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_m_bPMRM-lFc/SM8kq-4pbZI/AAAAAAAAAOg/Ca5QEBL3VK4/s1600-R/n1126476179_109555_8753.jpg'/></author><thr:total>1</thr:total></entry></feed>
