<?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">Tony Lombardo</title><subtitle type="html" /><id>http://weblogs.asp.net/tonylombardo/atom.aspx</id><link rel="alternate" type="text/html" href="http://weblogs.asp.net/tonylombardo/default.aspx" /><link rel="self" type="application/atom+xml" href="http://weblogs.asp.net/tonylombardo/atom.aspx" /><generator uri="http://communityserver.org" version="3.0.20510.895">Community Server</generator><updated>2009-03-11T16:19:02Z</updated><entry><title>Hacking Web Services; Security and Telnet</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/tonylombardo/archive/2009/10/29/hacking-web-services-security-and-telnet.aspx" /><id>http://weblogs.asp.net/tonylombardo/archive/2009/10/29/hacking-web-services-security-and-telnet.aspx</id><published>2009-10-29T16:22:47Z</published><updated>2009-10-29T16:22:47Z</updated><content type="html">&lt;p&gt;If you’ve built a web application in ASP.NET chances are you’ve also consumed or even created your own web service.&amp;#160; Web services are an easy way to share data, and even commit actions across technology lines.&amp;#160; I recently ran into an application that used a web service that captured my curiosity – enough so that I thought I would share my experience.&lt;/p&gt;  &lt;p&gt;The app was a game, and at the end of the game a message popped up that said - “reporting information”.&amp;#160; Interesting, I though.&amp;#160; It was a Silverlight application, which meant the xap file could be downloaded and dissected, which is precisely what I did.&amp;#160; A quick look at the .xap file and I had a config file which gave me a service location.&amp;#160; In other words, I now had the endpoint of the web service.&amp;#160; &lt;/p&gt;  &lt;p&gt;Microsoft makes web services cake (yellow cake with chocolate frosting to be precise), and web services by default have an auto-documentation feature enabled which will show usage scenarios and parameter information when viewed through a web browser (HTTP GET).&amp;#160; This is also an easy way for a curious mind to find out just exactly what a web service can do.&amp;#160; So my next step was to navigate my browser to the web service URL.&amp;#160; And BINGO!&amp;#160; I had a list of all actions the web service could support, including the HTTP POST stubs for calling the web service. &lt;/p&gt;  &lt;p&gt;BTW, if you don’t want ASP.NET to automatically generate this documentation (including the more formal WSDL), you need to remove the “documentation” protocol from the webSerivces section of your web.config.&amp;#160; Code below, simply paste it into your web.config or machine.config file.&amp;#160; &lt;/p&gt;  &lt;p&gt;   &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;     &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;       &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;webServices&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;protocols&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;remove&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Documentation&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;protocols&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

      &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;webServices&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/p&gt;

&lt;p&gt;If you’re building a public SDK and encourage others to call your web service, you’ll want to leave this documentation feature up.&amp;#160; But if you’ve built a web service for your LOB application, and don’t really want others to know about it.. turn off the auto documentation.&lt;/p&gt;

&lt;p&gt;Once I knew the service URL, I could have gone into Visual Studio and wrote a quick app that consumed the web service (add web reference…) but I decided to go the more fun route – Telnet.&amp;#160; It had been a while since I used Telnet, and I quickly found out that Telnet isn’t installed by default on a Windows 7 or Windows Vista machine.&amp;#160; But that’s quickly solved by going into add/remove programs, and choosing windows components –&amp;gt; Telnet.&amp;#160; &lt;/p&gt;

&lt;p&gt;Why did I choose Telnet?&amp;#160; Well, because the web service documentation so kindly provided me with the exact HTTP POST information that I needed to call the service.&amp;#160; If you’ve never done a manual HTTP POST through Telnet, it’s time you tried.&amp;#160; It’s relatively easy, and a rewarding experience.&lt;/p&gt;

&lt;p&gt;Telnet is a command line application, that connects to any port you tell it to.&amp;#160; In my case, I wanted to connect to port 80 (http).&amp;#160; I’ve also used Telnet in the past to send SMTP messages (yes, email...)&amp;#160; When running Telnet, you specify the port after the domain.&amp;#160; Remember, you have to use the domain when connecting, not the entire URL.&amp;#160; For example, if you wanted to go to &lt;a href="http://mydomain.com/services/myservice.asmx"&gt;http://mydomain.com/services/myservice.asmx&lt;/a&gt; you would do something like&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;telnet mydomain.com 80&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;You’ll use the rest of the URL when you execute your POST command.&amp;#160; This is low level HTTP right here, and it’s a great way to better understand what’s happening behind the scenes when you click buttons and fill out checkboxes in your favorite web browser.&amp;#160; &lt;/p&gt;

&lt;p&gt;Here’s what you would see from the auto documentatoin on the fake myservice.asmx web service (&lt;a href="http://mydomain.com/myservice.asmx"&gt;http://mydomain.com/myservice.asmx&lt;/a&gt;):&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 98.02%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; height: 255px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; POST /services/myservice.asmx HTTP/1.1&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; Host: mydomain.com&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; Content-Type: text/xml; charset=utf-8&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt; Content-Length: length&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt; SOAPAction: &lt;span style="color: #006080"&gt;&amp;quot;http://mydomain.com/services/HelloWorld&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt; &amp;lt;?xml version=&lt;span style="color: #006080"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt; encoding=&lt;span style="color: #006080"&gt;&amp;quot;utf-8&amp;quot;&lt;/span&gt;?&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt; &amp;lt;soap:Envelope xmlns:xsi=&lt;span style="color: #006080"&gt;&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&lt;/span&gt; xmlns:xsd=&lt;span style="color: #006080"&gt;&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot;&lt;/span&gt; xmlns:soap=&lt;span style="color: #006080"&gt;&amp;quot;http://schemas.xmlsoap.org/soap/envelope/&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;   &amp;lt;soap:Body&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;     &amp;lt;HelloWorld xmlns=&lt;span style="color: #006080"&gt;&amp;quot;http://mydomain.com/services/&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;       &amp;lt;name&amp;gt;&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;&amp;lt;/name&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;     &amp;lt;/HelloWorld&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;   &amp;lt;/soap:Body&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt; &amp;lt;/soap:Envelope&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;There are a couple of things you’ll need to change in the text above to successfully call this service.&amp;#160; First, you’ll want to set the value for the parameter (&amp;lt;name&amp;gt;string&amp;lt;/name&amp;gt;).&amp;#160; By default the documentation will put values in there that don’t make sense, in this case “string”.&amp;#160; Once you have the soap:Body information completed, you need to calculate the size of the data portion, which is the length of the entire XML fragment (lines 7-14 above).&amp;#160; You can either count the characters by hand, or you can paste the XML into MS Word, and use the Word Count feature to show how many characters (including spaces) you have.&amp;#160; Once you have the length, update your Content-Length value (line 4 above).&lt;/p&gt;

&lt;p&gt;Calling this web service from a command line using Telnet is pretty basic once you have the text all ready.&amp;#160; You’ll want to paste in the top portion of the text (lines 1-5 above) then hit the return key 2 times.&amp;#160; The first time is to end the SOAPAction header, the second is to end the headers section of the POST (and begin the data section).&amp;#160; At this point, it’s time to enter the POST data, which is lines 7-14 above, followed by another enter key.&amp;#160; Once you hit the enter key you’ll receive the response from the web service.&amp;#160; If it’s an HTTP 200, you know it was successful, otherwise there was a problem with your post.&amp;#160; I was unsuccessful the first few times I tried, because I pasted in the complete text you see above (lines 1-14).&amp;#160; It seems that Telnet doesn’t like the way this text is formatted.&amp;#160; I’m guessing it’s a difference in the new line character that’s used.&amp;#160; Anyway, the trick (if you’re using copy/paste) is to paste in the headers, hit return twice, and then paste in the body.&lt;/p&gt;

&lt;p&gt;Aside from feeling cool because you just called a web service from about the lowest practical level, this exercise should open up your mind about web services and security.&amp;#160; For starters, if you put a web service out there, you should expect that others are going to call it, and not necessarily the way you intended.&amp;#160; In the case that started all of this, data was being stored that I had created through the application.&amp;#160; But I didn’t like the data that was created through the application, I wanted to send my own data.&amp;#160; Much like securing a web application, you should not expect that your web service call will always be coming from your application!&amp;#160; This is a classic example of why client-side validation in a web page is not a security feature, though it is certainly a usability feature.&amp;#160; You can’t prevent a user from submitting data on the client side.&amp;#160; If they really wanted to post values that you’re UI is preventing, they can always turn to Telnet, other another HTTP utility.&lt;/p&gt;

&lt;p&gt;Here’s one last trick for you.&amp;#160; Open up an HTTP Listener like Fiddler2, and run the application that’s calling a web service.&amp;#160; If you take a look at the activity that Fiddler has captured, you’ll see an HTTP POST to the web service URL.&amp;#160; Fiddler even has a ‘RAW’ view, where you can get the precise data to post, just like we pulled out of the web service documentation earlier.&amp;#160; In this case, you’re seeing exactly what was posted to the server.&amp;#160; I mention this because you may think, “well if I don’t store my web service URL in the config, no one will ever know where it is and I’ll be safe!”, and you would be wrong.&amp;#160; It also highlights that when you’re not using a secure web service, or SSL on a web application, the data is TRANSPARENT!&amp;#160; Anyone plugged in downstream from you with an ethernet sniffer can see exactly what is being transmitted, in clear text.&amp;#160; Luckily, there are secure ways of calling web services.&amp;#160; If your service is capable of making changes to data, or gives the caller access to potentially private data, you should certainly secure your web service.&lt;/p&gt;

&lt;p&gt;If you want to learn more about securing your web services, you can read about this topic on MSDN &lt;a title="http://msdn.microsoft.com/en-us/library/aa529262.aspx" href="http://msdn.microsoft.com/en-us/library/aa529262.aspx"&gt;http://msdn.microsoft.com/en-us/library/aa529262.aspx&lt;/a&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7242611" width="1" height="1"&gt;</content><author><name>tony_lombardo</name><uri>http://weblogs.asp.net/members/tony_5F00_lombardo.aspx</uri></author><category term="ASP.NET" scheme="http://weblogs.asp.net/tonylombardo/archive/tags/ASP.NET/default.aspx" /></entry><entry><title>Can’t Touch This</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/tonylombardo/archive/2009/10/26/can-t-touch-this.aspx" /><id>http://weblogs.asp.net/tonylombardo/archive/2009/10/26/can-t-touch-this.aspx</id><published>2009-10-26T17:21:14Z</published><updated>2009-10-26T17:21:14Z</updated><content type="html">&lt;p&gt;Touch seems to be the latest craze in software, but astonishingly, it’s nothing new.&amp;#160; Most applications out there will work perfectly well in a single touch emulated environment.&amp;#160; Basically, a hardware device turns your finger touch into a mouse action.&amp;#160; Yet, even though those interfaces and devices have been around for years, it really wasn’t until the iPhone, that people got reacquainted with touch.&amp;#160; Here’s the reason why.&amp;#160; &lt;/p&gt;  &lt;p&gt;Touch vs. Multi-Touch&lt;/p&gt;  &lt;p&gt;Touch in and of itself is pretty basic.&amp;#160; Take a finger or a stylus, and use it to drive the mouse subsystem.&amp;#160; While this type of touch is better than no touch at all, it didn’t do anything special enough to get a user to go from using a mouse, to using their finger.&amp;#160; Then multi-touch came around.&amp;#160; Suddenly, you could do things that would have been difficult or impossible with a classic mouse device.&lt;/p&gt;  &lt;p&gt;Zooming with two fingers is now a classic example, and sadly one of the only examples out there.&amp;#160; The reason for the lack of multi-touch interfaces is actually quite simple.&amp;#160;&amp;#160; Multi-touch isn’t easy to do, and more importantly, coming up with scenarios where multi-touch is beneficial in an application is a challenging task that requires more of a designer’s brain, than a developers brain.&amp;#160; &lt;/p&gt;  &lt;p&gt;And here’s where it always gets disappointing.&amp;#160; Lack of applications that use the hardware mean the hardware isn’t in demand, which means the price of the hardware will remain high, which then curbs the demand for applications that use multi-touch.&amp;#160; And the cycle continues.&amp;#160; But the numbers are growing, and we’re getting closer to critical mass.&amp;#160; Businesses are starting to understand the value of an extremely usable, fluid interface with multi-touch.&amp;#160; As businesses start to invest in these technologies, hardware prices will drop, and everything else will hopefully fall in line.&amp;#160; &lt;/p&gt;  &lt;p&gt;In the meantime, developers need to start getting used to the idea of building a touch interface.&amp;#160; If you’re a Silverlight developer, and want to get a quick start – take a look at Tim Heuer’s blog &lt;a title="http://timheuer.com/blog/archive/2009/07/30/silverlight-3-multi-touch-introduction-fundamentals-basics.aspx" href="http://timheuer.com/blog/archive/2009/07/30/silverlight-3-multi-touch-introduction-fundamentals-basics.aspx"&gt;http://timheuer.com/blog/archive/2009/07/30/silverlight-3-multi-touch-introduction-fundamentals-basics.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Start playing around with the idea of using Touch events, and adding an extra layer of functionality to your application.&amp;#160; I’m tired of not having touch capabilities on my computer, and I’m ready to do something about it!&amp;#160; I’m not sure if Windows 7 will be the catalyst that ignites the multi-touch fire, but I sure hope it is.&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7239824" width="1" height="1"&gt;</content><author><name>tony_lombardo</name><uri>http://weblogs.asp.net/members/tony_5F00_lombardo.aspx</uri></author><category term="silverlight" scheme="http://weblogs.asp.net/tonylombardo/archive/tags/silverlight/default.aspx" /></entry><entry><title>Silverlight UX: Sum Of The Parts</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/tonylombardo/archive/2009/06/30/silverlight-ux-sum-of-the-parts.aspx" /><id>http://weblogs.asp.net/tonylombardo/archive/2009/06/30/silverlight-ux-sum-of-the-parts.aspx</id><published>2009-06-30T20:09:18Z</published><updated>2009-06-30T20:09:18Z</updated><content type="html">&lt;p&gt;When talking about Silverlight, it is only natural to compare it to standard web based applications (ASP.NET, PHP, JSF, etc.).&amp;#160; Silverlight has some clear advantages when dealing with large quantities of data, or speed and performance in say grid operations, but there’s another aspect of Silverlight that may be hard to notice at first.&amp;#160; It’s the ‘little’ things.&amp;#160; I call them little, because alone, each of these features isn’t something that will shock or amaze you.&amp;#160; But combined, these features create a User Experience that is specific to Silverlight.&amp;#160; Let’s take a look at a few examples.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/tonylombardo/image_615D2051.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/tonylombardo/image_thumb_39B6A427.png" width="394" height="284" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Above is the Infragistics XamWebGrid in GroupBy mode.&amp;#160; The part to notice is the small x that shows up when you mouse over the Group indicator.&amp;#160; It makes it easy for a user to figure out how to ungroup the data, and that’s just the start.&amp;#160; Notice the shape of the Group indicator?&amp;#160; When you group by multiple columns, these fit together like puzzle pieces.&amp;#160; Again, indicating to the user exactly what’s happening as shown below.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/tonylombardo/image_60188772.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/tonylombardo/image_thumb_26294486.png" width="411" height="282" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The differences are very subtle, like a glow animation when you mouse over a button; the same type of differences you see between Windows Forms and WPF.&amp;#160; But these subtle differences can create a totally different experience for a user.&amp;#160; The application feels more alive, and when these features are put to good use, like in the example above, the UX of the application can be improved.&amp;#160; And here I thought storyboards and animations were only used for 3D rotating textboxes with movies playing in the background.. &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7137387" width="1" height="1"&gt;</content><author><name>tony_lombardo</name><uri>http://weblogs.asp.net/members/tony_5F00_lombardo.aspx</uri></author><category term="silverlight" scheme="http://weblogs.asp.net/tonylombardo/archive/tags/silverlight/default.aspx" /></entry><entry><title>The Chains that Hold Us Back</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/tonylombardo/archive/2009/06/29/the-chains-that-hold-us-back.aspx" /><id>http://weblogs.asp.net/tonylombardo/archive/2009/06/29/the-chains-that-hold-us-back.aspx</id><published>2009-06-29T19:33:02Z</published><updated>2009-06-29T19:33:02Z</updated><content type="html">&lt;p&gt;I’m not sure there’s ever been quite as much activity in the world of Web development as in the past couple of years.&amp;#160; The browser ‘wars’ have been re-ignited, and technology is advancing at a frantic pace.&amp;#160; It’s almost too much to keep up with.&amp;#160; Right now as a web developer you have Silverlight 2 at your disposal, and a beta of Silverlight 3, with talks of Silverlight 4 already taking place.&amp;#160; Then there’s the CSS 3 specs, HTML 5 specs.. it’s almost too much to comprehend.&amp;#160; I guess we’re lucky in a way, that there are currently significant barriers keeping us from these technologies.&lt;/p&gt;  &lt;p&gt;Let’s take a look at Silverlight first.&amp;#160; With clear advantages in performance and usability over standard HTML/JavaScript, Silverlight looked like a definite winner for many web applications.&amp;#160; But Silverlight suffers from one big disadvantage – the plugin that needs to be installed.&amp;#160; That simple plugin which only takes a minute to install, is preventing widespread adoption of Silverlight across corporate America.&amp;#160; As with any new software, IT must first test Silverlight on their systems, and then come up with a rollout plan which as many of you know, is not something that happens overnight.&amp;#160; So even with 3 versions of Silverlight in 1 year, many developers are just now getting the nod from corporate to start discussing the option of using Silverlight.&amp;#160; &lt;/p&gt;  &lt;p&gt;CSS3 and HTML5 promise to change web development (in a good way), but are both being held back by standards committees and browser support (or lack there of).&amp;#160; In all likelihood browsers will implement the features of these specs before the specs are actually complete.&amp;#160; But even the implementation will likely happen at different rates for each browser.&amp;#160; The reason most of us write web applications in the first place is so that one page can be viewed in any browser on any computer by any user.&amp;#160; Which brings us back to IT, the guys who will inevitably be forced to hold back the latest versions of these browsers from being installed, so that they can be properly tested and a deployment strategy can be planned.&amp;#160; &lt;/p&gt;  &lt;p&gt;While all of these new technologies promise to revolutionize web development, it’s unlikely the revolution will happen as quickly as any of us would like to see.&amp;#160; IE6 is still the corporate standard browser in many organizations.&amp;#160; The good news for developers is that it gives you extra time to learn the new technologies.&amp;#160; And if there’s one thing I know, it’s that you can accelerate rollouts if you prove a valid business case.&amp;#160; Show the IT director a prototype of the app you just put together using Silverlight 3 that took you half the time to write and solved the UX and Performance problems of the current html based application, and a Silverlight rollout is likely to be around the corner.&amp;#160; &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7136766" width="1" height="1"&gt;</content><author><name>tony_lombardo</name><uri>http://weblogs.asp.net/members/tony_5F00_lombardo.aspx</uri></author></entry><entry><title>Visual Designer : A Developer’s BFF</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/tonylombardo/archive/2009/06/26/visual-designer-a-developer-s-bff.aspx" /><id>http://weblogs.asp.net/tonylombardo/archive/2009/06/26/visual-designer-a-developer-s-bff.aspx</id><published>2009-06-26T16:21:16Z</published><updated>2009-06-26T16:21:16Z</updated><content type="html">&lt;p&gt;Developers are often cast into a group and stereotyped as &amp;quot;visual design challenged”.&amp;#160; The fact is, a true Visual Designer picks colors and creates designs for applications that make my attempts look like grade school arts and crafts project.&amp;#160; But that doesn’t mean developer’s don’t care about design.&amp;#160; Actually, I think most developers put a tremendous effort into trying to make their applications look good.&amp;#160; It’s just that the results aren’t always award winning..&lt;/p&gt;  &lt;p&gt;I used to get insulted when people would mention that developers weren’t good at styling applications.&amp;#160; From the first day I started coding, I was the only one working on my applications.&amp;#160; The application was my creation, and I was responsible for every aspect of it, including the design.&amp;#160; By hearing generalized statements about how developers are bad at visual design, it was like telling me that I don’t have the entire skills I need to build a successful application.&amp;#160; &lt;/p&gt;  &lt;p&gt;Luckily, I’ve grown up a little since then.&amp;#160; While I still don’t like hearing I’m not good at something, I can certainly respect that there are professionals in the visual design world who can do a much better job of making my applications look good.&amp;#160; I can spend 2 years writing the most beautiful code, but at the end of the day, the user only sees the User Interface.&amp;#160; UX is perhaps the most important aspect of an application, because it encompasses all aspects of the application.&amp;#160; If the code was buggy, the UX will be poor.&amp;#160; But more importantly, if the code was perfect and the UI design was not, the UX will be sub-par.&amp;#160; Want proof of just how important the UI/UX is?&amp;#160; Take a look at Facebook vs. MySpace.&amp;#160; &lt;/p&gt;  &lt;p&gt;MySpace was the clear favorite two years ago, so what happened?&amp;#160; The MySpace page was ugly by default, and users could do anything they wanted to make it even uglier.&amp;#160; Sure, customizing your page sounds like a good idea, until you realize that you’re not that good at it.&amp;#160; Facebook took a different approach – a fixed&amp;#160; UI that looked good out of the box.&amp;#160; Facebook users didn’t need to spend time making their page look good, and more importantly, you didn’t have to look at hundreds of other bad looking sites.&amp;#160; Take another example, the iPhone.&amp;#160; Apple cares about it’s image so much, that all iPhone applications need to follow design guidelines, and must be approved before they can be made available to iPhone customers.&amp;#160; Still not sold on the importance of UI?&amp;#160; Remember geocities?&amp;#160; How could you not.&amp;#160; An entire domain of horrendous designs.&amp;#160; The negative experience associated with those bad designs is something that sticks with you.&amp;#160; I don’t remember if I ever found anything functional on geocities, I’m sure I did.&amp;#160; But that’s not what I remember.&amp;#160; I remember the horrible color choices, images with choppy edges (that of course weren’t transparent), and JavaScript errors.&amp;#160; &lt;/p&gt;  &lt;p&gt;There’s a point in here somewhere.&amp;#160; Oh yeah – designers are a developers best friend.&amp;#160; Designers make developers look better.&amp;#160; After I spent 2 years on a project, of course I want people to think it’s the coolest thing they ever saw.&amp;#160; But my late nights of coding are essentially going to be judged on how good the application looks, not how well I wrote the code.&amp;#160; I remember the days of getting beta feedback like, “It’s not colorful enough, can you add some color to it?”&amp;#160; I would go back to my desk, bummed that no one shared the same excitement as I did that the project was complete.&amp;#160; But in actuality, it wasn’t complete.&amp;#160; It was functional, but that doesn’t make an application “done”.&amp;#160;&amp;#160; So, I’d go back to my desk and throw a few different colors around the application (usually different shades of blue) and try again.&amp;#160;&amp;#160; I spent weeks just experimenting with different colors to see if I could produce something a *slightly* more visually appealing.&amp;#160; Weeks that I could have spent on my next project.&amp;#160; I certainly don’t miss those days.&amp;#160; Today, visual designers take the code that I wrote, and bring it to life, and they do it in far less time than I ever could have, with far better results.&amp;#160; They might hand me back a wireframe or a mock-up that I need to convert to code, or if I’m lucky, they’re just modifying the XAML or CSS directly for me.&amp;#160; And when I hear comments about how cool an application is, I know that without my code, that would have been nothing more than a static image.&amp;#160; I bring designs to life, designers bring my code to life.&amp;#160; It’s amazing that I ever did both the design and development.&amp;#160; And it’s even more amazing that I resisted change at first.&amp;#160; &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7135029" width="1" height="1"&gt;</content><author><name>tony_lombardo</name><uri>http://weblogs.asp.net/members/tony_5F00_lombardo.aspx</uri></author><category term="ASP.NET" scheme="http://weblogs.asp.net/tonylombardo/archive/tags/ASP.NET/default.aspx" /></entry><entry><title>MVC vs. WebForms, A Clear Loser Emerging</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/tonylombardo/archive/2009/06/23/mvc-vs-webforms-a-clear-loser-emerging.aspx" /><id>http://weblogs.asp.net/tonylombardo/archive/2009/06/23/mvc-vs-webforms-a-clear-loser-emerging.aspx</id><published>2009-06-23T20:03:34Z</published><updated>2009-06-23T20:03:34Z</updated><content type="html">&lt;p&gt;Working with WebControls and WebForms for the past 8 years has taught me a lot about web development.&amp;#160; The one thing that I learned above everything is that the onus is on the developer to write good code.&amp;#160; Now that may not sound like something revolutionary, but the fact is that ASP.NET WebForms makes building web applications easy by abstracting away some of the difficulties of a stateless protocol.&amp;#160; And it also makes it easy to forget about what’s actually happening behind the scenes to make everything possible.&amp;#160; Does that mean WebForms is flawed?&amp;#160; No.&lt;/p&gt;  &lt;p&gt;MVC offers a fix for some of the problems that WebForms has been plagued with.&amp;#160; Problems like bloated ViewState, and that ‘pesky postback model.’&amp;#160; On the surface, this looks like an attractive solution for every web developer out there.&amp;#160; A promise to get rid of ViewState – a web application’s mortal enemy?&amp;#160; It has to be good. That is until the application your building needs some sort of state mechanism, and you begin re-inventing the wheel.&amp;#160; I think it would have been much easier just to go back to you WebForms application and disable ViewState.&amp;#160; &lt;/p&gt;  &lt;p&gt;The problem right now is that there is so much focus over why MVC is better than WebForms, that everyone is forgetting a basic rule of software development: use the right tool for the job.&amp;#160; I’ve said it dozens of times, MVC has a set of scenarios that it first very nicely, as does WebForms.&amp;#160; One platform does not need to be declared a winner – they’re two equals that should be placed into your metaphorical toolbox.&amp;#160; So who is actually losing right now?&amp;#160; The developer community that is caught in the middle of this faux war.&amp;#160; Developers who think that they have to move to MVC out of pride or fear that WebForms will be replaced by MVC.&amp;#160; Developers who are only hearing one side of the story right now at local community events and tradeshows because let’s face it.. WebForms isn’t sexy anymore at 8 years old.&amp;#160; Ironically, this same issue of “sexy talks” was &lt;a href="http://channel9.msdn.com/posts/Glucose/Hanselminutes-on-9-Why-Arent-There-More-WinForms-Talks-with-Rocky-Lhotka/"&gt;discussed last week at NDC&lt;/a&gt; with Scott Hanselman behind the camera. &lt;/p&gt;  &lt;p&gt;Conferences aren’t picking talks about “the old stuff”, because they’d rather focus on what’s new.&amp;#160; New is sexier, and conferences are all about attendance numbers.&amp;#160; But here’s what these conferences don’t seem to understand – every day there’s a new developer joining the community who needs to start from zero.&amp;#160; Developers gauge what’s important by what’s being talked about, it’s why we have trends and tag clouds.&amp;#160; It’s human nature.&amp;#160; If I hear 100 people talking about a subject, it must be important.&amp;#160; Right now I hear 100 people talking about MVC, and no one talking about WebForms, so I guess MVC is more important, right?&amp;#160; That’s the type of thinking happening right now, and it’s nothing new. &lt;/p&gt;  &lt;p&gt;“MVC brings web development back into ASP.NET”, is one of the most common arguments I hear for its use.&amp;#160; Yet the whole reason for WebForms existence was to free you of the dirty details of building a web application, and let you focus on your business logic.&amp;#160; To give you a set of functionality to be able to build on top of, the same focus for every library and framework out there.&amp;#160; It’s why you don’t have to write browser specific JavaScript when using jQuery or ASP.NET AJAX, and it’s the reason we don’t still program in machine language.&amp;#160; Can I write a tighter loop in assembly than I can in JavaScript?&amp;#160; Sure.&amp;#160; But for the applications I’m writing that’s not going to be an issue.&amp;#160; Maybe I’m writing an application where performance is the top and only concern.&amp;#160; Now writing the application in assembly doesn’t sound like a crazy idea.&amp;#160; If my requirements were to build a spreadsheet like application that offers filtering, copy and paste and exporting to excel, I’m going to jump to WebForms.&amp;#160; That’s the whole point behind using the right tools for the job.&amp;#160; &lt;/p&gt;  &lt;p&gt;I read a blog post today that talked about how you should dump WebForms and go with MVC as soon as possible, so you can get back to web development roots.&amp;#160; The argument just didn’t make sense to me.&amp;#160; It’s like asking me to stop coding in C# and move to C++ because C# developers just don’t understand pointers and memory allocation.&amp;#160; &lt;/p&gt;  &lt;p&gt;So here’s my call to action.&amp;#160; Rather than talking about why one framework or platform is better than the other, start discussing when one is better than the other.&amp;#160; What scenarios is MVC geared for?&amp;#160; When would you use WebForms (MVP) instead?&amp;#160; &lt;/p&gt;  &lt;p&gt;The best advice I’ve seen so far is that WebForms is the platform of choice for building web applications, where MVC is more suited to building web sites.&amp;#160; This is still a bit abstract since there’s no clear definition of web applications, but I think it’s safe to say that if you’re building a web version of a win client application, you’re building a web application.&amp;#160; If you have a ‘grid’ in your page for purposes above that of just layout, you’re building a web application.&amp;#160; &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7132726" width="1" height="1"&gt;</content><author><name>tony_lombardo</name><uri>http://weblogs.asp.net/members/tony_5F00_lombardo.aspx</uri></author><category term="ASP.NET" scheme="http://weblogs.asp.net/tonylombardo/archive/tags/ASP.NET/default.aspx" /></entry><entry><title>ASP.NET 4.0 &amp; Why it Matters</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/tonylombardo/archive/2009/06/08/asp-net-4-0-amp-why-it-matters.aspx" /><id>http://weblogs.asp.net/tonylombardo/archive/2009/06/08/asp-net-4-0-amp-why-it-matters.aspx</id><published>2009-06-08T22:09:53Z</published><updated>2009-06-08T22:09:53Z</updated><content type="html">&lt;p&gt;I hear a lot of overused and overloaded terms these days like “leaky abstraction” when talking about WebForms.&amp;#160; As people repeat these items like robot drones, I wonder if they truly understand what it means, and more importantly how it affects a developers ability to build software.&amp;#160; But whether it’s a group of robot drones, or an increasing number of well educated software engineers, we’ll leave for the subject of another debate.&amp;#160; Back to the matter at hand.&amp;#160; Of all of the WebForms complaints, it usually boils down to a few key issues – ViewState, ID generation and HTML Markup &amp;amp; Postbacks; each of which is undergoing changes in ASP.NET 4.0.&lt;/p&gt;  &lt;h2&gt;ViewState&lt;/h2&gt;  &lt;p&gt;To understand the first issue of ViewState, you have to understand the ViewState model.&amp;#160; It works recursively in nature, with each control responsible for initiating the loading and saving of ViewState from it’s child controls.&amp;#160; The problem comes when you turn off ViewState at a root level.&amp;#160; Since the parent control is no longer storing ViewState, it’s child controls get ignored.&amp;#160; Basically, you can turn ViewState off selectively for children, but you can’t turn it on selectively if it’s disabled for the parent control.&amp;#160;&amp;#160; The solution?&amp;#160; ASP.NET 4.0 introduces the ViewStateMode pattern which is separate from the EnableViewState property.&amp;#160; ViewStateMode has 3 values, Enabled, Disabled and Inherit (the default).&amp;#160; When ViewStateMode is set to disabled, any child control that is set to Disabled or Inherit will have it’s ViewState turned off.&amp;#160; If a parent control has ViewStateMode=Disabled, and the child control has ViewStateMode=Enabled (the important new scenario), the child control will still have it’s ViewState saved.&amp;#160; This in essence, is what the feature is all about.&amp;#160; The net gain for a Web developer is a lighter weight page, because you now have the ability to turn off ViewState in places that you didn’t really need it on in the first place.&amp;#160;&amp;#160; &lt;/p&gt;  &lt;h2&gt;ID generation&lt;/h2&gt;  &lt;p&gt;Have you ever taken a look at the html markup produced by an ASP.NET WebForms application?&amp;#160; I have.&amp;#160; Actually, I spend a good portion of my time examining html markup and discerning how a page can be made lighter or faster based on what I see.&amp;#160; One of the big offenders happens to be ID strings.&amp;#160; If you want to address an element, you need to give it an ID.&amp;#160; If you want to address it uniquely, you need to come up with a mechanism to make that ID unique.&amp;#160; In ASP.NET WebForms this was done by pre-pending the parent control’s id to the ID string of a control.&amp;#160; The problem is that as applications became more complex, so did the control hierarchies, which then caused UniqueID and ClientID strings to become unmanageable.&amp;#160; Looking at an application today, it’s not out of the question to see something like “contentPlaceHolder1:ctl0:ctl0:UpdatePanel1:Panel1:GridView1” Now if you use that string a few times to address id’s or create css class names, you’re bloating your HTML.&amp;#160; Even worse, you’re creating a recipe for cascading failures if you ever change the containership or the ID of one of the parent controls.&amp;#160; Suddenly, your element’s ClientID has changed, and you need to go through and update your code.&amp;#160; &lt;/p&gt;  &lt;p&gt;In ASP.NET 4.0, you’ll have the ability to set the ClientIdMode to “Static” which solves most of these problems.&amp;#160; With a Static ClientIdMode, the ID string you set for the control, is the same string that will be used for the ClientID.&amp;#160; This has the benefit of being less fragile, and gives you the ability to clean up your markup by shortening ID’s considerably.&amp;#160; The drawback to using ClientIdMode=Static is that ID’s will not be ensured to be Unique by the framework, making this a manual task for the developer.&amp;#160; Not sure about you, but if that’s the biggest challenge of my day, I’ll be smiling.&lt;/p&gt;  &lt;h2&gt;HTML Markup &amp;amp; Postbacks&lt;/h2&gt;  &lt;p&gt;Postbacks were the bread and butter of ASP.NET 1.0.&amp;#160; Luckily ASP.NET has come a long way since then, and developers today understand that creating a good User Experience means limiting postbacks.&amp;#160; The amount of HTML rendered to the client also has a direct correlation on User Experience.&amp;#160; The more HTML/Markup, the longer a page will take to load.&amp;#160; ASP.NET 4.0 improves this key scenario by adding Client-Side DataBinding and templating.&amp;#160; Think of client-side templates as a repeater that get’s populated by JavaScript.&amp;#160; Why populate the repeater on the client-side rather than the server-side?&amp;#160; It’s a matter of multiplication.&amp;#160; Take the same 4 lines of HTML in a repeater template and multiply it by the number of items in your datasource.&amp;#160; Now push all of that HTML down over the wire to the client.&amp;#160; Make matters even more interesting, use the same datasource to populate a grid.&amp;#160; In a typical scenario, you’re pushing the same data down two times, once for the repeater, once for the grid.&amp;#160; If you had that data available as a client-side DataSource, you only send the data down once, and re-use it on multiple controls.&amp;#160; At the price of a little extra processing power to create the dom elements through JavaScript, you get the benefit of possibly drastically reduced HTML markup, and free yourself from relying on Postbacks in order to populate a list.&amp;#160; &lt;/p&gt;  &lt;p&gt;The three features listed above are just a short list taken from the &lt;a href="http://www.asp.net/learn/whitepapers/aspnet40/"&gt;ASP.NET 4.0 features whitepaper&lt;/a&gt;.&amp;#160; Even in this short list, it’s easy to see that ASP.NET 4.0 is changing the face of WebForms.&amp;#160; Many of the concerns that developers have expressed and many of the advantages that MVC touts over WebForms are being addressed.&amp;#160; The point is, WebForms isn’t dead, it’s quite the opposite.&amp;#160; &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7113788" width="1" height="1"&gt;</content><author><name>tony_lombardo</name><uri>http://weblogs.asp.net/members/tony_5F00_lombardo.aspx</uri></author><category term="ASP.NET" scheme="http://weblogs.asp.net/tonylombardo/archive/tags/ASP.NET/default.aspx" /></entry><entry><title>Surveys, Polls, Voting, and why they usually stink</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/tonylombardo/archive/2009/05/28/surveys-polls-voting-and-why-they-usually-stink.aspx" /><id>http://weblogs.asp.net/tonylombardo/archive/2009/05/28/surveys-polls-voting-and-why-they-usually-stink.aspx</id><published>2009-05-28T21:28:45Z</published><updated>2009-05-28T21:28:45Z</updated><content type="html">&lt;p&gt;I’ve never been a big fan of surveys or polls.&amp;#160; Not because I don’t like them, but because I always disagree with their validity and the conclusions that are drawn from the results.&amp;#160; Lets take a look at a couple of examples.&amp;#160; Readers Choice awards were recently handed out.&amp;#160; I received an email from a customer who wanted to let me know that he was contacted by a component vendor to go out and vote for them, and he didn’t even own their product.&amp;#160; To my surprise, he wanted to know where the Infragistics email was.&amp;#160; My answer – we make a very conscious effort to limit the number of emails we send out to our customer base.&amp;#160; At the end of the day, our decision to keep spam out of our customer’s inboxes also meant that we were at a disadvantage in the survey/poll/award.&amp;#160; Does the poll actually show which product is the best?&amp;#160; Or does it show who spent more time and energy on campaigning for votes?&lt;/p&gt;  &lt;p&gt;Now let’s look at case #2.&amp;#160; There’s a &lt;a href="http://www.zoomerang.com/Survey/survey-intro.zgi?p=WEB22973CYKW2H"&gt;survey out right now&lt;/a&gt; asking questions about AJAX tools and frameworks, and which ones developers are using.&amp;#160; I don’t know exactly what the results of this survey look like, but here were my first impressions.&amp;#160; The survey is hosted on a &lt;a href="http://codeclimber.net.nz/archive/2009/05/25/survey-on-ajax-adoption-some-quick-stats.aspx"&gt;personal blog&lt;/a&gt;, where most readers likely share similar interests.&amp;#160; Simone Chiaretta (the blogger) respectfully acknowledges that this blog has a limited audience and is likely biased toward the ALT.NET kind of developer.&amp;#160; I’m sure Simone has the best intentions about publishing the survey, but it will be very difficult to not get a skewed response.&amp;#160; In addition, what does the response actually mean?&lt;/p&gt;  &lt;p&gt;A current snapshot of results shows that 76% of developers are using jQuery, compared with 48% using ASP.NET AJAX and 58% using AJAX Toolkit.&amp;#160; Does that really mean that there are more jQuery developers than WebForms/ASP.NET AJAX developers?&amp;#160; To confuse matters, AJAX Control Toolkit is built ONTOP of ASP.NET AJAX.&amp;#160; Yet these results show that there are more people using the toolkit than ASP.NET AJAX (which is actually impossible).&amp;#160; I know from experience that there is a huge portion of web developers out there who never want to hear the word “Javascript”.&amp;#160; Does that mean they’re not doing AJAX?&amp;#160; No, they’re simply relying on the tools that were handed to them.&amp;#160; Microsoft created the Microsoft ASP.NET AJAX stack and made doing things like partial rendering a breeze.&amp;#160; It’s all part of ASP.NET 3.5.&amp;#160; I don’t even call it “AJAX Extensions” anymore, it’s just ASP.NET 3.5, or Visual Studio 2008.&amp;#160;&amp;#160; It’s actually so easy to do Partial Updates at this point, that a developer can ‘do AJAX’ with out even knowing how to write a line of JavaScript.&amp;#160; It’s very unlikely that those developers are or will be represented in this survey.&amp;#160; How many web developers still use the term DHTML?&amp;#160; That usually only shows up on resumes.&amp;#160; But in actuality, most web developers today are doing DHTML, and aren’t even aware of it.&amp;#160; I expect the same will be true of AJAX.&amp;#160; It’s so commonplace that there’s no reason to differentiate it from web development in the first place.&amp;#160; &lt;/p&gt;  &lt;p&gt;So what spawned all of this?&amp;#160; Well, I saw a post from Betrand Le Roy on Twitter about this survey.&amp;#160; He immediately got a response asking “will the results of this survey be used to finally convince Microsoft to dump ASP.NET AJAX, and go with jQuery instead”.&amp;#160; I can only hope not.&amp;#160; jQuery is an awesome Javascript framework, but it absolutely abandons the web developer who doesn’t want to spend his days writing custom Javascript.&amp;#160; Microsoft created the idea of a server-side webcontrol for this very reason.&amp;#160; If I’m given the choice to drop an UpdatePanel on a form and have a label update on a button click via AJAX, or hand code it myself using a Javascript framework, I’m going to go with the UpdatePanel just about every time.&amp;#160; Will I get more satisfaction out of building it from scratch?&amp;#160; Certainly.&amp;#160; But personal satisfaction doesn’t pay the bills. And I’d be much more satisfied spending the two weeks time I saved, on the beach fishing.&amp;#160; The Infragistics ASP.NET controls try to find a comfortable balance between these two worlds.&amp;#160; They abstract away the client-side javascript for developers who don’t want to or have the time to deal with it, and they provide a client-side object model for developers who want to dive in and play.&amp;#160; We call it our CSOM (Client-Side Object Model) and it’s been around for years.&amp;#160; I think this is the path Microsoft needs to continue to take, supporting both of these key scenarios.&amp;#160; &lt;/p&gt;  &lt;p&gt;But back to the topic at hand.&amp;#160; Polls and surveys are just that.&amp;#160; They represent a a sentiment of a select audience.&amp;#160; Was the audience wide enough to capture multiple views (usually not).&amp;#160; Was the survey done by an impartial third party (usually not).&amp;#160; Did others have a chance to influence the results (unfortunately yes most of the time).&amp;#160; And even when you get past all of that, it’s most important to look at what the questions were actually asking in the first place.&amp;#160; Each time I see the results of a poll, I argue that the answer that was being deduced was not actually the question that was being asked.&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;My question to you – do you participate in these polls?&amp;#160; How much weight/validity do you give the to results?&amp;#160; And better yet, what do you think about “lobbying for votes” in readers choice type polls/awards?&amp;#160; Is that something you would be happy to hear about, or would you prefer not to hear at all?&amp;#160; &lt;/p&gt;  &lt;p&gt;Perhaps I’m too analytical, but I generally tear apart survey results and the conclusions that are drawn from them. &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7101138" width="1" height="1"&gt;</content><author><name>tony_lombardo</name><uri>http://weblogs.asp.net/members/tony_5F00_lombardo.aspx</uri></author><category term="ASP.NET" scheme="http://weblogs.asp.net/tonylombardo/archive/tags/ASP.NET/default.aspx" /></entry><entry><title>Building A Silverlight 3 Dashboard With Composite UI</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/tonylombardo/archive/2009/04/14/building-a-silverlight-3-dashboard-with-composite-ui.aspx" /><id>http://weblogs.asp.net/tonylombardo/archive/2009/04/14/building-a-silverlight-3-dashboard-with-composite-ui.aspx</id><published>2009-04-14T22:06:06Z</published><updated>2009-04-14T22:06:06Z</updated><content type="html">&lt;p&gt;If you’ve been following me on Twitter (&lt;a href="http://twitter.com/igtony"&gt;igtony&lt;/a&gt;), you’ve probably heard me grumbling about Visual Studio crashing, services not working, or various other gremlins I’ve been fighting with for the past few days.&amp;#160; Well, I’ve finally got something to show for all of my pain!&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/tonylombardo/image_7221043B.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Image 1" border="0" alt="Image 1" src="http://weblogs.asp.net/blogs/tonylombardo/image_thumb_668B46FC.png" width="644" height="500" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;My goal when I started building this application was to build a POC Silverlight Application which dynamically loaded sub-applications.&amp;#160; In essence, I wanted to build a Silverlight shell that could load N applications unknown at compile time.&amp;#160; I started out by choosing from the new Navigation project template in Silverlight 3.&amp;#160; This gives a MasterPage scenario that works as a good starting point for an application which may have multiple distinct Views.&amp;#160; I tweaked the base appearance of the template around just to make it look a little more presentable.&amp;#160; The White background used in the &amp;lt;Frame&amp;gt; element and the big 10px borders reminded me of Windows 3.1, and IE4.&amp;#160; I used a Border element to create the rounded edges which wrapped around my Frame, and I set my Frame background to be transparent.&amp;#160; With some of the UI tweaks out of the way, it was down to business.&lt;/p&gt;  &lt;p&gt;The first task I needed to tackle was loading a XAML page (UserControl) dynamically.&amp;#160; It turns out this is a pretty simple task as long as that user control is in the same XAP file.&amp;#160; The Frame element has a Navigate method which takes a URI and will fill the Frame’s Content with the UserControl specified via the URI.&amp;#160; Unfortunately, the solution I was looking for places my UserControl in a separate XAP file, which meant I couldn’t use the simple Frame.Navigate(URI) method.&amp;#160; Instead I needed to dynamically load the UserControl in question.&amp;#160; Luckily, this is a pretty straight forward task with the help of the WebClient.OpenReadAsync method, and AssemblyPart class.&amp;#160; Here’s the code I used:&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:9724a6d8-f724-40dd-985d-098d9a308d11" class="wlWriterEditableSmartContent"&gt;&lt;pre name="code" class="c#"&gt;        private void NavButton_Click(object sender, RoutedEventArgs e)
        {
            Button navigationButton = sender as Button;
            //Create a WebClient instance to download our separate XAP file
            WebClient client=new WebClient();

            client.OpenReadCompleted+=new OpenReadCompletedEventHandler(client_OpenReadCompleted);
            //Download the XAP file
            client.OpenReadAsync(new Uri("CompositeApp.xap",UriKind.Relative));
        }

        void client_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
        {

			//Create a StreamResourceInfo object out of our XAP stream            
			StreamResourceInfo sri = new StreamResourceInfo(e.Result, null);
			
			//Get a StreamResourceInfo for the Application's DLL
			//The one that houses our main XAML UserControl
            StreamResourceInfo mainAppSRI = Application.GetResourceStream(sri, new Uri("CompositeApp.dll", UriKind.Relative));
			
			//Load the Assembly using AssemblyPart.Load
            AssemblyPart loader = new AssemblyPart();
            Assembly assembly = loader.Load(mainAppSRI.Stream);
			
			//Now that the Assembly is loaded, create an instance of our UserControl
            this.Frame.Content = assembly.CreateInstance("CompositeApp.MainPage");
           
        }
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;There’s one drawback to using this method to dynamically load a UserControl – dependencies are not automatically loaded for you.&amp;#160; If your UserControl in the separate XAP has a dependency on 4 assemblies you must manually load those 4 assemblies before loading your UserControl or CreateInstance will fail.&amp;#160; The &lt;strike&gt;hack&lt;/strike&gt; solution I used was to include the assembly references in the main shell application.&amp;#160; This doesn’t scale well though, since ideally you want the additional dependencies to be loaded dynamically as necessary.&amp;#160; There’s no way you’ll know today every assembly reference each sub app will need for the entire life of the shell.&amp;#160; It’s actually impossible since you’ll likely need a ‘new’ assembly at some point down the road.&amp;#160; I saw some code fragments while looking for a solution which read the manifest in the XAP to determine what assemblies need to be loaded out of the (external) XAP.&amp;#160; If I were building this as a real world app, I would go that route.&amp;#160; If you know of a better way to handle this, I encourage you to share in the comments!&amp;#160; In a perfect world Frame.Navigate would allow you to specify a XAML file in a separate XAP and do all of this work for you.&amp;#160; Are you listening Silverlight team? ;)&lt;/p&gt;

&lt;p&gt;Ok, main hurdle down (dynamic loading of UserControl from separate XAP), it was time for the next challenge – creating content!&amp;#160; I started out with a grid, because you can’t have a good application without a grid in there somewhere, right?&amp;#160; I used the XamWebGrid, and used it in a couple of places.&amp;#160; One on the main page which showed hierarchical data (Accounts and Transactions)&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/tonylombardo/image_4A0E551C.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Image 2" border="0" alt="Image 2" src="http://weblogs.asp.net/blogs/tonylombardo/image_thumb_49A22227.png" width="644" height="500" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Next I created another ‘page’ or View which Visualized data in a Map.&amp;#160; In this scenario the map shapes came from my “Shapefile” and the data came from a SQL Database via WCF and LinqToSQL.&amp;#160; I think this probably mirrors the major use case out there, where the data is kept separate from the Shapefile.&amp;#160; &lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/tonylombardo/image_4935EF32.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Image 3" border="0" alt="Image 3" src="http://weblogs.asp.net/blogs/tonylombardo/image_thumb_048954F1.png" width="644" height="500" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;On the final Screen, I went with ‘live’ updating data (Image 1).&amp;#160; Since this was just a demo, I used a DispatcherTimer to change my underlying datasource every second.&amp;#160; Since my underlying datasource was an ObservableCollection of INotifyPropertyChanged objects, my grid immediately showed any changes made to the underlying datasource.&amp;#160; The Grid does 2-way databinding by default.&amp;#160; Since my View still looked empty, I dropped a chart in there as well, and added a new datapoint to the chart’s DataPoints collection each second (representing the history of changes made to the grid).&amp;#160; The end result was a chart and grid showing updates every second, with the Chart “always in motion”.&amp;#160; It was a pretty impressive experience.&amp;#160; My next step is to see what this would look like with a real data feed.&amp;#160; I’m guessing with proper queuing in place, the experience should mirror my mock up almost exactly.&amp;#160; &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7046383" width="1" height="1"&gt;</content><author><name>tony_lombardo</name><uri>http://weblogs.asp.net/members/tony_5F00_lombardo.aspx</uri></author><category term="silverlight" scheme="http://weblogs.asp.net/tonylombardo/archive/tags/silverlight/default.aspx" /></entry><entry><title>Another Code Camp, Another Good Time</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/tonylombardo/archive/2009/03/30/another-code-camp-another-good-time.aspx" /><id>http://weblogs.asp.net/tonylombardo/archive/2009/03/30/another-code-camp-another-good-time.aspx</id><published>2009-03-30T19:39:35Z</published><updated>2009-03-30T19:39:35Z</updated><content type="html">&lt;p&gt;Over the weekend I hopped a train up to Waltham where I spoke at the New England Code Camp 11.&amp;#160; As usual, there was a vibe in the air that made everything seem almost make believe – or maybe that was just the green tint on the projector..&amp;#160; Either way, if you haven’t been to a Code Camp yet, there’s no better time.&amp;#160; Free content, free food, and great opportunities for networking.&amp;#160; That’s not to mention the give-aways.&amp;#160; &lt;/p&gt;  &lt;p&gt;I spent a good amount of time in the Speakers lounge on Saturday and had the opportunity to meet some great people.&amp;#160; I was introduced to “Pocket Coffee”, a chocolate John Doucette’s his wife picked up in Rome.&amp;#160; It wasn’t any chocolate, it had an Espresso center.&amp;#160; After trying one, I was immediately hooked and started feverishly searching &lt;a href="http://www.amazon.com/Pocket-Coffee-Ferrero-Piece-Packs/dp/B000Y8Y5F4"&gt;Amazon.com&lt;/a&gt; to see where I could buy a case.&amp;#160; Right before I had to leave to catch my train,I got into a long discussion about HDD’s and what the platters are made out of.&amp;#160; Turned out I was talking to somewhat of an expert on the subject.&amp;#160; Igor Moochnick told me about how he re-uses computer parts in his robotics side projects.&amp;#160; All in all good fun, and it was great meeting you all.&amp;#160; &lt;/p&gt;  &lt;p&gt;The session itself was a hit (in my opinion).&amp;#160; I did an introductory level JavaScript talk, packing years of experience into an hour long discussion.&amp;#160; The session was more like a chalk talk than a standard “session”.&amp;#160; Actually I didn’t have a single PowerPoint slide prepared, and spent 99% of the time inside of Visual Studio or Internet Explorer.&amp;#160; If you were at the session and have any specific questions about the topics I covered feel free to use the comments section on this post.&amp;#160; &lt;/p&gt;  &lt;p&gt;I’m not sure who traveled the farthest to get to the Code Camp, but I know that I lost out to Steve Andrews and John Baird who drove up from the Philly area.&amp;#160; &lt;/p&gt;  &lt;p&gt;And speaking of Philly – The &lt;a href="http://www.phillydotnet.org/"&gt;Philly Code Camp&lt;/a&gt; is coming up on April 18th.&amp;#160; I’ll be there, just not speaking this time.&amp;#160; I’m doing something a little different that I think you’re going to like.&amp;#160; I’m setting up in the cafeteria all day, and I’ll be there to answer any questions you have about the Infragistics tools.&amp;#160; Want to know what’s in the next release?&amp;#160; Need help figuring out how to do something with one of the tools?&amp;#160; Just stop on by.&amp;#160; Feel free to bring your laptop and projects with you, we can do some hands on debugging.&amp;#160; &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7012333" width="1" height="1"&gt;</content><author><name>tony_lombardo</name><uri>http://weblogs.asp.net/members/tony_5F00_lombardo.aspx</uri></author><category term="community" scheme="http://weblogs.asp.net/tonylombardo/archive/tags/community/default.aspx" /></entry><entry><title>NetAdvantage ASP.NET Controls – The Next Generation</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/tonylombardo/archive/2009/03/26/netadvantage-asp-net-controls-the-next-generation.aspx" /><id>http://weblogs.asp.net/tonylombardo/archive/2009/03/26/netadvantage-asp-net-controls-the-next-generation.aspx</id><published>2009-03-26T20:50:42Z</published><updated>2009-03-26T20:50:42Z</updated><content type="html">&lt;p&gt;It’s a time of change here at Infragistics.&amp;#160; We’re way past the half way point on our “Aikido” (Now officially just AJAX) framework, and with the 9.1 release many of the remaining classic Infragistics controls are being re-born as Web 2.0 loving replacements.&amp;#160; I’ve got some mixed emotions, since I’ve been here long enough to have worked on these classics, but it’s an exciting time to see what the dev team has produced.&lt;/p&gt;  &lt;p&gt;I was just checking out the WebDataMenu for example, which replaces the WebMenu (part of UltraWebNavigator for those of you who have been with us from the start).&amp;#160; The WebDataMenu is databindable, and supports IEnumerable, XML, BindingList and ICollection.&amp;#160; Basically, if you’ve got data, the WebDataMenu can handle it.&amp;#160; DataBinding support is just the beginning though.&amp;#160; It’s also built with Web 2.0 ideals embedded in its core.&amp;#160; What do I mean?&amp;#160; Well, a quick look at the HTML source and you’ll see the WebDataMenu is composed of &amp;lt;ul&amp;gt;&amp;lt;/ul&amp;gt; elements.&amp;#160; Each Menu Item is a list item, meaning you can easily control the display of the WebDataMenu with CSS.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/tonylombardo/image_7261041C.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/tonylombardo/image_thumb_5577DF47.png" width="640" height="389" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Add keyboard navigation (IE, FireFox AND Safari) and you’ve got a killer menu.&amp;#160; Take it one step further and allow Menu Items to be templated and you’ve got the menu to rule them all!&amp;#160; Seriously though, this menu is uber cool.&amp;#160; The release is right around the corner, so you should be able to download and try it out very soon.&amp;#160; Like before you do your income taxes soon..&lt;/p&gt;  &lt;p&gt;Stay tuned for more about the 9.1 release.&amp;#160; You can also follow along on &lt;a href="http://twitter.com/igtony"&gt;Twitter&lt;/a&gt; as I push out information over the next couple of weeks.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7005083" width="1" height="1"&gt;</content><author><name>tony_lombardo</name><uri>http://weblogs.asp.net/members/tony_5F00_lombardo.aspx</uri></author><category term="ASP.NET" scheme="http://weblogs.asp.net/tonylombardo/archive/tags/ASP.NET/default.aspx" /><category term="Infragistics" scheme="http://weblogs.asp.net/tonylombardo/archive/tags/Infragistics/default.aspx" /></entry><entry><title>Social Networking Fan? Information Junkie?</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/tonylombardo/archive/2009/03/26/social-networking-fan-information-junkie.aspx" /><id>http://weblogs.asp.net/tonylombardo/archive/2009/03/26/social-networking-fan-information-junkie.aspx</id><published>2009-03-26T18:36:35Z</published><updated>2009-03-26T18:36:35Z</updated><content type="html">&lt;p&gt;If you haven’t found us yet, Infragistics is on both &lt;a href="http://www.facebook.com/home.php?#/pages/Infragistics/23425186508"&gt;Facebook&lt;/a&gt; and &lt;a href="http://twitter.com/infragistics"&gt;Twitter&lt;/a&gt;.&amp;#160; If you use either of these networks, you can follow us and get all of the latest information in a single place. &lt;/p&gt;  &lt;p&gt;There are also a bunch of Infragistics employees up on twitter, for example you can follow me &lt;a href="http://twitter.com/igtony"&gt;@igtony&lt;/a&gt;.&amp;#160; I’ve just started talking about the 2009.1 release which I’ve tagged with &lt;a href="http://search.twitter.com/search?q=%23na91"&gt;#na91&lt;/a&gt;.&amp;#160; Tagging allows you to easily search for a keyword.&amp;#160; The # (hash) is used to differentiate ordinary words from tags.&amp;#160; You can then use &lt;a href="http://search.twitter.com"&gt;search.twitter.com&lt;/a&gt; to search for a particular tag.&amp;#160; &lt;/p&gt;  &lt;p&gt;There’s your tip to staying connected for today!&lt;/p&gt;  &lt;p&gt;BTW, I’m headed up to Waltham MA tomorrow to speak at THE &lt;a href="http://blogs.msdn.com/cbowen/archive/2009/02/09/announcing-new-england-code-camp-11.aspx"&gt;New England Code Camp&lt;/a&gt;.&amp;#160; I’ll be up there tomorrow night (3/27/2009) looking for something to do.&amp;#160; Shoot me a message on twitter (a tweet) if you’re in the area!&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7004782" width="1" height="1"&gt;</content><author><name>tony_lombardo</name><uri>http://weblogs.asp.net/members/tony_5F00_lombardo.aspx</uri></author><category term="community" scheme="http://weblogs.asp.net/tonylombardo/archive/tags/community/default.aspx" /></entry><entry><title>ViewState 101</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/tonylombardo/archive/2009/03/24/viewstate-101.aspx" /><id>http://weblogs.asp.net/tonylombardo/archive/2009/03/24/viewstate-101.aspx</id><published>2009-03-24T19:11:37Z</published><updated>2009-03-24T19:11:37Z</updated><content type="html">&lt;p&gt;One of the most common complaints I hear about the Infragistics tools is “there’s so much ViewState, it’s bloated!”.&amp;#160; One of the most common questions I hear is not surprisingly, “How do I reduce the ViewState?”.&amp;#160; Before I jump into the answer (which is a simple “turn it off”), I want to discuss what ViewState is.&lt;/p&gt;  &lt;p&gt;ViewState is an encoded string that is actually a list of serialized properties and values for a given control.&amp;#160; Viewstate is how ASP.NET knows if a property has changed between postbacks.&amp;#160; Suppose I had a textbox and I wanted to change the background color to red when the user clicks on a button.&amp;#160; Easy task right?&amp;#160; Well, what happens if the user then clicks on a different button.&amp;#160; How does the application know to make the textbox red again?&amp;#160; The button click code isn’t going to fire again, and the Page no longer exists on the server (it’s torn down and re-created with each request/postback).&amp;#160; The fact that the background should now be read has to be stored somewhere – that somewhere is ViewState.&amp;#160; Here’s some code:&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:385193f1-94f4-470f-b80b-962e50b1bda4" class="wlWriterEditableSmartContent"&gt;&lt;pre name="code" class="xml"&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %&amp;gt;

&amp;lt;%@ Register Assembly="Infragistics35.WebUI.WebDataInput.v8.3, Version=8.3.20083.1002, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
    Namespace="Infragistics.WebUI.WebDataInput" TagPrefix="igtxt" %&amp;gt;

&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;

&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;
&amp;lt;head runat="server"&amp;gt;
    &amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;form id="form1" runat="server"&amp;gt;
    &amp;lt;div&amp;gt;
        &amp;lt;igtxt:WebNumericEdit ID="WebNumericEdit1" runat="server"&amp;gt;
        &amp;lt;/igtxt:WebNumericEdit&amp;gt;
        &amp;lt;asp:Button runat="server" Text="Red" OnClick="TurnRed" /&amp;gt;
        &amp;lt;asp:Button runat="server" Text="Submit" /&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:1f4f95b0-c058-435e-9d47-b14e52462802" class="wlWriterEditableSmartContent"&gt;&lt;pre name="code" class="c#"&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void TurnRed(object sender, EventArgs e)
    {
        this.WebNumericEdit1.BackColor = Color.Red;
    }
}&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Clicking on the “Red” button turns the background of my textbox red.&amp;#160; Then if I click on the “Submit” button and force a postback, the textbox background remains red.&amp;#160; We often just take for granted that this works, but it’s ViewState that makes this work.&amp;#160; Look at the HTML source in your browser and you’ll see something like:&lt;/p&gt;

&lt;p&gt;&amp;lt;input type=”hidden” name=”__VIEWSTATE” value=”…..” /&amp;gt;&amp;#160; The ViewState is stored as a string value in a hidden field, and it keeps track of all changes made at runtime to a particular object.&amp;#160; When you set the backcolor to Red on the WebNumericEdit, that information gets encoded into the value seen in the __VIEWSTATE field.&amp;#160; The next time the page is posted back, the control peeks into the __VIEWSTATE field and re-serializes itself based on what it finds.&amp;#160; Let’s take a look at the example code above.&amp;#160; When the page initially loads, this is what the __VIEWSTATE field looks like:&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:b2b9657e-17dc-46dd-aaf2-7a77359dbd03" class="wlWriterEditableSmartContent"&gt;&lt;pre name="code" class="xml"&gt;&amp;lt;INPUT id=__VIEWSTATE value=/wEPDwUKLTIyOTMwMjU4MmQYAQUeX19Db250
cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFgEFD1dlYk51bWVyaWNFZGl0MROii26o
a0DVPVO5sgHn/KcNr5fL type=hidden name=__VIEWSTATE&amp;gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;That’s not very telling, so lets use a tool to decode this into clear text.&amp;#160; You can download &lt;a href="http://www.pluralsight.com/community/media/p/51688.aspx"&gt;ViewState Decoder&lt;/a&gt; which is what I’m using below.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/tonylombardo/image_44C15D3D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/tonylombardo/image_thumb_6B234088.png" width="640" height="377" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Notice that there’s not really anything of note in the ViewState except for what looks like some sort of identifier key.&amp;#160; Now let's click on the Red Button and see what we get.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/tonylombardo/image_0A65E75C.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/tonylombardo/image_thumb_305B97B2.png" width="640" height="442" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Notice there’s now an entry for a Color [Red].&amp;#160; If this value was not included in the __VIEWSTATE field, the next time the Page posted back, the background color would reset to White (the default).&amp;#160; To understand more about how this works, lets take a look at the control lifecyle.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/tonylombardo/image_16876183.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/tonylombardo/image_thumb_6EE0E558.png" width="533" height="480" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;The first phase after a Page is requested is the Init, where the objects are created from the ASPX markup.&amp;#160; After the Init the ViewState is “rehydrated” (deserialized) and the values are loaded into the appropriate controls/properties.&amp;#160; &lt;/p&gt;

&lt;p&gt;Note: This is a simplified model.&amp;#160;&amp;#160; There are additional steps like loading ControlState, and firing Events that I’ve left out for clarity.&amp;#160; &lt;/p&gt;

&lt;p&gt;Notice that the last step before Render is “SaveViewState”.&amp;#160; When this method is called, every property that was ‘dirtied’ during the Page_Load will be persisted into the Value attribute of the __VIEWSTATE hidden field.&amp;#160; Yes, I said – EVERY property.&amp;#160; That’s the drawback of using ViewState, and the reason why it’s important to understand how it functions.&lt;/p&gt;

&lt;p&gt;If you’re used to putting all of your initialization code in the Page_Load, inside of an if statement that checks that it’s not a PostBack, chances are &lt;strong&gt;you don’t need ViewState&lt;/strong&gt;.&amp;#160; Removing the if statement and having that code execute on each Page_Load will allow you to &lt;strong&gt;set EnableViewState=False&lt;/strong&gt; on a particular control, or even the entire Page.&amp;#160; The only case this doesn’t cover is the “I want to change the background-color of my TextBox to red on a Button Click”.&amp;#160; &lt;/p&gt;

&lt;p&gt;So you’ve read this far, I’m guessing you want an answer to the questions at the top?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; “Why is the ViewState field so big for Infragistics controls!?”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A:&lt;/strong&gt; The size of the ViewState field is directly dependent on the number of properties you’re setting – as per the definition of ViewState.&amp;#160; We’ve gone to great lengths to ensure that each property of our components participates in the ViewState lifecycle.&amp;#160; That means if you set 200 properties in your Page_Load, 200 properties will end up in ViewState, just as you &lt;em&gt;should&lt;/em&gt; expect.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; “Do I need ViewState?”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A:&lt;/strong&gt; The short answer is no.&amp;#160; In the scenarios above, I highlighted when and where you would want to use ViewState.&amp;#160; Infragistics controls are meant to work with or without ViewState.&amp;#160; If you don’t need to support the “I want to change the background-color of my TextBox to red on a Button Click” scenario, you can simply turn off ViewState.&amp;#160; The only time I use ViewState is when I forget to turn it off.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; “How do I reduce the ViewState?”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A:&lt;/strong&gt; Turn it off.&amp;#160; There’s no in between for ViewState*, a control either tracks ViewState or it doesn’t.&amp;#160; Even though controls don’t need ViewState to function, it’s turned on by default for every control (as part of the .NET Framework).&amp;#160; Set EnableViewState=False on the control or Page level to turn off ViewState tracking. &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;*This brings me to one last topic, and one that takes the ViewState model to a whole new level – Grids.&amp;#160; The WebGrid has a commonly overlooked feature built into it where it can persist the entire datasource into ViewState.&amp;#160; Why do you need this you may ask?&amp;#160; When a grid is editable it needs to track the old value and the new value – that way it can fire the appropriate Update events and give you a chance to revert back to the ‘old’ value.&amp;#160; The old values can be persisted in ViewState in case your DataSource isn’t available the next time you post back.&amp;#160; There may be cases where you simply can’t fetch your DataSource on each postback (for performance reasons), or you manually populated the grid with data, and there is no “DataSource” to bind to.&amp;#160; In the WebGrid, you would turn off ViewState if you didn’t want the values to be persisted into the ViewState field.&amp;#160; Again, the default for all ASP.NET controls is to have ViewState enabled, so in your typical application you likely have this turned on (and you most likely don’t even need it).&amp;#160; &lt;/p&gt;

&lt;p&gt;In the WebDataGrid we’ve made the ViewState serialization more granular and added a property to &lt;a href="http://help.infragistics.com/Help/NetAdvantage/NET/2008.3/CLR3.5/html/WebDataGrid_Getting_Started_with_WebDataGrid_EnableDataViewState_Property.html"&gt;EnableDataViewState&lt;/a&gt;.&amp;#160; The property is self explanatory I think, but just to be clear – set this to True if you want to embed your data into ViewState, set it to False to keep data out of ViewState.&amp;#160; BTW, If you haven’t seen the WebDataGrid yet, go &lt;a href="http://community.infragistics.com/search/SearchResults.aspx?q=webdatagrid"&gt;check it out now&lt;/a&gt;!&amp;#160; &lt;/p&gt;

&lt;p&gt;So the next time someone says “The ViewState is too big”, not only can you save the day by showing them how to turn it off, but you can also explain how ViewState works and why it's there in the first place.&amp;#160; &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6996698" width="1" height="1"&gt;</content><author><name>tony_lombardo</name><uri>http://weblogs.asp.net/members/tony_5F00_lombardo.aspx</uri></author><category term="ASP.NET" scheme="http://weblogs.asp.net/tonylombardo/archive/tags/ASP.NET/default.aspx" /></entry><entry><title>March Craziness!</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/tonylombardo/archive/2009/03/19/march-craziness.aspx" /><id>http://weblogs.asp.net/tonylombardo/archive/2009/03/19/march-craziness.aspx</id><published>2009-03-19T22:02:30Z</published><updated>2009-03-19T22:02:30Z</updated><content type="html">&lt;p&gt;If you haven’t seen, there’s a ton of new downloads available from Microsoft.&amp;#160; IE8 has finally been &lt;a href="http://www.microsoft.com/windows/internet-explorer/?ocid=ie8_s_94735d11-65d1-4bb8-bf6f-72d7b059a928"&gt;released&lt;/a&gt;!&lt;/p&gt;  &lt;p&gt;There were also some nice announcements made at &lt;a href="http://live.visitmix.com/"&gt;Mix09&lt;/a&gt;.&amp;#160; Most anticipated was the Silverlight 3 features.&amp;#160; Some of the highlights are below.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://silverlight.net/getstarted/silverlight3/default.aspx"&gt;Silverlight 3&lt;/a&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Video &amp;amp; Audio enhancements (H.264 support!) &lt;/li&gt;    &lt;li&gt;Perspective 3D graphics &lt;/li&gt;    &lt;li&gt;Pixel Shader effects &lt;/li&gt;    &lt;li&gt;Dynamic Styles with Inheritance (cascading Styles) &lt;/li&gt;    &lt;li&gt;Element to Element binding &lt;/li&gt;    &lt;li&gt;Data Validation &lt;/li&gt;    &lt;li&gt;RIA Services support &lt;/li&gt;    &lt;li&gt;Out of Browser Capabilities &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;That’s an impressive list.&amp;#160; If I were to pick some of my favorites, it would have to be improved Data Binding support and Out of Browser Capabilities.&amp;#160; From day one when I heard the plans for Silverlight, all I could think of was how the browser was just this lame shell used to launch the application.&amp;#160; I guess the folks at Microsoft were thinking the same thing.&amp;#160; Plus, you don’t have to worry about back button support anymore.. ;)&lt;/p&gt;  &lt;p&gt;I installed SL3 bits today, as well as IE8.&amp;#160; I already experienced a crash in IE8, which is strange, and I’m not yet ready to blame IE but I’ll certainly have to do some more diagnostics.&amp;#160; Haven’t had a chance to build with SL3 yet.&amp;#160; My only complaint so far is that the install is SLOW.&amp;#160; Actually the uninstall for SL2 Tools seemed to be really slow, the Install for SL3 tools was just slow.&amp;#160; I’ll keep you posted!&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6980479" width="1" height="1"&gt;</content><author><name>tony_lombardo</name><uri>http://weblogs.asp.net/members/tony_5F00_lombardo.aspx</uri></author></entry><entry><title>Best Practices on Best Practices?</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/tonylombardo/archive/2009/03/11/best-practices-on-best-practices.aspx" /><id>http://weblogs.asp.net/tonylombardo/archive/2009/03/11/best-practices-on-best-practices.aspx</id><published>2009-03-11T20:19:02Z</published><updated>2009-03-11T20:19:02Z</updated><content type="html">&lt;p&gt;So the other day I was helping out a coworker on a project and was taken aback by the complexity of the project.&amp;#160; I was expecting a hacky WinForms app with a single form and one monolithic method.&amp;#160; Instead, I saw an organized solution with 6 projects, including a test project.&amp;#160; It took me a good 30 minutes to follow through the logic from one class to the next, across projects and assemblies.&amp;#160; This of course made me feel dumb, so my first reaction was – this project is too complex!&amp;#160; &lt;/p&gt;  &lt;p&gt;So while discussing the project with some others to get ideas of what could be wrong, I happened to say - “there’s a time and a place for best practices”.&amp;#160; There was a moment of silence and then I got looks like I had just walked into a courtroom wearing a blue velour suit.&amp;#160; Because of the various reactions, I thought this would be a good topic to discuss with you.&lt;/p&gt;  &lt;p&gt;I’ve always been a believer in the “do what it takes to get the job done” camp.&amp;#160; I like to follow best practices until they get in the way.&amp;#160; There, I said it..&amp;#160; I’m not going to hide it anymore!&amp;#160; I believe that a “best practice”, just like most patterns has a certain solution set that it’s best fit for.&amp;#160; I’m not saying throw caution to the wind and forego every bit of programming common sense, but would I use MVVM the next time I want to write a quick utility application?&amp;#160; Probably not.&amp;#160; I follow a rule of thumb – if the pattern I’m using is more complex than the solution the software is supposed to be providing, I’m not going to use it.&amp;#160; It all boils down to ROI – what benefits do I get by following this pattern and how much is it going to cost me to do it?&amp;#160; &lt;/p&gt;  &lt;p&gt;Here’s a perfect example.&amp;#160; MVC is getting a lot of buzz right now, and seems like a good solution for a certain set of applications.&amp;#160; Does that make it better than ASP.NET’s classic MVP pattern?&amp;#160; I’ve grown fond of the idea of dropping a control on a form, writing a couple lines of code and being done.&amp;#160; Am I about to dump all of that because MVC is the new hot pattern?&amp;#160; I think you know the answer to that already.&amp;#160; That’s not to say MVC isn’t useful – as I said earlier there is a problem/solution set that MVC is perfect for.&amp;#160; It just turns out, that’s not the problem set I’m normally involved in..&lt;/p&gt;  &lt;p&gt;So what do you think about all of this?&amp;#160; Are you a pattern / best practices follower?&amp;#160; Have you found certain ones worthwhile, or vowed never to use a one (or many) ever again?&amp;#160; Leave your thoughts in the comments.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6955417" width="1" height="1"&gt;</content><author><name>tony_lombardo</name><uri>http://weblogs.asp.net/members/tony_5F00_lombardo.aspx</uri></author><category term="ASP.NET" scheme="http://weblogs.asp.net/tonylombardo/archive/tags/ASP.NET/default.aspx" /></entry></feed>