<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Thiago's Blog</title><subtitle type="html">Just a little space to share my experiences and opinions about web development</subtitle><id>http://weblogs.asp.net/thiagosantos/atom.aspx</id><link rel="alternate" type="text/html" href="http://weblogs.asp.net/thiagosantos/default.aspx" /><link rel="self" type="application/atom+xml" href="http://weblogs.asp.net/thiagosantos/atom.aspx" /><generator uri="http://communityserver.org" version="3.0.20510.895">Community Server</generator><updated>2008-11-05T11:33:00Z</updated><entry><title>My first time... with jQuery UI</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/thiagosantos/archive/2009/03/21/my-first-time-with-jquery-ui.aspx" /><id>http://weblogs.asp.net/thiagosantos/archive/2009/03/21/my-first-time-with-jquery-ui.aspx</id><published>2009-03-21T19:57:00Z</published><updated>2009-03-21T19:57:00Z</updated><content type="html">&lt;P&gt;I've been working with jQuery for a while now, but only recently I started using one of its greatest child projects, jQuery UI. I think it's an amazing library and decided to make a few 'how to' posts about it.&lt;/P&gt;
&lt;P&gt;If you don't know jQuery UI, it's a client library built on top of jQuery which provides some highly customizable, lightweight, cross-browser client side web controls. Currently on version 1.7, jQuery UI provides DateTimePicker, Tabs, Highlights, Slider among other things. I suggest you to visit the official web site and take a look on what you can do with it. &lt;A href="http://jqueryui.com/home" mce_href="http://jqueryui.com/home"&gt;Here's the official website&lt;/A&gt;.&lt;/P&gt;
&lt;H3&gt;The Sample&lt;/H3&gt;
&lt;P&gt;The sample I'm doing is pretty much a &lt;I&gt;Hello World&lt;/I&gt; of the Slider control. I've created an application which changes the &lt;FONT face="Courier New" color=#bb5e00&gt;&lt;STRONG&gt;font-size&lt;/STRONG&gt;&lt;/FONT&gt; attribute of a specific &lt;FONT face="Courier New" color=#bb5e00&gt;&lt;STRONG&gt;&amp;lt;div&amp;gt;&lt;/STRONG&gt;&lt;/FONT&gt; element based on the Slider's value. Click on the image to download the sample.&lt;/P&gt;
&lt;P&gt;&lt;A class="" title="Click here to download the sample app" href="http://weblogs.asp.net/blogs/thiagosantos/jquery1/jquery_ui_sample1.zip" mce_href="http://weblogs.asp.net/blogs/thiagosantos/jquery1/jquery_ui_sample1.zip"&gt;&lt;IMG height=461 src="http://weblogs.asp.net/blogs/thiagosantos/jquery1/app.png" width=571 border=1 mce_src="http://weblogs.asp.net/blogs/thiagosantos/jquery1/app.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I believe that as web developers, we have be concerned with the quality or our applications, but also with the user experience. There's nothing really fancy here, but using these controls, we can improve the user experience in a certain way as shown on the sample. &lt;/P&gt;
&lt;H3&gt;How does it work&lt;/H3&gt;
&lt;P&gt;The first thing you'll need to run jQuery UI controls is, obviously, to download the library. It already comes with the most recent version of jQuery, "minified". To download, go to &lt;A href="http://www.jqueryui.com/download" mce_href="http://www.jqueryui.com/download"&gt;http://www.jqueryui.com/download&lt;/A&gt; and select what you want. By default, everything is already pre-selected (Core, Interaction, Widgets and Effects). Once you figure which pieces you want, select the Theme and download. If you don't know what the theme look like, go to the themes page &lt;A href="http://www.jqueryui.com/themeroller" mce_href="http://www.jqueryui.com/themeroller"&gt;http://www.jqueryui.com/themeroller&lt;/A&gt; and play with the existing themes, select the one you want and click download, it will redirect you back to the download page, but now your theme will be already selected . You can even create your own theme by customizing an existing one at the themes page. &lt;BR&gt;&lt;BR&gt;Once you download the package, note that it comes with all the JavaScript and CSS you'll need, as well as a sample page with all controls. Inside the "css" folder, you'll find a folder named after the theme you selected, and finally, inside this folder you'll find the css and the images you'll need to build your app. Note that it also comes with the a sample page named index.html and a folder named development-bundle, which is a pack of detailed documentation about all controls and more demos. All you'll need is what's inside the js and css folders to your app folder.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://weblogs.asp.net/blogs/thiagosantos/WindowsLiveWriter/Myfirsttime.withjQueryUI_FB8D/downloaded_2.png" mce_href="http://weblogs.asp.net/blogs/thiagosantos/WindowsLiveWriter/Myfirsttime.withjQueryUI_FB8D/downloaded_2.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=128 alt="The original package right after the download" src="http://weblogs.asp.net/blogs/thiagosantos/WindowsLiveWriter/Myfirsttime.withjQueryUI_FB8D/downloaded_thumb.png" width=446 border=0 mce_src="http://weblogs.asp.net/blogs/thiagosantos/WindowsLiveWriter/Myfirsttime.withjQueryUI_FB8D/downloaded_thumb.png"&gt;&lt;/A&gt; &lt;A href="http://weblogs.asp.net/blogs/thiagosantos/WindowsLiveWriter/Myfirsttime.withjQueryUI_FB8D/my_app_root_2.png" mce_href="http://weblogs.asp.net/blogs/thiagosantos/WindowsLiveWriter/Myfirsttime.withjQueryUI_FB8D/my_app_root_2.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=128 alt="After my changes" src="http://weblogs.asp.net/blogs/thiagosantos/WindowsLiveWriter/Myfirsttime.withjQueryUI_FB8D/my_app_root_thumb.png" width=434 border=0 mce_src="http://weblogs.asp.net/blogs/thiagosantos/WindowsLiveWriter/Myfirsttime.withjQueryUI_FB8D/my_app_root_thumb.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Since this sample is nothing but a slider, I won't really create an application folder or anything. I'll just delete the folder "development-bundle", add my own images folder, "img", and change all the markup of index.html file. Note on the code snipped below that I added the references to my scripts and the stylesheet, as well as setting the basic behaviour of the slider control&lt;/P&gt;&lt;PRE class=csharpcode&gt;&lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;link&lt;/SPAN&gt; &lt;SPAN class=attr&gt;type&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="text/css"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;href&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="css/redmond/jquery-ui-1.7.custom.css"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;rel&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="stylesheet"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;    
&lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;script&lt;/SPAN&gt; &lt;SPAN class=attr&gt;type&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="text/javascript"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;src&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="js/jquery-1.3.2.min.js"&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;script&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;BR&gt;&lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;script&lt;/SPAN&gt; &lt;SPAN class=attr&gt;type&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="text/javascript"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;src&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="js/jquery-ui-1.7.custom.min.js"&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;script&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;BR&gt;&lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;script&lt;/SPAN&gt; &lt;SPAN class=attr&gt;type&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="text/javascript"&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;BR&gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE class=csharpcode&gt;$(&lt;SPAN class=kwrd&gt;function&lt;/SPAN&gt;(){
    $(&lt;SPAN class=str&gt;&lt;FONT color=#ff0000&gt;"#content_div"&lt;/FONT&gt;&lt;/SPAN&gt;).css(&lt;SPAN class=str&gt;&lt;FONT color=#ff0000&gt;'font-size'&lt;/FONT&gt;&lt;/SPAN&gt;, 14);
         
    $(&lt;SPAN class=str&gt;&lt;FONT color=#ff0000&gt;'#slider'&lt;/FONT&gt;&lt;/SPAN&gt;).slider({
        range: &lt;SPAN class=str&gt;&lt;FONT color=#ff0000&gt;"min"&lt;/FONT&gt;&lt;/SPAN&gt;,
        min: 1,
        max: 5,
        value: 2,
        slide: &lt;SPAN class=kwrd&gt;function&lt;/SPAN&gt;(&lt;SPAN class=kwrd&gt;event&lt;/SPAN&gt;, ui) {
            $(&lt;SPAN class=str&gt;&lt;FONT color=#ff0000&gt;"#content_div"&lt;/FONT&gt;&lt;/SPAN&gt;).css(&lt;SPAN class=str&gt;&lt;FONT color=#ff0000&gt;'font-size'&lt;/FONT&gt;&lt;/SPAN&gt;, 10 + 2 * ui.value);
        }
    });
});&lt;SPAN class=kwrd&gt;&lt;SPAN class=kwrd&gt;&lt;SPAN class=kwrd&gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE class=csharpcode&gt;&lt;SPAN class=kwrd&gt;&lt;SPAN class=kwrd&gt;&lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;script&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;STYLE type=text/css&gt;.csharpcode {
	FONT-SIZE: small; COLOR: black; FONT-FAMILY: consolas, "Courier New", courier, monospace; BACKGROUND-COLOR: #ffffff
}
.csharpcode PRE {
	FONT-SIZE: small; COLOR: black; FONT-FAMILY: consolas, "Courier New", courier, monospace; BACKGROUND-COLOR: #ffffff
}
.csharpcode PRE {
	MARGIN: 0em
}
.csharpcode .rem {
	COLOR: #008000
}
.csharpcode .kwrd {
	COLOR: #0000ff
}
.csharpcode .str {
	COLOR: #006080
}
.csharpcode .op {
	COLOR: #0000c0
}
.csharpcode .preproc {
	COLOR: #cc6633
}
.csharpcode .asp {
	BACKGROUND-COLOR: #ffff00
}
.csharpcode .html {
	COLOR: #800000
}
.csharpcode .attr {
	COLOR: #ff0000
}
.csharpcode .alt {
	MARGIN: 0em; WIDTH: 100%; BACKGROUND-COLOR: #f4f4f4
}
.csharpcode .lnum {
	COLOR: #606060
}
&lt;/STYLE&gt;

&lt;P&gt;What the above code does is set a starting value to the text size of&amp;nbsp; a specific &lt;FONT face="Courier New" color=#bb5e00&gt;&lt;STRONG&gt;&amp;lt;div&amp;gt;&lt;/STRONG&gt;&lt;/FONT&gt;, named &lt;STRONG&gt;content_div&lt;/STRONG&gt;, making a &lt;FONT face="Courier New" color=#bb5e00&gt;&lt;STRONG&gt;&amp;lt;div&amp;gt;&lt;/STRONG&gt;&lt;/FONT&gt; named &lt;STRONG&gt;slider&lt;/STRONG&gt; into the jQuery UI slider control, as well as setting the slider attributes such as min and max values, start value, direction and an event handler to the slide event. Whenever it sliders, it will set the size of the text inside content_div to the double of the selected value on the slider plus ten. In this case, when it's on position 2, the text size will be 14 pixels, if it's on 3, the text size is going to be 16 pixels and so on.&lt;/P&gt;
&lt;P&gt;Now all I need is to place these &lt;FONT face="Courier New" color=#bb5e00&gt;&lt;STRONG&gt;&amp;lt;div&amp;gt;&lt;/STRONG&gt;&lt;/FONT&gt; elements somewhere in the page body and the sample app is complete. I don't have to worry with stylesheets or anything since the jQuery UI script will apply all styles almost automatically by using the theme roller which I shall talk about in another post.&lt;/P&gt;
&lt;P&gt;This sample shows how to create a web application with some pretty decent user experience with jQuery UI library.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;A class="" title="Download the sample" href="http://weblogs.asp.net/blogs/thiagosantos/jquery1/jquery_ui_sample1.zip" target=_blank mce_href="http://weblogs.asp.net/blogs/thiagosantos/jquery1/jquery_ui_sample1.zip"&gt;Download&lt;/A&gt;&lt;/STRONG&gt; the sample app&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6986896" width="1" height="1"&gt;</content><author><name>tsantos</name><uri>http://weblogs.asp.net/members/tsantos.aspx</uri></author><category term="JavaScript" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/JavaScript/default.aspx" /><category term="UX" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/UX/default.aspx" /><category term="jQuery" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/jQuery/default.aspx" /><category term="jQuery UI" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/jQuery+UI/default.aspx" /></entry><entry><title>ASP.NET AJAX Tips and Tricks with Metro Toronto Users Group</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/thiagosantos/archive/2009/02/05/asp-net-ajax-tips-and-tricks-with-metro-toronto-users-group.aspx" /><id>http://weblogs.asp.net/thiagosantos/archive/2009/02/05/asp-net-ajax-tips-and-tricks-with-metro-toronto-users-group.aspx</id><published>2009-02-05T14:45:00Z</published><updated>2009-02-05T14:45:00Z</updated><content type="html">&lt;P mce_keep="true"&gt;If you are in Toronto or GTA, this next Tuesday, February 10th, &lt;A class="" title="Rob Windsor" href="http://www.objectsharp.com/rwindsor" target=_blank mce_href="http://www.objectsharp.com/rwindsor"&gt;Rob Windsor&lt;/A&gt; from &lt;A class="" title="ObjectSharp Consulting" href="http://www.objectsharp.com/" target=_blank mce_href="http://www.objectsharp.com/"&gt;Object Sharp&lt;/A&gt; will be talking about ASP.NET Ajax in VS 2008 as well as jQuery Intellisense with VS2008. The event will take place at Manulife Financial&amp;nbsp;on Yonge &amp;amp; Bloor at 6:00pm. &lt;/P&gt;
&lt;P mce_keep="true"&gt;You can register &lt;A class="" title="Register to this Event" href="http://www.clicktoattend.com/?id=135348" target=_blank mce_href="http://www.clicktoattend.com/?id=135348"&gt;here&lt;/A&gt;. For more information about this event, check the Metro Toronto Users Group webite, &lt;A class="" title="Metro Toronto .NET Users Group" href="http://www.metrotorontoug.com/Events/Default.aspx" target=_blank mce_href="http://www.metrotorontoug.com/Events/Default.aspx"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P mce_keep="true"&gt;See you there!&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6885326" width="1" height="1"&gt;</content><author><name>tsantos</name><uri>http://weblogs.asp.net/members/tsantos.aspx</uri></author><category term="Community News" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/Community+News/default.aspx" /><category term="AJAX" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/AJAX/default.aspx" /></entry><entry><title>Using Inheritance with Generic Collection</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/thiagosantos/archive/2009/01/28/using-inheritance-with-generic-collection.aspx" /><id>http://weblogs.asp.net/thiagosantos/archive/2009/01/28/using-inheritance-with-generic-collection.aspx</id><published>2009-01-28T23:23:00Z</published><updated>2009-01-28T23:23:00Z</updated><content type="html">&lt;FONT size=3&gt;&lt;SPAN style="FONT-FAMILY: Arial"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;This is just a random tip about Generic Collections. Sometimes it’s common for me to create a class which can be used in a collection. In most cases I use a generic collection of this type as a data source and such things and instead of typing everywhere &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;List&amp;lt;T&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt; and replacing &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;T&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt; with the type I just created; I create a new class which extends from this a generic collection of this type.&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt; &lt;SPAN style="FONT-FAMILY: Arial"&gt;Just a sample:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt; &lt;PRE&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;public&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;Subscriber&lt;/SPAN&gt; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;
&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; FirstName { &lt;SPAN style="COLOR: blue"&gt;get&lt;/SPAN&gt;; &lt;SPAN style="COLOR: blue"&gt;set&lt;/SPAN&gt;; }&lt;/SPAN&gt;
&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; LastName { &lt;SPAN style="COLOR: blue"&gt;get&lt;/SPAN&gt;; &lt;SPAN style="COLOR: blue"&gt;set&lt;/SPAN&gt;; }&lt;/SPAN&gt;
&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; EmailAddress { &lt;SPAN style="COLOR: blue"&gt;get&lt;/SPAN&gt;; &lt;SPAN style="COLOR: blue"&gt;set&lt;/SPAN&gt;; }&lt;/SPAN&gt;
&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; IssueId { &lt;SPAN style="COLOR: blue"&gt;get&lt;/SPAN&gt;; &lt;SPAN style="COLOR: blue"&gt;set&lt;/SPAN&gt;; }&lt;/SPAN&gt;
&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; FullName {&lt;/SPAN&gt;
&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;get&lt;/SPAN&gt; { &lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;.Format(&lt;SPAN style="COLOR: maroon"&gt;"{0} {1}"&lt;/SPAN&gt;, &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.FirstName, &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.LastName); }&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;BR&gt;}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Arial"&gt;Now, every time I need to instantiate a collection of &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;Subscriber&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Arial"&gt; I will have to type something like this:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt; &lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;List&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;&lt;SPAN style="COLOR: teal"&gt;Subscriber&lt;/SPAN&gt;&amp;gt; list = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;List&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: teal"&gt;Subscriber&lt;/SPAN&gt;&amp;gt;();&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN style="FONT-FAMILY: Arial"&gt;The idea here is simple. We can write a code as simple as this:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt; &lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;public&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;Subscribers&lt;/SPAN&gt; : &lt;SPAN style="COLOR: teal"&gt;List&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: teal"&gt;Subscriber&lt;/SPAN&gt;&amp;gt; { }&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN style="FONT-FAMILY: Arial"&gt;And now I can use the following code to create an instance of our collection of &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;Subscriber&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Arial"&gt;: &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Subscribers&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; list = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;Subscribers&lt;/SPAN&gt;();&lt;/SPAN&gt;&lt;/PRE&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;In the end of the day, it’s just the same thing, but the advantage this is that with inheritance and polymorphism you can add other methods to your collection to handle the needs of your custom type.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Of course there are other ways of to do this, however I just wanted to comment about this one, which is the one I use in most "quick" cases.&lt;/SPAN&gt; &lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6867762" width="1" height="1"&gt;</content><author><name>tsantos</name><uri>http://weblogs.asp.net/members/tsantos.aspx</uri></author><category term=".NET" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/.NET/default.aspx" /><category term="Tip" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/Tip/default.aspx" /></entry><entry><title>Tip of the Day #100 at ITTecture</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/thiagosantos/archive/2009/01/23/tip-of-the-day-100-at-ittecture.aspx" /><id>http://weblogs.asp.net/thiagosantos/archive/2009/01/23/tip-of-the-day-100-at-ittecture.aspx</id><published>2009-01-23T20:48:00Z</published><updated>2009-01-23T20:48:00Z</updated><content type="html">&lt;P&gt;I'd like to congratulate my friend, Cirilo Meggiolaro, who posted last night the Tip of the Day #100 on his blog &lt;A class="" title="Cirilo's Blog" href="http://ittecture.wordpress.com/" target=_blank mce_href="http://ittecture.wordpress.com/"&gt;ITTecture&lt;/A&gt;. I'm really glad he achieved this mark and also impressed with such a good source of useful tips his blog has become to me, so I decided mentioning his achievement here. &lt;BR&gt;&lt;BR&gt;His blog is really worth reading. &lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6858746" width="1" height="1"&gt;</content><author><name>tsantos</name><uri>http://weblogs.asp.net/members/tsantos.aspx</uri></author><category term="Tip" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/Tip/default.aspx" /><category term="Link" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/Link/default.aspx" /><category term="Blog" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/Blog/default.aspx" /></entry><entry><title>Mootools talk on Ajax Experience</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/thiagosantos/archive/2009/01/16/aaron-newton-talks-about-mootools-on-ajax-experience.aspx" /><id>http://weblogs.asp.net/thiagosantos/archive/2009/01/16/aaron-newton-talks-about-mootools-on-ajax-experience.aspx</id><published>2009-01-16T17:20:00Z</published><updated>2009-01-16T17:20:00Z</updated><content type="html">&lt;P mce_keep="true"&gt;This is a great&amp;nbsp;video by Aaron Newton from &lt;A class="" href="http://www.clientcide.com/" target=_blank mce_href="http://www.clientcide.com"&gt;clientcide&lt;/A&gt;&amp;nbsp;in which he talks about Mootools. He shows a great overview of a JavaScript Framework. Worth watching.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;EMBED name=flashObj pluginspage=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash src=http://services.brightcove.com/services/viewer/federated_f8/1596744118 width=486 height=412 type=application/x-shockwave-flash swLiveConnect="true" seamlesstabbing="false" base="http://admin.brightcove.com" flashVars="videoId=1832201001&amp;amp;playerId=1596744118&amp;amp;viewerSecureGatewayURL=https://console.brightcove.com/services/amfgateway&amp;amp;servicesURL=http://services.brightcove.com/services&amp;amp;cdnURL=http://admin.brightcove.com&amp;amp;domain=embed&amp;amp;autoStart=false&amp;amp;" bgcolor="#FFFFFF"&gt;&lt;BR&gt;&lt;BR&gt;Here's a link&amp;nbsp;to his blog &lt;A class="" href="http://www.clientcide.com/uncategorized/my-mootools-talk-from-the-ajax-experience-2008/" target=_blank mce_href="http://www.clientcide.com/uncategorized/my-mootools-talk-from-the-ajax-experience-2008/"&gt;post&lt;/A&gt;.&lt;/P&gt;&lt;/EMBED&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6840225" width="1" height="1"&gt;</content><author><name>tsantos</name><uri>http://weblogs.asp.net/members/tsantos.aspx</uri></author><category term="JavaScript" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/JavaScript/default.aspx" /><category term="Mootools" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/Mootools/default.aspx" /><category term="AJAX" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/AJAX/default.aspx" /><category term="Video" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/Video/default.aspx" /></entry><entry><title>Adding a Guid Parameter into SqlCommand</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/thiagosantos/archive/2009/01/13/adding-a-guid-parameter-into-sqlcommand.aspx" /><id>http://weblogs.asp.net/thiagosantos/archive/2009/01/13/adding-a-guid-parameter-into-sqlcommand.aspx</id><published>2009-01-13T17:01:00Z</published><updated>2009-01-13T17:01:00Z</updated><content type="html">&lt;P mce_keep="true"&gt;This is just a random Tip. &lt;BR&gt;&lt;BR&gt;It seems like recently&amp;nbsp;some people I know started&amp;nbsp;to have&amp;nbsp;problems&amp;nbsp;passing a Guid&amp;nbsp;objects as a parameter of a&amp;nbsp;SqlCommand object. I already had this problem so I decided to post about it in case someone&amp;nbsp;else is&amp;nbsp;trying the same thing.&amp;nbsp;Apparently it doesn't work if you pass the Guid directly as shown below:&lt;BR&gt;&lt;BR&gt;Guid theGuid = new Guid();&lt;BR&gt;SqlCommand command = new SqlCommand("select * from&amp;nbsp;someTable where&amp;nbsp;SomeField = @GuidParameter", someConnection);&lt;BR&gt;command.Parameters.Add("@GuidParameter", SqlDbType.UniqueIdentifier).Value = theGuid;&lt;BR&gt;&lt;BR&gt;When the Guid object is passed directly, it's not parsed and Sql Server cannot handle it. The correct way to pass a Guid object as a SqlParameter would be slightly different:&lt;BR&gt;&lt;BR&gt;Guid theGuid = new Guid();&lt;BR&gt;SqlCommand command = new SqlCommand("select * from someTable where SomeField = @GuidParameter", connection);&lt;BR&gt;command.Parameters.Add("@GuidParameter", SqlDbType.UniqueIdentifier).Value = System.Data.SqlTypes.SqlGuid.Parse(theGuid.ToString());&lt;BR&gt;&lt;BR&gt;Note that now, when passing the value, I'm converting the Guid to a string value and using SqlTypes.SqlGuid.Parse to perform the actual parse. The method parse returns a SqlGuid object, which is the right match for SqlDbType.UniqueIdentifier.&lt;/P&gt;
&lt;P mce_keep="true"&gt;The alternative to Parse, would be creating a new instance of SqlGuid and pass this instance to the Value property of the SqlParameter, but then you would create one more object to do the exact same thing. In this case it would be something like this: &lt;/P&gt;
&lt;P mce_keep="true"&gt;Guid theGuid = new Guid();&lt;BR&gt;System.Data.SqlTypes.SqlGuid theSqlGuid = new System.Data.SqlTypes.SqlGuid(theGuid);&lt;BR&gt;SqlCommand command = new SqlCommand("select * from someTable where SomeField = @GuidParameter", connection);&lt;BR&gt;command.Parameters.Add("@GuidParameter", SqlDbType.UniqueIdentifier).Value = theSqlGuid;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Well, that's it. I hope it helps someone out there. Cheers.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6834116" width="1" height="1"&gt;</content><author><name>tsantos</name><uri>http://weblogs.asp.net/members/tsantos.aspx</uri></author><category term="C#" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/C_2300_/default.aspx" /><category term="SQL Server" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/SQL+Server/default.aspx" /><category term="Tip" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/Tip/default.aspx" /></entry><entry><title>ASP.NET MVC with Mootools</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/thiagosantos/archive/2009/01/05/mootools-with-asp-net-mvc.aspx" /><id>http://weblogs.asp.net/thiagosantos/archive/2009/01/05/mootools-with-asp-net-mvc.aspx</id><published>2009-01-05T16:02:00Z</published><updated>2009-01-05T16:02:00Z</updated><content type="html">&lt;P mce_keep="true"&gt;I've been playing around with ASP.NET MVC for some time now and I'd say I'm in love with it. I've seen several blogs posts here and there about it as well. One of the many things which I got really amazed about was the fact that you can use JSON as your return action on the controller.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG title="Sample app" style="WIDTH: 542px; HEIGHT: 376px" height=376 alt="Sample app" src="http://weblogs.asp.net/blogs/thiagosantos/moomvc.app.PNG" width=542 mce_src="http://weblogs.asp.net/blogs/thiagosantos/moomvc.app.PNG"&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;I’ve seen Steve Michelotti’s &lt;A class="" title="ASP.NET MVC with jQuery" href="http://geekswithblogs.net/michelotti/archive/2008/06/28/mvc-json---jsonresult-and-jquery.aspx" target=_blank mce_href="http://geekswithblogs.net/michelotti/archive/2008/06/28/mvc-json---jsonresult-and-jquery.aspx"&gt;blog post&lt;/A&gt; about using jQuery to populate an html combo using JsonResult provided by MVC, and as I already said on this blog, I like Mootools JavaScript framework and I use it when I can. Then, just as a small sample, I’ll replicate what Steve did in his post, but I’ll replace jQuery by Mootools.&lt;/P&gt;
&lt;P mce_keep="true"&gt;So, the first step is to download Mootools framework. Just point your brower to &lt;A class="" title="Download Mootools" href="http://www.mootools.net/download" target=_blank mce_href="http://www.mootools.net/download"&gt;http://www.mootools.net/download&lt;/A&gt; and get the latest version. The "Moo Team" provides the framework in 2 compression types and also uncompressed. Download the one which is best for your needs. My suggestion would be to donwload the uncompressed and use it on debug/development time, and in production use one of the compressed types.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Now the idea of this sample is to use Mootools' Request.JSON class to assyncronously retrieve a JSON object from the server side application, which in this case will be a JsonResult in an MVC Controller. For those who are not familiar with MVC Controllers, the idea is to respond to a browser request. The response will be an action perfomed on server side. The action can be a ViewResult (displays a web page), EmptyResult (would be something as void method), RedirectResult, RedirectToRouteResult, JsonResult (Returns a JSON object) and ContentResult (returns, pretty much a text). I'm not going to details here about MVC, since there is already a lot of information available in so many places. I’m going to cover JsonResult on this post, and to get started, open Visual Studio and create a new ASP.NET MVC application by clicking File &amp;gt; New &amp;gt; Project. Then Select Web &amp;gt; ASP.NET MVC Web Application, name it what ever you want. For the sample I named it MvcMootools.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG title="Create Project" style="WIDTH: 683px; HEIGHT: 490px" height=490 alt="Create Project" src="http://weblogs.asp.net/blogs/thiagosantos/moomvc.create.PNG" width=683 mce_src="http://weblogs.asp.net/blogs/thiagosantos/moomvc.create.PNG"&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;For this sample, I have removed all default scripts from the scripts folder, as well as the login feature (that means, the AccountController, AccountView, and the code which renders the LoginControl) from the project since we won't need login for this sample. Then I added Mootools framework, both the core and more. I have also created my own Master Page and my own CSS file and removed the existing ones. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG title="Solution Explorer" style="WIDTH: 254px; HEIGHT: 544px" height=544 alt="Solution Explorer" src="http://weblogs.asp.net/blogs/thiagosantos/moomvc.solution.PNG" width=254 mce_src="http://weblogs.asp.net/blogs/thiagosantos/moomvc.solution.PNG"&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;What should this app do?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;1)&amp;nbsp;Get a list of Canadian provinces from a specified data source (xml) &lt;BR&gt;2)&amp;nbsp;Display the list of provinces in a html combo box&lt;BR&gt;3)&amp;nbsp;Get information of a specific province and display it in a panel&lt;BR&gt;4)&amp;nbsp;Do some sliding when displaying the panels&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Model&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;I have created the model classes, which would be the definition of the province as a business object and the reader, which is going to retrieve data from our data source and populate the province object. I have created an Xml file which lists provinces from Canada and some (probably outdated) information about them. The province object attributes are: Code, Name, Population, Flag, Motto, Capital, Largest City and Language.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Controller&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;I have created my own HomeController which has 3 actions: Display the default view, retrieve the list of provinces in Json format and retrieve one single province in Json format.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;View&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;I’ve created the view folder accordingly to the controller, and created the file Index.aspx to match with our default action in the Home controller, and then I added the JavaScript reference to it.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;The Scripts&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;The JavaScript is really simple. All you have to do is populate the ComboBox and add the event handler for the ‘change’ event. So, what does happen here is that when the page loads, it will send a request to the server (/Home.GetProvinces) through Mootools’ Request.JSON class and populate the combo. And when a Province is selected, it sends another request to the server, but this time it passes the province code on the request. So if you select Ontario, it will send the request to the following Url: “/Home/GetProviceInfo/ON”.&lt;/P&gt;
&lt;P mce_keep="true"&gt;// Using Mootools to add the 'load' and 'error' event handlers &lt;BR&gt;// to the window/page&lt;BR&gt;window.addEvents({&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'load': function() {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // initializing comboBox and the path for the controllers&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProvinceSource = "/Home/GetProvinces";&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProvinceInfoSource = "/Home/GetProvinceInfo/{province}";&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProvinceCombo = $("cboProvinces");&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FillProvincesCombo();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // adds the event handler for 'change' event to the combo box&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProvinceCombo.addEvent("change", function() {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(EMPTY != this.options[this.selectedIndex].value) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var ProvinceInfoURL = ProvinceInfoSource.replace("{province}",&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.options[this.selectedIndex].value);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var jsonThing = new Request.JSON({&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url: ProvinceInfoURL,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; onComplete: function(province) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; showResponse(province);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jsonThing.send();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $("response_div").innerHTML = EMPTY;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'error': function() {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert('An error occured. Check your browser details.');&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;});&lt;/P&gt;
&lt;P mce_keep="true"&gt;// Fills the comboBox of the Provinces&lt;BR&gt;var FillProvincesCombo = function() {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var option = new Option("Please Select", EMPTY);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProvinceCombo.options.length = 0; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // firefox doesn't like "ProvinceCombo.add(option);"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProvinceCombo.options[0] = option;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var jsonRequest = new Request.JSON({&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url: ProvinceSource,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; onComplete: function(provinces) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // so I had to create this counter&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var c = 1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; provinces.each(function(province) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var option = new Option(province.Name, province.Code);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // and add each option to a specific index&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProvinceCombo.options[c] = option; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // and, of course, increse the value of the index &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c++;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; jsonRequest.send();&lt;BR&gt;}&lt;/P&gt;
&lt;P mce_keep="true"&gt;I have also created a function to display the information of a selected province with an animation.&lt;/P&gt;
&lt;P mce_keep="true"&gt;// does the div transition and displays the information&lt;BR&gt;var showResponse = function(json) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var responseDiv = $("response_div");&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var slideHandler = new Fx.Slide('response_div', {&lt;BR&gt;&amp;nbsp;mode: 'horizontal', duration: 300&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(EMPTY != ProvinceCombo.options[ProvinceCombo.selectedIndex].value) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; slideHandler.slideOut();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; setTimeout(function() {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; slideHandler.slideIn();&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; responseDiv.innerHTML = EMPTY;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; responseDiv.innerHTML = div_template&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .replace(/{code}/g, json.Code)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .replace(/{name}/g, json.Name)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .replace(/{largest}/g, json.LargestCity)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .replace(/{population}/g, json.Population)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .replace(/{motto}/g, json.Motto)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .replace(/{language}/g, json.Language)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .replace(/{capital}/g, json.Capital)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .replace(/{flag}/g, json.Flag);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }, 300);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; responseDiv.fade(1);&lt;BR&gt;}&lt;/P&gt;
&lt;P mce_keep="true"&gt;And that’s pretty much it. I strongly suggest you to download the sample application and take a look on the code.&lt;BR&gt;&lt;STRONG&gt;&lt;A class="" title="Download Project" href="http://weblogs.asp.net/blogs/thiagosantos/MvcMootools.zip" target=_blank mce_href="http://weblogs.asp.net/blogs/thiagosantos/MvcMootools.zip"&gt;Download Project&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6820512" width="1" height="1"&gt;</content><author><name>tsantos</name><uri>http://weblogs.asp.net/members/tsantos.aspx</uri></author><category term="JSON" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/JSON/default.aspx" /><category term="JavaScript" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/JavaScript/default.aspx" /><category term="Mootools" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/Mootools/default.aspx" /><category term="AJAX" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/AJAX/default.aspx" /><category term="ASP.NET MVC" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/ASP.NET+MVC/default.aspx" /></entry><entry><title>Screencast: Test Driven Development with VS 2010</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/thiagosantos/archive/2008/12/18/screencast-test-driven-development-with-vs-2010.aspx" /><id>http://weblogs.asp.net/thiagosantos/archive/2008/12/18/screencast-test-driven-development-with-vs-2010.aspx</id><published>2008-12-18T20:20:00Z</published><updated>2008-12-18T20:20:00Z</updated><content type="html">&lt;P mce_keep="true"&gt;Here's an excelent video about improvements in Visual Studio regarding TDD. It also shows how MVC is TDD focused. Worth to be watched:&lt;BR&gt;&lt;BR&gt;&lt;A href="http://channel9.msdn.com/posts/VisualStudio/Test-Driven-Development-with-Visual-Studio-2010/" mce_href="http://channel9.msdn.com/posts/VisualStudio/Test-Driven-Development-with-Visual-Studio-2010/"&gt;http://channel9.msdn.com/posts/VisualStudio/Test-Driven-Development-with-Visual-Studio-2010/&lt;/A&gt;&lt;BR&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Cheers.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6795512" width="1" height="1"&gt;</content><author><name>tsantos</name><uri>http://weblogs.asp.net/members/tsantos.aspx</uri></author><category term="Visual Studio" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/Visual+Studio/default.aspx" /><category term="ASP.NET MVC" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/ASP.NET+MVC/default.aspx" /><category term="TDD" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/TDD/default.aspx" /></entry><entry><title>Event in Toronto about Entity Framework</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/thiagosantos/archive/2008/12/01/event-in-toronto-about-entity-framework.aspx" /><id>http://weblogs.asp.net/thiagosantos/archive/2008/12/01/event-in-toronto-about-entity-framework.aspx</id><published>2008-12-02T00:08:00Z</published><updated>2008-12-02T00:08:00Z</updated><content type="html">&lt;P mce_keep="true"&gt;Barry Gervin from ObjectSharp will be speaking about Entity Framework at&amp;nbsp;Palmerston Library Theatre next Tuesday, December 9.&lt;BR&gt;Here's the &lt;A class="" title=Map href="http://maps.live.com/default.aspx?v=2&amp;amp;FORM=LMLTCP&amp;amp;cp=43.665518~-79.412645&amp;amp;style=h&amp;amp;lvl=19&amp;amp;tilt=-90&amp;amp;dir=0&amp;amp;alt=-1000&amp;amp;phx=0&amp;amp;phy=0&amp;amp;phscl=1&amp;amp;encType=1&amp;amp;cid=2F659A5B930298D!411" target=_blank mce_href="http://maps.live.com/default.aspx?v=2&amp;amp;FORM=LMLTCP&amp;amp;cp=43.665518~-79.412645&amp;amp;style=h&amp;amp;lvl=19&amp;amp;tilt=-90&amp;amp;dir=0&amp;amp;alt=-1000&amp;amp;phx=0&amp;amp;phy=0&amp;amp;phscl=1&amp;amp;encType=1&amp;amp;cid=2F659A5B930298D!411"&gt;map&lt;/A&gt; to the location. Check Metro Toronto Users' Group &lt;A class="" title="Metro Toronto" href="http://www.metrotorontoug.com/Events/Default.aspx" target=_blank mce_href="http://www.metrotorontoug.com/Events/Default.aspx"&gt;website&lt;/A&gt; for more details.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Here's the &lt;A class="" title=Register href="http://www.clicktoattend.com/?id=133740" target=_blank mce_href="http://www.clicktoattend.com/?id=133740"&gt;registration&lt;/A&gt; website.&lt;/P&gt;
&lt;P mce_keep="true"&gt;See you guys there.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6762181" width="1" height="1"&gt;</content><author><name>tsantos</name><uri>http://weblogs.asp.net/members/tsantos.aspx</uri></author><category term="Community News" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/Community+News/default.aspx" /></entry><entry><title>Consuming WebServices in JavaScript with Mootools</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/thiagosantos/archive/2008/11/18/consuming-webservices-in-javascript-with-mootools.aspx" /><id>http://weblogs.asp.net/thiagosantos/archive/2008/11/18/consuming-webservices-in-javascript-with-mootools.aspx</id><published>2008-11-18T22:44:00Z</published><updated>2008-11-18T22:44:00Z</updated><content type="html">&lt;P&gt;As we all know, Visual Studio will have jQuery support for now on, which is a great thing. I use jQuery heavily at work when customizing CRM and also to develop other projects. However, I really enjoy Mootools, which is another great JavaScript framework. Long ago I've seen a post somewhere about calling ASP.NET Web Services. Back then, Mootools was on version 1.1 and now it's 1.2.&amp;nbsp;A few things changed here and there since the last update. Now the core is completely separated from the UI/Animation/Extra features. As I really like this framework, I decided to create a sample project showing how it works on the current version. And how simple it is.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Creating the SOAP Envelope&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Basically, to call a Web Service in ASP.NET, we have to create a header with a SOAP envelope and other attributes. Usually, .NET handles it for us. But for this post, I’d like to show how to perform the requests without .NET help. &lt;BR&gt;&lt;BR&gt;A SOAP Envelope, is an xml with the necessary parameters to a request, as well as&amp;nbsp;the method's name and it's namespace. Let's say we have&amp;nbsp;a Web Service with a method called GetBooks which receives two string parameters. We could create something like this: &lt;/P&gt;
&lt;P&gt;GetSOAPEnvelope : function(WebMethod, Namespace, paramHash) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var envelope = '';&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; envelope += '&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;\n';&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; envelope += '&amp;lt;soap:Envelope xmlns:xsi="&lt;A href="http://www.w3.org/2001/XMLSchema-instance" mce_href="http://www.w3.org/2001/XMLSchema-instance"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/A&gt;" xmlns:xsd="&lt;A href="http://www.w3.org/2001/XMLSchema" mce_href="http://www.w3.org/2001/XMLSchema"&gt;http://www.w3.org/2001/XMLSchema&lt;/A&gt;" xmlns:soap="&lt;A href="http://schemas.xmlsoap.org/soap/envelope/%22%3E/n'" mce_href="http://schemas.xmlsoap.org/soap/envelope/%22%3E/n'"&gt;http://schemas.xmlsoap.org/soap/envelope/"&amp;gt;\n'&lt;/A&gt;;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; envelope += ' &amp;lt;soap:Body&amp;gt;\n';&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(paramHash.getKeys().length &amp;gt; 0) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; envelope += ' &amp;lt;' + WebMethod + ' xmlns="' + Namespace + '"&amp;gt;\n';&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; paramHash.each(function(value, key){&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; envelope += '&amp;nbsp;&amp;nbsp; &amp;lt;' + key + '&amp;gt;' + value + '&amp;lt;/' + key + '&amp;gt;\n';&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; envelope += ' &amp;lt;/' + WebMethod + '&amp;gt;\n';&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; envelope += ' &amp;lt;' + WebMethod + ' xmlns="' + Namespace + '" /&amp;gt;\n'; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; envelope += ' &amp;lt;/soap:Body&amp;gt;\n';&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; envelope += '&amp;lt;/soap:Envelope&amp;gt;';&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return envelope;&lt;BR&gt;}&lt;BR&gt;&lt;BR&gt;The method above returns us a string with our Envelope. Something like this:&lt;BR&gt;&lt;BR&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;BR&gt;&amp;lt;soap:Envelope xmlns:xsi="&lt;A href="http://www.w3.org/2001/XMLSchema-instance" mce_href="http://www.w3.org/2001/XMLSchema-instance"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/A&gt;" xmlns:xsd="&lt;A href="http://www.w3.org/2001/XMLSchema" mce_href="http://www.w3.org/2001/XMLSchema"&gt;http://www.w3.org/2001/XMLSchema&lt;/A&gt;" xmlns:soap="&lt;A href="http://schemas.xmlsoap.org/soap/envelope/" mce_href="http://schemas.xmlsoap.org/soap/envelope/"&gt;http://schemas.xmlsoap.org/soap/envelope/&lt;/A&gt;"&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;soap:Body&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;GetBooks xmlns="&lt;A href="http://coolest.namespace.ever/" mce_href="http://coolest.namespace.ever/"&gt;http://coolest.namespace.ever/&lt;/A&gt;"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;criteria&amp;gt;string&amp;lt;/criteria&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;keyword&amp;gt;string&amp;lt;/keyword&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/GetBooks&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;/soap:Body&amp;gt;&lt;BR&gt;&amp;lt;/soap:Envelope&amp;gt;&lt;/P&gt;
&lt;P&gt;Note that on the GetSOAPEnvelope signature, we're passing paramHash, which is Mootools' implementation to&amp;nbsp;hash. So before we call the method we should create a hash like this:&lt;BR&gt;&lt;BR&gt;var criteria = "genre"; var keyword="fantasy";&lt;BR&gt;var params&amp;nbsp;= new Hash({criteria:criteria, keyword:keyword});&lt;/P&gt;
&lt;P&gt;And finally call the GetSOAPEnvelope Method:&lt;BR&gt;&lt;BR&gt;var theEnvelope = GetSOAPEnvelope('GetBooks', 'http://coolest.namespace.ever/', params);&lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;&lt;U&gt;Calling the Web Service&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;On Mootools 1.2, we have a Request object (&lt;A class="" title=Docs href="http://www.mootools.net/docs/Request/Request" target=_blank mce_href="http://www.mootools.net/docs/Request/Request"&gt;docs&lt;/A&gt;) which allows us to perform asynchronous calls. To perform a call to a Web Service, we need an instance of this object and we need to inform the service url, the method, the header and the soap envelope. Also, we need to inform what to do in case of sucess or failure. Something like this: &lt;BR&gt;&lt;BR&gt;var ajax = new Request({&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; url: webservice_address, &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; data: theEnvelope,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; method: 'post', &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; headers: {&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Content-Type': 'text/xml; charset="utf-8"', &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'SOAPAction': 'http://coolest.namespace.ever/GetBooks'&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; onComplete: function(responseXML) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // some action&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }, &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; onFailure: function(instance) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // some action&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;});&lt;BR&gt;// then we execute&lt;BR&gt;ajax.send();&lt;BR&gt;&lt;BR&gt;There are more things you should take care of to put an application running with Web Serice calls from JavaScript. I'm not going to details on this post, but you should take care of security for sure. Please take a look on the sample which has a simple application for reference&amp;nbsp;(hopefully it will work).&lt;BR&gt;&lt;BR&gt;Please visit &lt;A class="" title="Web Site" href="http://www.mootools.net/" target=_blank mce_href="http://www.mootools.net"&gt;Mootools WebSite&lt;/A&gt;, &lt;A class="" title="User Group" href="http://groups.google.com/group/mootools-users" target=_blank mce_href="http://groups.google.com/group/mootools-users"&gt;User Group&lt;/A&gt; or the &lt;A class="" href="http://www.mooforum.net/" target=_blank mce_href="http://www.mooforum.net/"&gt;Forum&lt;/A&gt; to get more resources. You can do amazing things with this framework.&lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;&lt;A class="" title="Sample Project" href="http://weblogs.asp.net/blogs/thiagosantos/MootoolsSample.zip" target=_blank mce_href="http://weblogs.asp.net/blogs/thiagosantos/MootoolsSample.zip"&gt;Here's a Sample Project&lt;/A&gt;&lt;/STRONG&gt;&lt;BR&gt;(don't forget to change the web service address)&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6745642" width="1" height="1"&gt;</content><author><name>tsantos</name><uri>http://weblogs.asp.net/members/tsantos.aspx</uri></author><category term=".NET" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/.NET/default.aspx" /><category term="JSON" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/JSON/default.aspx" /><category term="JavaScript" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/JavaScript/default.aspx" /><category term="Mootools" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/Mootools/default.aspx" /><category term="Web Services" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/Web+Services/default.aspx" /><category term="AJAX" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/AJAX/default.aspx" /></entry><entry><title>Event in Toronto: 5 Practical Tips for Creating Great User Experience (UX)</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/thiagosantos/archive/2008/11/18/event-in-toronto-5-practical-tips-for-creating-great-user-experience-ux.aspx" /><id>http://weblogs.asp.net/thiagosantos/archive/2008/11/18/event-in-toronto-5-practical-tips-for-creating-great-user-experience-ux.aspx</id><published>2008-11-18T04:34:00Z</published><updated>2008-11-18T04:34:00Z</updated><content type="html">&lt;P mce_keep="true"&gt;Qixing Zheng (from &lt;A href="http://blogs.msdn.com/canux/default.aspx"&gt;http://blogs.msdn.com/canux/default.aspx&lt;/A&gt;)&amp;nbsp;will be speaking about User Experience on Metro Toronto .NET User Group meeting this wednesday evening (Nov 19th). Here's the link to &lt;A class="" title=Register href="http://www.clicktoattend.com/invitation.aspx?code=133084" target=_blank mce_href="http://www.clicktoattend.com/invitation.aspx?code=133084"&gt;Register&lt;/A&gt;&amp;nbsp;to the event. It will take place at the Palmerston Library Theatre (close to TTC Bathurst). Here's the &lt;A class="" title=Map href="http://maps.live.com/default.aspx?v=2&amp;amp;FORM=LMLTCP&amp;amp;cp=43.665518~-79.412645&amp;amp;style=h&amp;amp;lvl=19&amp;amp;tilt=-90&amp;amp;dir=0&amp;amp;alt=-1000&amp;amp;phx=0&amp;amp;phy=0&amp;amp;phscl=1&amp;amp;encType=1&amp;amp;cid=2F659A5B930298D!411" target=_blank mce_href="http://maps.live.com/default.aspx?v=2&amp;amp;FORM=LMLTCP&amp;amp;cp=43.665518~-79.412645&amp;amp;style=h&amp;amp;lvl=19&amp;amp;tilt=-90&amp;amp;dir=0&amp;amp;alt=-1000&amp;amp;phx=0&amp;amp;phy=0&amp;amp;phscl=1&amp;amp;encType=1&amp;amp;cid=2F659A5B930298D!411"&gt;map&lt;/A&gt;.&lt;/P&gt;
&lt;P mce_keep="true"&gt;See you guys there.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6744863" width="1" height="1"&gt;</content><author><name>tsantos</name><uri>http://weblogs.asp.net/members/tsantos.aspx</uri></author><category term="Community News" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/Community+News/default.aspx" /><category term="UX" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/UX/default.aspx" /></entry><entry><title>Get JSON from SQL Server</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/thiagosantos/archive/2008/11/17/get-json-from-sql-server.aspx" /><id>http://weblogs.asp.net/thiagosantos/archive/2008/11/17/get-json-from-sql-server.aspx</id><published>2008-11-17T17:01:00Z</published><updated>2008-11-17T17:01:00Z</updated><content type="html">&lt;P mce_keep="true"&gt;On Thomas Frank's blog there is an interesting post which shows how to get &lt;A class="" href="http://www.thomasfrank.se/mysql_to_json.html" target=_blank mce_href="http://www.thomasfrank.se/mysql_to_json.html"&gt;JSON from MySql&lt;/A&gt;, and I though about doing the same to SQL Server since I use it more than any other database lately. So what I did was create a stored procedure which uses cursor to format the string with our data. I'm not really good with SQL, so I managed to use two, and the procedure itself isn't really what you would call a masterpiece. Sorry about that. But what I want to show here is just a concept tho.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;A class="" title="Create Procedure" href="http://weblogs.asp.net/blogs/thiagosantos/GetJSON.txt" target=_blank mce_href="http://weblogs.asp.net/blogs/thiagosantos/GetJSON.txt"&gt;&lt;STRONG&gt;Here's the Procedure&lt;/STRONG&gt;&lt;/A&gt;&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;When I execute it like this:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;exec getJson 'announcement', 4&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;I'll get a single column named 'json' with *all* my data, in this case, 4 registries from a table named announcement. Something similar to this:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;[{'Id':'1','Title':'&amp;lt;h3&amp;gt;1. Lorem ipsum dolor sit a','Date':'Jun 16 2008&amp;nbsp; 5:44PM','Text':'&amp;lt;p&amp;gt;Lorem ipsum dolor sit amet,'},{'Id':'2','Title':'&amp;lt;h3&amp;gt;2. Quisque aliquet accumsa','Date':'Jun 16 2008&amp;nbsp; 5:44PM','Text':'&amp;lt;p&amp;gt;Lorem ipsum dolor sit amet,'},{'Id':'3','Title':'&amp;lt;h3&amp;gt;3. Duis consequat laoreet&amp;lt;','Date':'Jun 16 2008&amp;nbsp; 5:44PM','Text':'&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;Duis consequat laoreet'},{'Id':'4','Title':'&amp;lt;h3&amp;gt;4. Aenean consectetuer&amp;lt;/h3','Date':'Jun 16 2008&amp;nbsp; 5:44PM','Text':'&amp;lt;p&amp;gt;Quisque aliquet accumsan le'}]&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Then if you're using one JavaScript widget to slide news/announcements, it might be useful. Just pass this returning text to the eval method and you have a fresh json object, ready to use.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;NOTE:&lt;/STRONG&gt; it shouldn't be used with large amounts of data since you're populating a varchar sql variable, and it&amp;nbsp;has a limit. If you try to pass more data than it can handle, you'll get errors.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6744003" width="1" height="1"&gt;</content><author><name>tsantos</name><uri>http://weblogs.asp.net/members/tsantos.aspx</uri></author><category term="JSON" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/JSON/default.aspx" /><category term="SQL Server" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/SQL+Server/default.aspx" /></entry><entry><title>Dumping Properties of an Object</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/thiagosantos/archive/2008/11/17/dumping-properties-of-an-object.aspx" /><id>http://weblogs.asp.net/thiagosantos/archive/2008/11/17/dumping-properties-of-an-object.aspx</id><published>2008-11-17T15:22:00Z</published><updated>2008-11-17T15:22:00Z</updated><content type="html">&lt;P mce_keep="true"&gt;Sometimes I see myself in weird situations, having to debug applications in test environments, but for some reason I'm not able to use Visual Studio. Not going to specific details about my environments&amp;nbsp;here. However, it's possible that someone out there have a similar issue. For these cases, I use Reflection to dump the contents of my objects into a string and save it in a text file to analyze later. &lt;/P&gt;
&lt;P mce_keep="true"&gt;This is the "Dump" method:&lt;BR&gt;&lt;BR&gt;public static string Dump(Object obj) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; string dump = string.Empty;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; try {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dictionary&amp;lt;string, string&amp;gt; dictionary = &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new Dictionary&amp;lt;string, string&amp;gt;();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Type type = obj.GetType();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Reflection.PropertyInfo[] propInfo = type.GetProperties();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i = 0; i &amp;lt; propInfo.Length; i++) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Reflection.PropertyInfo pi = (System.Reflection.PropertyInfo)propInfo.GetValue(i);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dictionary.Add(pi.Name,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (null == pi.GetValue(obj, new object[] { })) ?&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "null" : pi.GetValue(obj, new object[] { }).ToString());&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (System.Collections.Generic.KeyValuePair&amp;lt;string, string&amp;gt; pair in dictionary) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dump += string.Format("{0}\t{1}\n", pair.Key, pair.Value);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; catch (Exception ex) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // use a proper log instead of a text file..&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.IO.File.AppendAllText(@"C:\myapplicationname.dump.exception.txt",&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "--------------------------------------\n"+&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Exception:\n\tSource: " + ex.Source +&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "\n\tMessage: \n" + ex.Message +&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "\n\tStack: \n" + ex.StackTrace + &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "\n------------------------------------"); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return dump;&lt;BR&gt;}&lt;BR&gt;&amp;nbsp;&lt;BR&gt;Sometimes I use this technique to debug CRM Plug-ins. I hope it's useful for you guys.&lt;BR&gt;Here's a &lt;A class="" title=Sample href="http://weblogs.asp.net/blogs/thiagosantos/DumpSample.zip" target=_blank mce_href="http://weblogs.asp.net/blogs/thiagosantos/DumpSample.zip"&gt;&lt;STRONG&gt;Sample Console Project&lt;/STRONG&gt;&lt;/A&gt; using the Dump method.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6743907" width="1" height="1"&gt;</content><author><name>tsantos</name><uri>http://weblogs.asp.net/members/tsantos.aspx</uri></author><category term="Debug" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/Debug/default.aspx" /><category term="C#" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/C_2300_/default.aspx" /><category term=".NET" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/.NET/default.aspx" /></entry><entry><title>Restoring Visual Studio Settings</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/thiagosantos/archive/2008/11/05/restoring-visual-studio-settings.aspx" /><id>http://weblogs.asp.net/thiagosantos/archive/2008/11/05/restoring-visual-studio-settings.aspx</id><published>2008-11-05T14:33:00Z</published><updated>2008-11-05T14:33:00Z</updated><content type="html">&lt;P mce_keep="true"&gt;What to do when Visual Studio starts behaving weird? Sometimes it happens that Visual Studio stop displaying the Toolbox, Server Explorer or even the &lt;A class="" href="http://weblogs.asp.net/blogs/thiagosantos/p1.3_sample_error_screen.PNG" mce_href="http://weblogs.asp.net/blogs/thiagosantos/p1.3_sample_error_screen.PNG"&gt;&lt;STRONG&gt;Properties&lt;/STRONG&gt;&lt;/A&gt;, it's not really common but still happens quite a lot, specially if you're running Windows Vista. The quick answer to that is to restore Visual Studio Settings. Crashing might not be the only reason to restore. Maybe you just didn't configure it properly and want to go back to the original settings. Here's how you work with Visual Studio Settings. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;&lt;U&gt;Restore Default Settings&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;To restore Visual Studio defalt settings:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Click on Start menu;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;All Programs;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Visual Studio 2005 (or 2008);&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Visual Studio Tools&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Visual Studio 2005 (or 2008) command prompt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;The &lt;A class="" href="http://weblogs.asp.net/blogs/thiagosantos/p1.1_vs_cmd_prompt.PNG" mce_href="http://weblogs.asp.net/blogs/thiagosantos/p1.1_vs_cmd_prompt.PNG"&gt;&lt;STRONG&gt;Picture 1&lt;/STRONG&gt;&lt;/A&gt;&amp;nbsp;shows the path.&lt;/P&gt;
&lt;P mce_keep="true"&gt;It will open the command prompt, and all you have to do is type:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;&amp;gt;devenv /ResetSettings&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;It will Restore the IDE's default settings. The next time you open Visual Studio, it will behave just like a fresh installation, which means all your configs are gone. The ones you wanted to remove and the ones you wanted to keep. You'll have to&amp;nbsp;edit your IDE again to make it look like what it was before you reseted the settigns. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;&lt;U&gt;Saving Your Custom Settings&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;To save your custom settings, click on &lt;STRONG&gt;Tools&lt;/STRONG&gt;&amp;nbsp;&amp;gt; &lt;STRONG&gt;Options&lt;/STRONG&gt;; on the tree view, select "&lt;STRONG&gt;Environment Options&lt;/STRONG&gt;" and click on the node "&lt;STRONG&gt;Import and Export Settings&lt;/STRONG&gt;" as shown on the &lt;A class="" href="http://weblogs.asp.net/blogs/thiagosantos/p1.2_save_conf.PNG" mce_href="http://weblogs.asp.net/blogs/thiagosantos/p1.2_save_conf.PNG"&gt;&lt;STRONG&gt;Pircure 2&lt;/STRONG&gt;&lt;/A&gt;. There you can see where the settings for Visual Studio are being saved. You can change the path, so it saves somewhere else. Alternatively&amp;nbsp;or go directly to the path and create a copy of the file, then paste it somewhere else. This way you'll have a separate copy of your custom settings.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;&lt;U&gt;Loading Saved Settings&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Once you have your settings saved, you can restore it to&amp;nbsp;any Visual Studio. To do so,&amp;nbsp;run the same command you did to reset the settings, but this time passing the path to your saved settings file:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;&amp;gt;Devenv /ResetSettings "C:\MyFolder\MySettings.settings"&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;This command will open a new instance of Visual Studio with the settings stored on the given file.&lt;/P&gt;
&lt;P mce_keep="true"&gt;"The End"&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6721688" width="1" height="1"&gt;</content><author><name>tsantos</name><uri>http://weblogs.asp.net/members/tsantos.aspx</uri></author><category term="Visual Studio" scheme="http://weblogs.asp.net/thiagosantos/archive/tags/Visual+Studio/default.aspx" /></entry></feed>