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

<channel>
	<title>dougv.com « Doug Vanderweide &#187; Programming</title>
	<atom:link href="http://www.dougv.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dougv.com</link>
	<description>ASP.NET, PHP, XML, JavaScript, DOM, Web geekery</description>
	<lastBuildDate>Sat, 04 Feb 2012 22:03:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Tumblr Mangles Developer Relations</title>
		<link>http://www.dougv.com/2012/01/01/tumblr-mangles-developer-relations/</link>
		<comments>http://www.dougv.com/2012/01/01/tumblr-mangles-developer-relations/#comments</comments>
		<pubDate>Sun, 01 Jan 2012 19:15:53 +0000</pubDate>
		<dc:creator>Doug Vanderweide</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Business]]></category>
		<category><![CDATA[Customer Relations]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[blogs]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[MySpace]]></category>
		<category><![CDATA[Privacy]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[tumblr]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[WebKit]]></category>

		<guid isPermaLink="false">http://www.dougv.com/?p=4060</guid>
		<description><![CDATA[Last week I logged on to Tumblr and was confronted with this abomination: Needless to say, this is pretty disturbing, and I wonder what Tumblr is thinking by posting this. Background Some background: Tumblr is a blogging site, with social media overtones. Basically, you can easily follow other bloggers&#8217; posts through a dashboard / search [...]<div class="yarpp">
	<h5>Related Posts</h5>
		
No related posts.
	</div>
]]></description>
			<content:encoded><![CDATA[<p>Last week I logged on to <a href="http://www.tumblr.com" target="_blank">Tumblr</a> and was confronted with this abomination:</p>
<div id="attachment_4061" class="wp-caption alignnone" style="width: 673px"><img class="size-full wp-image-4061 " title="missing e notice from tumblr" src="http://www.dougv.com/wp-content/uploads/2012/01/Untitled1.jpg" alt="missing e notice from tumblr" width="663" height="672" /><p class="wp-caption-text">Missing e notice from tumblr. Way to encourage API development, guys.</p></div>
<p>Needless to say, this is pretty disturbing, and I wonder what Tumblr is thinking by posting this.</p>
<h3><span id="more-4060"></span>Background</h3>
<p>Some background: <a href="http://www.tumblr.com/about" target="_blank">Tumblr is a blogging site</a>, with <a href="http://www.tumblr.com/why-tumblr" target="_blank">social media overtones</a>. Basically, you can easily follow other bloggers&#8217; posts through a dashboard / search posts via tags, and it&#8217;s quite easy to repost material you find on other blogs.</p>
<p>Like most other major providers, <a href="http://www.tumblr.com/docs/en/api/v2" target="_blank">Tumblr maintains an API</a>. Until last year, it was mostly restricted to retrieving and submitting posts; it was recently expanded to allow some manipulation of blog settings and managing followers.</p>
<p>I like Tumblr a lot. I&#8217;ll go on a couple of times a day, and like most other Tumblr blogs, <a href="http://dougv.info/" target="_blank">my blog</a> is mostly reposts; it&#8217;s where I&#8217;ll dump links / reposts of things I see on the Web that I want to share.</p>
<p><a href="http://missinge.infraware.ca/" target="_blank">Missing e</a> has been around for a while. It&#8217;s a browser add-on for Webkit-enabled browsers; as its name implies, it leverages the API with some neat features that aren&#8217;t directly available through Tumblr itself.</p>
<p>For example, Tumblr has a lot of image posts. Missing e includes a magnifier feature that lets one see a full-sized image right from his dashboard, rather than having to engage in the several clicks it takes to see a full-sized image. Missing e also lets me more easily reblog items (including the automatic addition of tags to reblogged posts), manage my post queue, and otherwise make Tumblr easier to use.</p>
<p>I should note that I don&#8217;t know the developer of this plugin personally, nor have I spoken to him about this notice. (I have <a href="http://blog.missinge.infraware.ca/post/15090130182/tumblrs-support-problem-with-missing-e-repeated" target="_blank">read his response</a> to this outrage, however, and I find it remarkably calm, fair and responsible.) I don&#8217;t know if Tumblr has contacted him about its concerns or tried working with him on those issues (reading the developer&#8217;s responses, it sure sounds like they haven&#8217;t).</p>
<p>I also haven&#8217;t contacted Tumblr about this. I&#8217;m not interested in hearing whatever nonsense they intend to proffer as justification. I know what I read and I know how I feel about it as an API developer.</p>
<p>To Tumblr&#8217;s credit, they haven&#8217;t cut off API access to the plugin, which was certainly <a title="The Danger Of API Development: Making Something Too Good" href="http://www.dougv.com/2011/03/22/the-danger-of-api-development-making-something-too-good/" target="_blank">an option others might have pursued</a>. It wouldn&#8217;t surprise me if a number of Tumblr users can&#8217;t tell where Tumblr ends and missing e begins, and thus they are swamped with support requests they can&#8217;t do much about. And it does make sense to me that missing e uses a lot of resources to accomplish its tasks.</p>
<h3>A Completely Wrong-Headed Approach</h3>
<p>That&#8217;s where my empathy for Tumblr&#8217;s plight ends.</p>
<p>First, <a href="http://royal.pingdom.com/2011/12/15/the-most-reliable-and-unreliable-blogging-services-of-2011/" target="_blank">Tumblr&#8217;s reliability</a>, both in terms of its primary service and its API uptime, <a href="http://stats.pingdom.com/wx4vra365911/23773/history" target="_blank">rivals Twitter</a> for embarrassingly inadequate. (At least Twitter has the common sense to not blame third-party developers for their failure to stay up.)</p>
<p>That&#8217;s on Tumblr alone. It&#8217;s up to them to keep their service running.</p>
<p>I especially find odious the insinuations contained in this notice. While missing e is, in the base definition, a &#8220;hack&#8221; of Tumblr, the tone of this message suggests that the plugin isn&#8217;t well-written and may be up to no good.</p>
<p>Well, <a href="https://github.com/jcutler/Missing-E" target="_blank">you can go to GitHub and look at the code yourself</a>. Yes, it sends data to intermediary servers. Yes, it is technically possible for missing e to steal a user&#8217;s Tumblr credentials, to track Tumblr users&#8217; activities, to obtain personally identifiable information, etc.</p>
<p>Let me be clear: <a href="http://blog.hiramiya.me/post/15081113653" target="_blank">I agree with another user</a> that missing e in no way compromises user information right now. However, it could do so, by virtue of being a browser add-on; to that extent, the notice Tumblr posted is accurate, as they don&#8217;t directly accuse missing e of privacy violations, but do note it is possible for browser plugins to capture information a user never anticipated having captured.</p>
<p>Absent proof that there is an intention behind missing e to do that specifically, and to use such information for nefarious purposes &#8212; evidence Tumblr clearly could provide, if it existed &#8212; I find the tone of this note beyond insulting; it&#8217;s chilling.</p>
<p>My interpretation of this notice is, &#8220;We don&#8217;t like missing e. We&#8217;d just as soon ban it. But that&#8217;s not very Web 2.0 and it&#8217;s likely to generate PR static. So we&#8217;ll scare you, push you toward getting rid of it, then continue to serve those who want to use it.&#8221;</p>
<p>That&#8217;s being a dick. That&#8217;s being lazy. That&#8217;s being stupid.</p>
<h3><img class="alignright size-medium wp-image-4066" title="tumblr_logo" src="http://www.dougv.com/wp-content/uploads/2012/01/tumblr_logo-350x91.png" alt="" width="350" height="91" />A Proper Response</h3>
<p>Were I in charge at Tumblr, we&#8217;d be going about this in an entirely different way.</p>
<ul>
<li>The first thing we would have done is offered the guy who wrote missing e a job.</li>
<li>If not that, we would have offered to buy missing e outright.</li>
<li>And if that didn&#8217;t pan out, we&#8217;d ask missing e users to rate its features, then build those into our platform.</li>
</ul>
<p>Because what does Tumblr&#8217;s approach to this issue say? It says, &#8220;We aren&#8217;t interested in the reasons why missing e is a problem for us. We don&#8217;t care about our end users and why so many of them are using this plugin. It&#8217;s not that our product is inferior, and someone has made it better; it&#8217;s that we have what we have, and even though it can clearly be better, we&#8217;re more interested in the status quo.&#8221;</p>
<p>Or, as I&#8217;ll coin it, <a href="http://www.fool.com/investing/general/2011/07/03/this-is-what-really-killed-myspace.aspx" target="_blank">The MySpace Response</a>: &#8220;Do what you like, so long it fits in our picture of our service.&#8221;</p>
<p>You saw how well that worked out for them.</p>
<p>I don&#8217;t suspect this blog post will cause any change whatsoever in Tumblr&#8217;s approach. I simply want to lament what is an absurd and insulting response to a relatively minor problem by a company that I expected knew better than that.</p>
<p>If Google brought you here because you&#8217;re worried about that notice, suffice it to say that I looked at the missing e code and, as of this writing, I see nothing there to be concerned about.</p>
<p>I do, however, see a lot to be concerned about in Tumblr&#8217;s handling of this matter.</p>
<p>All links in this post on delicious: <a href="http://delicious.com/dougvdotcom/tumblr-mangles-developer-relations" target="_blank">http://delicious.com/dougvdotcom/tumblr-mangles-developer-relations</a></p>
<div class="yarpp">
	<h5>Related Posts</h5>
		<p>No related posts.</p>
	</div>

	Tags: <a href="http://www.dougv.com/tag/blogs/" title="blogs" rel="tag">blogs</a>, <a href="http://www.dougv.com/tag/google/" title="Google" rel="tag">Google</a>, <a href="http://www.dougv.com/tag/myspace/" title="MySpace" rel="tag">MySpace</a>, <a href="http://www.dougv.com/tag/privacy/" title="Privacy" rel="tag">Privacy</a>, <a href="http://www.dougv.com/tag/rest/" title="REST" rel="tag">REST</a>, <a href="http://www.dougv.com/tag/tumblr/" title="tumblr" rel="tag">tumblr</a>, <a href="http://www.dougv.com/tag/twitter/" title="Twitter" rel="tag">Twitter</a>, <a href="http://www.dougv.com/tag/webkit/" title="WebKit" rel="tag">WebKit</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.dougv.com/2012/01/01/tumblr-mangles-developer-relations/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Parent-Child DropDownList Controls In ASP.NET Web Forms (VB.NET)</title>
		<link>http://www.dougv.com/2011/12/25/parent-child-dropdownlist-controls-in-asp-net-web-forms-vb-net/</link>
		<comments>http://www.dougv.com/2011/12/25/parent-child-dropdownlist-controls-in-asp-net-web-forms-vb-net/#comments</comments>
		<pubDate>Sun, 25 Dec 2011 20:44:40 +0000</pubDate>
		<dc:creator>Doug Vanderweide</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Dot Net]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Stored Procedures]]></category>
		<category><![CDATA[Transact-SQL]]></category>
		<category><![CDATA[VB.NET]]></category>
		<category><![CDATA[Web Forms]]></category>
		<category><![CDATA[drop down lists]]></category>
		<category><![CDATA[select lists]]></category>
		<category><![CDATA[web forms]]></category>
		<category><![CDATA[zip code database]]></category>

		<guid isPermaLink="false">http://www.dougv.com/?p=3950</guid>
		<description><![CDATA[Some time ago I promised a formspring anon I would do a tutorial on parent / child DropDownList controls in ASP.NET Web Forms. At long last, I&#8217;m delivering. (From here on out, I will use &#8220;DropDownList&#8221; and &#8220;select list&#8221; interchangeably.) Parent-child DropDownList controls means you have a parent, or main / master select list. Based [...]<div class="yarpp">
	<h5>Related Posts</h5>
		<ol>
				<li><a href="http://www.dougv.com/2011/04/24/automatically-hash-tagging-text-with-asp-net-web-forms-vb-net/" rel="bookmark">Automatically Hash Tagging Text With ASP.NET Web Forms (VB.NET)</a> (29.7)</li>
				<li><a href="http://www.dougv.com/2009/02/07/revisited-adding-non-selectable-listitem-controls-to-an-aspnet-databound-list-control/" rel="bookmark">Revisited: Adding Non-Selectable ListItem Controls To An ASP.NET DataBound List Control</a> (23.5)</li>
				<li><a href="http://www.dougv.com/2009/06/21/parent-child-select-lists-revisited-multiple-parent-child-select-lists-via-php-mysql-and-jquery/" rel="bookmark">Parent &#8211; Child Select Lists Revisited: Multiple Parent &#8211; Child Select Lists Via PHP, MySQL And jQuery</a> (23.3)</li>
			</ol>
	<p class="note">The numbers inside parentheses are relevance scores. Scoring is based, in order of priority, on title, category, content and tags. The higher the score, the more likely that post relates to this post.
	</div>
]]></description>
			<content:encoded><![CDATA[<p>Some time ago I <a title="binding a data from database to dropdownlist based on selected item of another dropdown list" href="http://www.dougv.com/2011/10/10/binding-a-data-from-database-to-dropdownlist-based-on-selected-item-of-another-dropdown-list/">promised a formspring anon</a> I would do a tutorial on parent / child DropDownList controls in ASP.NET Web Forms. At long last, I&#8217;m delivering. (From here on out, I will use &#8220;DropDownList&#8221; and &#8220;select list&#8221; interchangeably.)</p>
<div class="aside">Parent-child <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.dropdownlist.aspx" target="_blank">DropDownList controls</a> means you have a parent, or main / master select list. Based on whatever selection is made in that first DropDownList, a second, &#8220;child&#8221; or &#8220;detail&#8221; select list is populated with relevant results.For example, if we had a database of cars, we might have a parent (master) DropDownList of manufacturers &#8212; Ford, Chevy, Toyota, etc. &#8212; and populate the child DropDownList with models from the selected manufacturer. So, if someone chose Ford in the parent select list, the child select list would automatically populate with choices such as Fusion, Mustang, Explorer, F-150, etc.</div>
<p>I&#8217;ll be demonstrating two different ways to accomplish this task, as well as a few variations on the first: First, binding with only <a href="http://msdn.microsoft.com/en-us/library/dz12d98w%28v=VS.100%29.aspx" target="_blank">SqlDataSource controls</a>, which is by far the easiest way to proceed and will suffice for about 90 percent of applications; second, using code behind and <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.comparevalidator.aspx" target="_blank">CompareValidator controls</a>, to cover all possible roadblocks.</p>
<p>Some notes before we proceed:</p>
<ul>
<li>I&#8217;ll use the <a title="Getting All ZIP Codes In A Given Radius From A Known Point / ZIP Code Via PHP And MySQL" href="http://www.dougv.com/2009/03/27/getting-all-zip-codes-in-a-given-radius-from-a-known-point-zip-code-via-php-and-mysql/" target="_blank">ZIP Code database</a> I&#8217;ve been using for a while as the back-end data. I also have a separate table of USPS state codes I&#8217;m using as the parent data, to help illustrate that you can use several tables / data sources to fuel this solution, provided the keys that relate the data make sense to each data store. In other words, you can use a lot of different sources for your data, so long as the data is <a href="http://computer.howstuffworks.com/question599.htm" target="_blank">relational</a>.</li>
<li>I&#8217;m going to use SQL Server, stored procedures and a connection string stored in my web.config file to access my data. I recognize that some people prefer to use SQL statements / LINQ and the like, or can only use Access / MySQL or other data stores. I really urge you to always use stored procedures, as they <a href="https://www.owasp.org/index.php/SQL_Injection_Prevention_Cheat_Sheet#Defense_Option_1:_Prepared_Statements_.28Parameterized_Queries.29" target="_blank">are way safer than inline SQL statements</a>. As far as alternative data stores go, that should be a easy a fix as switching your code to use to the relevant <a href="http://msdn.microsoft.com/en-us/library/32c5dh3b%28v=VS.100%29.aspx" target="_blank">ADO.NET ODBC classes</a>, rather than the SQL Client classes.</li>
<li>This solution should work for ASP.NET versions 2.0 forward.</li>
</ul>
<p><span id="more-3950"></span><br />
<h3>Example 1: Using SqlDataSource Controls</h3>
<p>Most ASP.NET Web developers know about the SqlDataSource control and how to databind a DropDownList with that control. What they may not know is that, via the <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.controlparameter.aspx" target="_blank">ControlParameter class</a>, we can use the values in any other ASP.NET control(s) &#8212; including other databound controls &#8212; on the page as query parameters.</p>
<p>All you need to do is indicate, as properties of the ControlParameter, the ID of the control that will provide the key value for your child query, the property of that control (e.g., selected value, text, etc.) which should serve as the key, and the variable name that should be used in that query.</p>
<p>In our example, I have a select list named ddlParent, which will contain a list of state codes I get from a database table. Another select list, named ddlChild, will bind to a SqlDataSource control (named sqlChildDDL) that uses the selected value in ddlParent to retrieve proper records. </p>
<p>In my case, the stored procedure that will get the child records expects a parameter named &#8220;StateInitials&#8221;, the value of which comes from ddlParent and serves as the key for selecting the proper child records. By setting the <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.listcontrol.autopostback.aspx" target="_blank">AutoPostBack property</a> of the parent DropDownList to true, I ensure the child DropDownList is rebound with the proper records each time the selected index of the parent list is changed.</p>
<pre class="brush: xml; title: ; notranslate">&lt;asp:Label runat=&quot;server&quot; ID=&quot;lblParent&quot; Text=&quot;Select A State: &quot; /&gt;
&lt;!-- parent ddl --&gt;
&lt;asp:DropDownList runat=&quot;server&quot; ID=&quot;ddlParent&quot; DataSourceID=&quot;sqlParentDDL&quot; DataValueField=&quot;StateCode&quot; DataTextField=&quot;StateName&quot; AutoPostBack=&quot;true&quot; /&gt;
&lt;!-- parent ddl is populated with a parameterless SQL query --&gt;
&lt;asp:SqlDataSource runat=&quot;server&quot; ID=&quot;sqlParentDDL&quot; SelectCommand=&quot;GetStates&quot; SelectCommandType=&quot;StoredProcedure&quot; ConnectionString=&quot;&lt;%$ ConnectionStrings:MyConnection %&gt;&quot; /&gt;
&lt;br /&gt;
&lt;!-- child ddl --&gt;
&lt;asp:Label runat=&quot;server&quot; ID=&quot;lblChild&quot; Text=&quot;Select A Town: &quot; /&gt;
&lt;asp:DropDownList runat=&quot;server&quot; ID=&quot;ddlChild&quot; DataSourceID=&quot;sqlChildDDL&quot; DataValueField=&quot;ZIPCode&quot; DataTextField=&quot;CityName&quot; /&gt;
&lt;!-- child ddl gets its parameter value from the selected value of the parent ddl --&gt;
&lt;!--
    ControlParamter property values
    ControlID: The ASP.NET control that is providing the paramter's value
    Name: The parameter's name as it appears in your stored procedure / SQL query
    PropertyName: The property of the ASP.NET control that will supply the value to your parameter
--&gt;
&lt;asp:SqlDataSource runat=&quot;server&quot; ID=&quot;sqlChildDDL&quot; SelectCommand=&quot;GetZIPCodes&quot; SelectCommandType=&quot;StoredProcedure&quot; ConnectionString=&quot;&lt;%$ ConnectionStrings:MyConnection %&gt;&quot;&gt;
    &lt;SelectParameters&gt;
        &lt;asp:ControlParameter ControlID=&quot;ddlParent&quot; Name=&quot;StateInitials&quot; PropertyName=&quot;SelectedValue&quot; /&gt;
    &lt;/SelectParameters&gt;
&lt;/asp:SqlDataSource&gt;</pre>
<p>Demo: <a href="http://dougv.net/demos/parent_child_dropdown/Example1A.aspx" target="_blank">http://dougv.net/demos/parent_child_dropdown/Example1A.aspx</a></p>
<div class="aside">Note that we can use any ASP.NET control on the page as a ControlParamter, and we can use any of that control&#8217;s properties as a parameter value, regardless of data type. </p>
<p>In other words, we could have a textbox on the page and use its Text property to let people type in free-text terms. (That&#8217;s a huge security risk, but it can be done.) </p>
<p>Or we could even use a static control with a non-text property, such as the <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.control.parent.aspx" target="_blank">Parent value of a Label control</a>. </p>
<p>Of course, we need to exercise care here; any parameter value we send to a database query has to be the right data type / something the database store understands how to parse. The point is, ControlParamter is a powerful tool; respect it and it will open a number of possibilities.</p></div>
<p>Now that we have a parent-child select lists pair, how do we use that data to power some other control&#8217;s data? Simple: We just use the <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.listcontrol.selectedvalue.aspx" target="_blank">SelectedValue</a> of the child DropDownList as the ControlParamter value for another SqlDataSource &#8212; in this example, it will bind to a <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.aspx" target="_blank">GridView</a> that gives the selected town&#8217;s ZIP Code, CityLatitude and CityLongitude.</p>
<p>All we need to do is add the GridView and its SqlDataSource, plus set the AutoPostBack property for ddlChild to true, so that the GridView&#8217;s values will change any time ddlChild&#8217;s selected index is changed.</p>
<pre class="brush: xml; title: ; notranslate">&lt;asp:Label runat=&quot;server&quot; ID=&quot;lblParent&quot; Text=&quot;Select A State: &quot; /&gt;
&lt;!-- parent ddl --&gt;
&lt;asp:DropDownList runat=&quot;server&quot; ID=&quot;ddlParent&quot; DataSourceID=&quot;sqlParentDDL&quot; DataValueField=&quot;StateCode&quot; DataTextField=&quot;StateName&quot; AutoPostBack=&quot;true&quot; /&gt;
&lt;!-- parent ddl is populated with a parameterless SQL query --&gt;
&lt;asp:SqlDataSource runat=&quot;server&quot; ID=&quot;sqlParentDDL&quot; SelectCommand=&quot;GetStates&quot; SelectCommandType=&quot;StoredProcedure&quot; ConnectionString=&quot;&lt;%$ ConnectionStrings:MyConnection %&gt;&quot; /&gt;
&lt;br /&gt;
&lt;!-- child ddl --&gt;
&lt;asp:Label runat=&quot;server&quot; ID=&quot;lblChild&quot; Text=&quot;Select A Town: &quot; /&gt;
&lt;asp:DropDownList runat=&quot;server&quot; ID=&quot;ddlChild&quot; DataSourceID=&quot;sqlChildDDL&quot; DataValueField=&quot;ZIPCode&quot; DataTextField=&quot;CityName&quot; AutoPostBack=&quot;true&quot; /&gt;
&lt;!-- child ddl gets its parameter value from the selected value of the parent ddl --&gt;
&lt;!--
    ControlID: Name of the ASP.NET control that is providing the paramter's value
    Name: The name of the parameter in your stored procedure / SQL query
    PropertyName: The property of the control, specified in ControlID, that will supply the value to your query, specified in Name
--&gt;
&lt;asp:SqlDataSource runat=&quot;server&quot; ID=&quot;sqlChildDDL&quot; SelectCommand=&quot;GetZIPCodes&quot; SelectCommandType=&quot;StoredProcedure&quot; ConnectionString=&quot;&lt;%$ ConnectionStrings:MyConnection %&gt;&quot;&gt;
    &lt;SelectParameters&gt;
        &lt;asp:ControlParameter ControlID=&quot;ddlParent&quot; Name=&quot;StateInitials&quot; PropertyName=&quot;SelectedValue&quot; /&gt;
    &lt;/SelectParameters&gt;
&lt;/asp:SqlDataSource&gt;
&lt;br /&gt;
&lt;br /&gt;

&lt;!-- A GridView to show the resuls --&gt;
&lt;asp:GridView runat=&quot;server&quot; ID=&quot;gvDetails&quot; DataSourceID=&quot;sqlZipDetails&quot; DefaultMode=&quot;ReadOnly&quot; CellPadding=&quot;5&quot; AutoGenerateColumns=&quot;false&quot;&gt;
    &lt;AlternatingRowStyle BackColor=&quot;LightGray&quot; /&gt;
    &lt;HeaderStyle BackColor=&quot;LightYellow&quot; Font-Bold=&quot;True&quot; HorizontalAlign=&quot;Center&quot; /&gt;
    &lt;Columns&gt;
        &lt;asp:BoundField HeaderText=&quot;City&quot; DataField=&quot;CityName&quot; /&gt;
        &lt;asp:BoundField HeaderText=&quot;State&quot; DataField=&quot;StateInitials&quot; /&gt;
        &lt;asp:BoundField HeaderText=&quot;ZIP Code&quot; DataField=&quot;ZIPCode&quot; /&gt;
        &lt;asp:BoundField HeaderText=&quot;Latitide&quot; DataField=&quot;CityLatitude&quot; /&gt;
        &lt;asp:BoundField HeaderText=&quot;Longitude&quot; DataField=&quot;CityLongitude&quot; /&gt;
    &lt;/Columns&gt;
&lt;/asp:GridView&gt;
&lt;!-- the GridView gets records based on the SelectedValue of ddlChild --&gt;
&lt;asp:SqlDataSource runat=&quot;server&quot; ID=&quot;sqlZipDetails&quot; SelectCommand=&quot;GetCityDetails&quot; SelectCommandType=&quot;StoredProcedure&quot; ConnectionString=&quot;&lt;%$ ConnectionStrings:MyConnection %&gt;&quot;&gt;
    &lt;SelectParameters&gt;
        &lt;asp:ControlParameter ControlID=&quot;ddlChild&quot; Name=&quot;ZIPCode&quot; PropertyName=&quot;SelectedValue&quot; /&gt;
    &lt;/SelectParameters&gt;
&lt;/asp:SqlDataSource&gt;</pre>
<p>See this in action: <a href="http://dougv.net/demos/parent_child_dropdown/Default.aspx" target="_blank">http://dougv.net/demos/parent_child_dropdown/Default.aspx</a></p>
<h3>Example 1B: A Little Code Behind To Clean Things Up</h3>
<p>If you play with the demo above, you&#8217;ll notice a problem: Any time you change the selected <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.listitem.aspx" target="_blank">ListItem</a> in ddlParent, the ListItems in ddlChild are updated, but not the data in the details GridView. </p>
<p>In other words, if you select a new state from the parent select list, the town values in the child select will change to the appropriate entries, but the GridView retains the old data from the previously selected town. Only choosing a new town from the child select list will update the GridView.</p>
<p>That happens because although ddlChild has been populated with new ListItems, the SelectedValue of ddlChild hasn&#8217;t been changed. Changing the SelectedValue is an act that must take place within ddlChild, not ddlParent. </p>
<p>In other words, the event that triggered the page to post back was a change in ddlParent&#8217;s selected value, <em>not</em> ddlChild. Until we explicitly instruct ddlChild to update its selected value, either programmatically or by hand, as far as ASP.NET is concerned, it retains the last SelectedValue, regardless of the fact that its ListItems have changed.</p>
<p>This behavior is by design and as it should be. But it does make for an annoyance we need to address.</p>
<p>Fortunately, we can fix this with just a little codebehind; namely, an event handler that fires on ddlParent&#8217;s OnSelectedIndexChanged event. That handler will:</p>
<ul>
<li>Rebind ddlChild to its SqlDataSource, which will now contain the correct town list.</li>
<li>Set the SelectedIndex of ddlChild to 0, or the first town in the new list.</li>
<li>Rebind the GridView&#8217;s SqlDataSource so it draws from the first town in the updated town list.</li>
</ul>
<pre class="brush: vb; title: ; notranslate">
Sub ddlParent_selectedIndexChanged(Sender As Object, E As EventArgs) Handles ddlParent.SelectedIndexChanged
	ddlChild.DataBind()
	ddlChild.SelectedIndex = 0
	sqlZipDetails.DataBind()
End Sub
</pre>
<p>Demo: <a href="http://dougv.net/demos/parent_child_dropdown/Example1B.aspx" target="_blank">http://dougv.net/demos/parent_child_dropdown/Example1B.aspx</a></p>
<p>This pretty much solves our data latency problem, but it adds duplicate queries to the process and thus is inefficient. We can do a better if we get more code-intensive.</p>
<h3>Example 2: Using Code Behind And CompareValidator Controls</h3>
<p>To streamline the process, reduce database queries and handle potentially bad inputs, we can use code behind to populate our DropDownLists and GridView, plus use CompareValidators to ensure we have legitimate data before sending our database queries.</p>
<p>We&#8217;ll bind records to a SqlDataReader, then use that reader to populate the DropDownLists and, where appropriate, the detail GridView. Additionally, we&#8217;ll use CompareValidators to ensure that the users have selected a valid option from each DropDownList. </p>
<p>First up, we need to create the DropDownLists and GridView. Notice that both DropDownLists begin with a single, default ListItem with a value of 0. </p>
<p>That&#8217;s because our valid options, once this list is populated, will never be zero; as a result, we can test with the CompareValidators whether the selected value of either DropDownList is 0. If it is, we know we have an invalid choice; otherwise, we expect the choice to be valid.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;asp:Label runat=&quot;server&quot; ID=&quot;lblParent&quot; Text=&quot;Select A State: &quot; /&gt;
&lt;asp:DropDownList runat=&quot;server&quot; ID=&quot;ddlParent&quot; AutoPostBack=&quot;true&quot;&gt;
    &lt;asp:ListItem Text=&quot;Select A State ...&quot; Value=&quot;0&quot; /&gt;
&lt;/asp:DropDownList&gt;
&lt;asp:CompareValidator runat=&quot;server&quot; ID=&quot;cvParent&quot; ControlToValidate=&quot;ddlParent&quot; ValueToCompare=&quot;0&quot; Operator=&quot;NotEqual&quot; ErrorMessage=&quot;Please select a valid option&quot; Display=&quot;Dynamic&quot; /&gt;
&lt;br /&gt;
&lt;asp:Label runat=&quot;server&quot; ID=&quot;lblChild&quot; Text=&quot;Select A Town: &quot; /&gt;
&lt;asp:DropDownList runat=&quot;server&quot; ID=&quot;ddlChild&quot; AutoPostBack=&quot;true&quot;&gt;
    &lt;asp:ListItem Text=&quot;Select A State First&quot; Value=&quot;0&quot; /&gt;
&lt;/asp:DropDownList&gt;
&lt;asp:CompareValidator runat=&quot;server&quot; ID=&quot;cvChild&quot; ControlToValidate=&quot;ddlChild&quot; ValueToCompare=&quot;0&quot; Operator=&quot;NotEqual&quot; ErrorMessage=&quot;Please select a valid option&quot; Display=&quot;Dynamic&quot; /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;asp:GridView runat=&quot;server&quot; ID=&quot;gvDetails&quot; CellPadding=&quot;5&quot; AutoGenerateColumns=&quot;false&quot;&gt;
    &lt;AlternatingRowStyle BackColor=&quot;LightGray&quot; /&gt;
    &lt;HeaderStyle BackColor=&quot;LightYellow&quot; Font-Bold=&quot;True&quot; HorizontalAlign=&quot;Center&quot; /&gt;
    &lt;Columns&gt;
        &lt;asp:BoundField HeaderText=&quot;City&quot; DataField=&quot;CityName&quot; /&gt;
        &lt;asp:BoundField HeaderText=&quot;State&quot; DataField=&quot;StateInitials&quot; /&gt;
        &lt;asp:BoundField HeaderText=&quot;ZIP Code&quot; DataField=&quot;ZIPCode&quot; /&gt;
        &lt;asp:BoundField HeaderText=&quot;Latitide&quot; DataField=&quot;CityLatitude&quot; /&gt;
        &lt;asp:BoundField HeaderText=&quot;Longitude&quot; DataField=&quot;CityLongitude&quot; /&gt;
    &lt;/Columns&gt;
&lt;/asp:GridView&gt;
</pre>
<p>We have several subroutines needed to power this solution. </p>
<p>First, we need to initially populate the parent DropDownList; we&#8217;ll do that in the Page_Load subroutine, checking whether this page is a postback. (We don&#8217;t want to repopulate the parent select list on every page refresh; if we do, we won&#8217;t ever be able to change the child select list&#8217;s values, since the selected index of the parent DropDownList becomes 0, automatically, every time it is databound.</p>
<pre class="brush: vb; title: ; notranslate">
Sub Page_Load(Sender As Object, E As EventArgs) Handles Me.Load
	If Not Page.IsPostBack Then
		ddlParent_dataBind()
	End If
End Sub
</pre>
<p>The process of binding the parent DropDownList is just connecting to the database server, populating a SqlDataReader with records, binding that to the parent DropDownList and indicating which fields should be used for text and values of the resulting ListItems.</p>
<pre class="brush: vb; title: ; notranslate">
Sub ddlParent_dataBind()
	Dim objConn As New SqlConnection(ConfigurationManager.ConnectionStrings(&quot;MyConnection&quot;).ConnectionString)
	Dim objCmd As New SqlCommand(&quot;GetStates&quot;, objConn)
	objCmd.CommandType = CommandType.StoredProcedure

	Dim objReader As SqlDataReader

	objConn.Open()
	objReader = objCmd.ExecuteReader()

	If Not objReader.HasRows Then
		ddlParent.Items.Clear()
		ddlParent.Items.Add(&quot;No records found.&quot;)
		ddlParent.Enabled = False
	Else
		ddlChild.Enabled = True
		ddlParent.DataSource = objReader
		ddlParent.DataTextField = &quot;StateName&quot;
		ddlParent.DataValueField = &quot;StateCode&quot;
		ddlParent.DataBind()
		ddlParent.Items.Insert(0, New ListItem(&quot;Select A State ...&quot;, &quot;0&quot;))
	End If

	objConn.Close()
	objCmd.Dispose()
	objConn.Dispose()
End Sub
</pre>
<p>We bind data to the child select list in a similar way, except we&#8217;re going to get some sort of key value from the parent DropDownList. So we pass that in as a parameter.</p>
<pre class="brush: vb; title: ; notranslate">
Sub ddlChild_dataBind(strKey As String)
	ddlChild.Items.Clear()

	Dim objConn As New SqlConnection(ConfigurationManager.ConnectionStrings(&quot;MyConnection&quot;).ConnectionString)
	Dim objCmd As New SqlCommand(&quot;GetZIPCodes&quot;, objConn)
	objCmd.CommandType = CommandType.StoredProcedure

	objCmd.Parameters.Add(New SqlParameter(&quot;StateInitials&quot;, SqlDbType.Char, 2))
	objCmd.Parameters(&quot;StateInitials&quot;).Value = strKey

	Dim objReader As SqlDataReader

	objConn.Open()
	objReader = objCmd.ExecuteReader()

	If Not objReader.HasRows Then
		ddlChild.Items.Clear()
		ddlChild.Items.Insert(0, &quot;Error getting towns list from database&quot;)
	Else
		ddlChild.Enabled = True
		ddlChild.DataSource = objReader
		ddlChild.DataTextField = &quot;CityName&quot;
		ddlChild.DataValueField = &quot;ZIPCode&quot;
		ddlChild.DataBind()
		ddlChild.Items.Insert(0, New ListItem(&quot;Select A Town ...&quot;, &quot;0&quot;))
	End If

	objConn.Close()
	objCmd.Dispose()
	objConn.Dispose()
End Sub
</pre>
<p>And binding the GridView data is pretty much more of the same.</p>
<pre class="brush: vb; title: ; notranslate">
Sub gvDetails_dataBind(strKey As String)
	Dim objConn As New SqlConnection(ConfigurationManager.ConnectionStrings(&quot;MyConnection&quot;).ConnectionString)
	Dim objCmd As New SqlCommand(&quot;GetCityDetails&quot;, objConn)
	objCmd.CommandType = CommandType.StoredProcedure

	objCmd.Parameters.Add(New SqlParameter(&quot;ZIPCode&quot;, SqlDbType.Char, 5))
	objCmd.Parameters(&quot;ZIPCode&quot;).Value = strKey

	Dim objReader As SqlDataReader

	objConn.Open()
	objReader = objCmd.ExecuteReader()

	gvDetails.DataSource = objReader
	gvDetails.DataBind()

	objConn.Close()
	objCmd.Dispose()
	objConn.Dispose()
End Sub
</pre>
<p>Note that in all this databinding, I am not checking for exceptions, such as failure to connect to the database, a problem with the stored procedures, etc. </p>
<p>As I have said before, what makes for workable error trapping on your end is impossible for me to know, which is why I am not including it here. <em>You should always check for errors.</em> Don&#8217;t trust your programs won&#8217;t break; expect them to break. How you do that is up to you, but you definitely should prepare for failure.</p>
<p>We&#8217;ve got one more non-event subroutine to consider before we get into the action: A way to reset the GridView when we don&#8217;t have a valid child DropDownList selection. </p>
<p>To do that, we&#8217;ll simply set the DataSource of the GridView to nothing (null), then bind it; when a GridView is bound to a null, it is thus empty and, absent having its EmptyDataTemplate or EmptyDataText properties set, simply doesn&#8217;t render.</p>
<p>(I recognize that using nulls in this way is lazy. An alternative is to toggle the visibility of the GridView so that it only shows when we know we have good data, but that&#8217;s wordier and yes, I am being kind of lazy here.)</p>
<pre class="brush: vb; title: ; notranslate">
Sub gvDetails_reset()
	gvDetails.DataSource = Nothing
	gvDetails.DataBind()
End Sub
</pre>
<p>OK, with the mechanical parts of our code out of the way, we can handle changes to the selected item indexes of both the parent and child lists.</p>
<p>In the case of a parent select list change, we always know that whatever information is currently in the detail GridView will be outdated. So we&#8217;ll reset it, and we&#8217;ll rebind the child DropDownList if the selection in the parent DropDownList is valid (which we check with the relevant CompareValidator).</p>
<pre class="brush: vb; title: ; notranslate">
Sub ddlParent_selectedIndexChanged(Sender As Object, E As EventArgs) Handles ddlParent.SelectedIndexChanged
	cvParent.Validate()
	If cvParent.IsValid Then
		ddlChild_dataBind(ddlParent.SelectedValue)
		ddlChild.SelectedIndex = 0
	End If
	gvDetails_reset()
End Sub
</pre>
<p>When the child DropDownList&#8217;s selected index is changed, one of two things are true: Either the selection isn&#8217;t valid, in which case we reset the detail GridView, or it&#8217;s time to populate the details GridView with a new town&#8217;s information.</p>
<pre class="brush: vb; title: ; notranslate">
Sub ddlChild_selectedIndexChanged(Sender As Object, E As EventArgs) Handles ddlChild.SelectedIndexChanged
	cvChild.Validate()
	If cvChild.IsValid Then
		gvDetails_dataBind(ddlChild.SelectedValue)
	Else
		gvDetails_reset()
	End If
End Sub
</pre>
<p>You can see all this in action here: <a href="http://dougv.net/demos/parent_child_dropdown/Example2.aspx" target="_blank">http://dougv.net/demos/parent_child_dropdown/Example2.aspx</a>. You can also copy and paste relevant code from there. I distribute code under the GNU GPL version 3.</p>
<div class="yarpp">
	<h5>Related Posts</h5>
		<ol>
				<li><a href="http://www.dougv.com/2011/04/24/automatically-hash-tagging-text-with-asp-net-web-forms-vb-net/" rel="bookmark">Automatically Hash Tagging Text With ASP.NET Web Forms (VB.NET)</a> (29.7)</li>
				<li><a href="http://www.dougv.com/2009/02/07/revisited-adding-non-selectable-listitem-controls-to-an-aspnet-databound-list-control/" rel="bookmark">Revisited: Adding Non-Selectable ListItem Controls To An ASP.NET DataBound List Control</a> (23.5)</li>
				<li><a href="http://www.dougv.com/2009/06/21/parent-child-select-lists-revisited-multiple-parent-child-select-lists-via-php-mysql-and-jquery/" rel="bookmark">Parent &#8211; Child Select Lists Revisited: Multiple Parent &#8211; Child Select Lists Via PHP, MySQL And jQuery</a> (23.3)</li>
			</ol>
	<p class="note">The numbers inside parentheses are relevance scores. Scoring is based, in order of priority, on title, category, content and tags. The higher the score, the more likely that post relates to this post.</p>
	</div>

	Tags: <a href="http://www.dougv.com/tag/drop-down-lists/" title="drop down lists" rel="tag">drop down lists</a>, <a href="http://www.dougv.com/tag/select-lists/" title="select lists" rel="tag">select lists</a>, <a href="http://www.dougv.com/tag/web-forms/" title="web forms" rel="tag">web forms</a>, <a href="http://www.dougv.com/tag/zip-code-database/" title="zip code database" rel="tag">zip code database</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.dougv.com/2011/12/25/parent-child-dropdownlist-controls-in-asp-net-web-forms-vb-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hi Doug, &#8220;Sorting Your MySQL Results Set In PHP Using jQuery&#8221; is perfect for what I need, thanks.The cursor changes to an &#8220;I&#8221; beam rather than a hand when hovering over a column heading &#8211; can this be altered to show a hand for the clickable heading?</title>
		<link>http://www.dougv.com/2011/12/23/hi-doug-sorting-your-mysql-results-set-in-php-using-jquery-is-perfect-for-what-i-need-thanks-the-cursor-changes-to-an-i-beam-rather-than-a-hand-when-hovering-over-a-column/</link>
		<comments>http://www.dougv.com/2011/12/23/hi-doug-sorting-your-mysql-results-set-in-php-using-jquery-is-perfect-for-what-i-need-thanks-the-cursor-changes-to-an-i-beam-rather-than-a-hand-when-hovering-over-a-column/#comments</comments>
		<pubDate>Fri, 23 Dec 2011 13:06:27 +0000</pubDate>
		<dc:creator>formspring</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[FormSpring Questions]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.dougv.com/?p=3989</guid>
		<description><![CDATA[You can use CSS and the hover pseudoclass: Ask me anything Related Posts Using jQuery To Show A Form Over A Reduced-Opacity Image (16.8) Sorting Your MySQL Results Set In PHP Using jQuery (And A More Traditional Approach) (9.7) The Simplest Ways To Do Image Rollover Effects: JavaScript And CSS-Only (7.4) The numbers inside parentheses [...]<div class="yarpp">
	<h5>Related Posts</h5>
		<ol>
				<li><a href="http://www.dougv.com/2009/01/09/using-jquery-to-show-a-form-over-a-reduced-opacity-image/" rel="bookmark">Using jQuery To Show A Form Over A Reduced-Opacity Image</a> (16.8)</li>
				<li><a href="http://www.dougv.com/2009/06/13/sorting-your-mysql-results-set-in-php-using-jquery-and-a-more-traditional-approach/" rel="bookmark">Sorting Your MySQL Results Set In PHP Using jQuery (And A More Traditional Approach)</a> (9.7)</li>
				<li><a href="http://www.dougv.com/2009/06/14/the-simplest-ways-to-do-image-rollover-effects-javascript-and-css-only/" rel="bookmark">The Simplest Ways To Do Image Rollover Effects: JavaScript And CSS-Only</a> (7.4)</li>
			</ol>
	<p class="note">The numbers inside parentheses are relevance scores. Scoring is based, in order of priority, on title, category, content and tags. The higher the score, the more likely that post relates to this post.
	</div>
]]></description>
			<content:encoded><![CDATA[<p class="formspringmeAnswer">You can use CSS and the hover pseudoclass:</p>
<pre class="brush: css; title: ; notranslate">
#sortedtable thead th:hover {
    cursor: pointer;
}
</pre>
</p>
<p class="formspringmeFooter">
    <a href="http://www.formspring.me/dougvdotcom?utm_medium=social&amp;utm_source=wordpress&amp;utm_campaign=shareanswer">Ask me anything</a></p>
<div class="yarpp">
	<h5>Related Posts</h5>
		<ol>
				<li><a href="http://www.dougv.com/2009/01/09/using-jquery-to-show-a-form-over-a-reduced-opacity-image/" rel="bookmark">Using jQuery To Show A Form Over A Reduced-Opacity Image</a> (16.8)</li>
				<li><a href="http://www.dougv.com/2009/06/13/sorting-your-mysql-results-set-in-php-using-jquery-and-a-more-traditional-approach/" rel="bookmark">Sorting Your MySQL Results Set In PHP Using jQuery (And A More Traditional Approach)</a> (9.7)</li>
				<li><a href="http://www.dougv.com/2009/06/14/the-simplest-ways-to-do-image-rollover-effects-javascript-and-css-only/" rel="bookmark">The Simplest Ways To Do Image Rollover Effects: JavaScript And CSS-Only</a> (7.4)</li>
			</ol>
	<p class="note">The numbers inside parentheses are relevance scores. Scoring is based, in order of priority, on title, category, content and tags. The higher the score, the more likely that post relates to this post.</p>
	</div>
No tags for this post.]]></content:encoded>
			<wfw:commentRss>http://www.dougv.com/2011/12/23/hi-doug-sorting-your-mysql-results-set-in-php-using-jquery-is-perfect-for-what-i-need-thanks-the-cursor-changes-to-an-i-beam-rather-than-a-hand-when-hovering-over-a-column/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>also with auto hashtagging: if you have already a hashtag you get double hashtags&#8230;</title>
		<link>http://www.dougv.com/2011/12/17/also-with-auto-hashtagging-if-you-have-already-a-hashtag-you-get-double-hashtags/</link>
		<comments>http://www.dougv.com/2011/12/17/also-with-auto-hashtagging-if-you-have-already-a-hashtag-you-get-double-hashtags/#comments</comments>
		<pubDate>Sat, 17 Dec 2011 16:43:58 +0000</pubDate>
		<dc:creator>formspring</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Dot Net]]></category>
		<category><![CDATA[FormSpring Questions]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.dougv.com/?p=3983</guid>
		<description><![CDATA[Read the follow-up article. Ask me anything Related Posts I read your article about auto-hashtagging. Maybe you forgot when a to-be-tag is ending with a &#8216;.&#8217; of &#8216;,&#8217; or other punctuation&#8230;? (30.9) binding a data from database to dropdownlist based on selected item of another dropdown list (7) Designers And Developers: Donate Your Time, Talent [...]<div class="yarpp">
	<h5>Related Posts</h5>
		<ol>
				<li><a href="http://www.dougv.com/2011/12/17/i-read-your-article-about-auto-hashtagging-maybe-you-forgot-when-a-to-be-tag-is-ending-with-a-of-or-other-punctuation/" rel="bookmark">I read your article about auto-hashtagging. Maybe you forgot when a to-be-tag is ending with a &#8216;.&#8217; of &#8216;,&#8217; or other punctuation&#8230;?</a> (30.9)</li>
				<li><a href="http://www.dougv.com/2011/10/10/binding-a-data-from-database-to-dropdownlist-based-on-selected-item-of-another-dropdown-list/" rel="bookmark">binding a data from database to dropdownlist based on selected item of another dropdown list</a> (7)</li>
				<li><a href="http://www.dougv.com/2010/05/13/designers-and-developers-donate-your-time-talent-at-new-england-give-camp-june-11-13-2010/" rel="bookmark">Designers And Developers: Donate Your Time, Talent At New England GiveCamp, June 11-13, 2010</a> (5.2)</li>
			</ol>
	<p class="note">The numbers inside parentheses are relevance scores. Scoring is based, in order of priority, on title, category, content and tags. The higher the score, the more likely that post relates to this post.
	</div>
]]></description>
			<content:encoded><![CDATA[<p class="formspringmeAnswer">Read the follow-up article.</p>
<p class="formspringmeFooter">
    <a href="http://www.formspring.me/dougvdotcom?utm_medium=social&amp;utm_source=wordpress&amp;utm_campaign=shareanswer">Ask me anything</a></p>
<div class="yarpp">
	<h5>Related Posts</h5>
		<ol>
				<li><a href="http://www.dougv.com/2011/12/17/i-read-your-article-about-auto-hashtagging-maybe-you-forgot-when-a-to-be-tag-is-ending-with-a-of-or-other-punctuation/" rel="bookmark">I read your article about auto-hashtagging. Maybe you forgot when a to-be-tag is ending with a &#8216;.&#8217; of &#8216;,&#8217; or other punctuation&#8230;?</a> (30.9)</li>
				<li><a href="http://www.dougv.com/2011/10/10/binding-a-data-from-database-to-dropdownlist-based-on-selected-item-of-another-dropdown-list/" rel="bookmark">binding a data from database to dropdownlist based on selected item of another dropdown list</a> (7)</li>
				<li><a href="http://www.dougv.com/2010/05/13/designers-and-developers-donate-your-time-talent-at-new-england-give-camp-june-11-13-2010/" rel="bookmark">Designers And Developers: Donate Your Time, Talent At New England GiveCamp, June 11-13, 2010</a> (5.2)</li>
			</ol>
	<p class="note">The numbers inside parentheses are relevance scores. Scoring is based, in order of priority, on title, category, content and tags. The higher the score, the more likely that post relates to this post.</p>
	</div>
No tags for this post.]]></content:encoded>
			<wfw:commentRss>http://www.dougv.com/2011/12/17/also-with-auto-hashtagging-if-you-have-already-a-hashtag-you-get-double-hashtags/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I read your article about auto-hashtagging. Maybe you forgot when a to-be-tag is ending with a &#8216;.&#8217; of &#8216;,&#8217; or other punctuation&#8230;?</title>
		<link>http://www.dougv.com/2011/12/17/i-read-your-article-about-auto-hashtagging-maybe-you-forgot-when-a-to-be-tag-is-ending-with-a-of-or-other-punctuation/</link>
		<comments>http://www.dougv.com/2011/12/17/i-read-your-article-about-auto-hashtagging-maybe-you-forgot-when-a-to-be-tag-is-ending-with-a-of-or-other-punctuation/#comments</comments>
		<pubDate>Sat, 17 Dec 2011 14:43:13 +0000</pubDate>
		<dc:creator>formspring</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Dot Net]]></category>
		<category><![CDATA[FormSpring Questions]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[VB.NET]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[regular expression]]></category>

		<guid isPermaLink="false">http://www.dougv.com/?p=3979</guid>
		<description><![CDATA[Seems that&#8217;s the case. Good catch! An easy fix is to simply run the input string through a regular expression that strips out the punctuation before exploding it into an array. Ask me anything Related Posts binding a data from database to dropdownlist based on selected item of another dropdown list (6) Counting Letters In [...]<div class="yarpp">
	<h5>Related Posts</h5>
		<ol>
				<li><a href="http://www.dougv.com/2011/10/10/binding-a-data-from-database-to-dropdownlist-based-on-selected-item-of-another-dropdown-list/" rel="bookmark">binding a data from database to dropdownlist based on selected item of another dropdown list</a> (6)</li>
				<li><a href="http://www.dougv.com/2007/01/03/counting-letters-in-a-string-with-php/" rel="bookmark">Counting Letters In A String With PHP</a> (5.1)</li>
			</ol>
	<p class="note">The numbers inside parentheses are relevance scores. Scoring is based, in order of priority, on title, category, content and tags. The higher the score, the more likely that post relates to this post.
	</div>
]]></description>
			<content:encoded><![CDATA[<p class="formspringmeAnswer">Seems that&#8217;s the case. Good catch! An easy fix is to simply run the input string through a regular expression that strips out the punctuation before exploding it into an array.</p>
<p class="formspringmeFooter">
    <a href="http://www.formspring.me/dougvdotcom?utm_medium=social&amp;utm_source=wordpress&amp;utm_campaign=shareanswer">Ask me anything</a></p>
<div class="yarpp">
	<h5>Related Posts</h5>
		<ol>
				<li><a href="http://www.dougv.com/2011/10/10/binding-a-data-from-database-to-dropdownlist-based-on-selected-item-of-another-dropdown-list/" rel="bookmark">binding a data from database to dropdownlist based on selected item of another dropdown list</a> (6)</li>
				<li><a href="http://www.dougv.com/2007/01/03/counting-letters-in-a-string-with-php/" rel="bookmark">Counting Letters In A String With PHP</a> (5.1)</li>
			</ol>
	<p class="note">The numbers inside parentheses are relevance scores. Scoring is based, in order of priority, on title, category, content and tags. The higher the score, the more likely that post relates to this post.</p>
	</div>

	Tags: <a href="http://www.dougv.com/tag/array/" title="array" rel="tag">array</a>, <a href="http://www.dougv.com/tag/regular-expression/" title="regular expression" rel="tag">regular expression</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.dougv.com/2011/12/17/i-read-your-article-about-auto-hashtagging-maybe-you-forgot-when-a-to-be-tag-is-ending-with-a-of-or-other-punctuation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>when i make control dynamically from javascript in asp.net then some control make out side of page like div and linkbutton</title>
		<link>http://www.dougv.com/2011/12/05/when-i-make-control-dynamically-from-javascript-in-asp-net-then-some-control-make-out-side-of-page-like-div-and-linkbutton/</link>
		<comments>http://www.dougv.com/2011/12/05/when-i-make-control-dynamically-from-javascript-in-asp-net-then-some-control-make-out-side-of-page-like-div-and-linkbutton/#comments</comments>
		<pubDate>Mon, 05 Dec 2011 11:17:20 +0000</pubDate>
		<dc:creator>formspring</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Dot Net]]></category>
		<category><![CDATA[FormSpring Questions]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[server controls]]></category>

		<guid isPermaLink="false">http://www.dougv.com/2011/12/05/when-i-make-control-dynamically-from-javascript-in-asp-net-then-some-control-make-out-side-of-page-like-div-and-linkbutton/</guid>
		<description><![CDATA[I think you&#8217;re asking if you can dynamically create a server control in ASP.NET with JavaScript. The short answer is no. You can create DOM elements via JavaScript, but you can&#8217;t create server controls, such as LinkButtons, since they &#34;run at&#34; the server, not the client. That said, ASP.NET versions 2+ come with AJAX-enhanced controls [...]<div class="yarpp">
	<h5>Related Posts</h5>
		<ol>
				<li><a href="http://www.dougv.com/2010/02/17/dynamically-adding-javascript-to-your-asp-net-master-page-from-a-child-page/" rel="bookmark">Dynamically Adding JavaScript To Your ASP.NET Master Page From A Child Page</a> (42.1)</li>
				<li><a href="http://www.dougv.com/2006/10/04/dynamically-adding-javascript-to-aspnet-20-templated-master-pages/" rel="bookmark">Dynamically Adding JavaScript onLoad Event-Driven Scripts To ASP.NET 2.0 Templated / Master Page Content Pages</a> (36.1)</li>
				<li><a href="http://www.dougv.com/2009/08/12/dynamically-changing-your-child-page-titles-in-asp-net-master-pages/" rel="bookmark">Dynamically Changing Your Child Page Titles With ASP.NET Master Pages</a> (31.8)</li>
			</ol>
	<p class="note">The numbers inside parentheses are relevance scores. Scoring is based, in order of priority, on title, category, content and tags. The higher the score, the more likely that post relates to this post.
	</div>
]]></description>
			<content:encoded><![CDATA[<p class="formspringmeAnswer">I think you&#8217;re asking if you can dynamically create a server control in ASP.NET with JavaScript. The short answer is no. </p>
<p>You can create DOM elements via JavaScript, but you can&#8217;t create server controls, such as LinkButtons, since they &quot;run at&quot; the server, not the client.</p>
<p>That said, ASP.NET versions 2+ come with AJAX-enhanced controls that probably will meet your needs (<a href="http://dougv.us/o1" target="_blank" rel="nofollow" class="nofollow">http://dougv.us/o1</a>) maybe the AlwaysVisible control is what you&#8217;re after. Versions 3.5+ natively support jQuery (<a href="http://dougv.us/o2" target="_blank" rel="nofollow" class="nofollow">http://dougv.us/o2</a>), which you could use to remove / show / hide server controls after they are output.</p>
<p class="formspringmeFooter">
    <a href="http://www.formspring.me/dougvdotcom?utm_medium=social&amp;utm_source=wordpress&amp;utm_campaign=shareanswer">Ask me anything</a></p>
<div class="yarpp">
	<h5>Related Posts</h5>
		<ol>
				<li><a href="http://www.dougv.com/2010/02/17/dynamically-adding-javascript-to-your-asp-net-master-page-from-a-child-page/" rel="bookmark">Dynamically Adding JavaScript To Your ASP.NET Master Page From A Child Page</a> (42.1)</li>
				<li><a href="http://www.dougv.com/2006/10/04/dynamically-adding-javascript-to-aspnet-20-templated-master-pages/" rel="bookmark">Dynamically Adding JavaScript onLoad Event-Driven Scripts To ASP.NET 2.0 Templated / Master Page Content Pages</a> (36.1)</li>
				<li><a href="http://www.dougv.com/2009/08/12/dynamically-changing-your-child-page-titles-in-asp-net-master-pages/" rel="bookmark">Dynamically Changing Your Child Page Titles With ASP.NET Master Pages</a> (31.8)</li>
			</ol>
	<p class="note">The numbers inside parentheses are relevance scores. Scoring is based, in order of priority, on title, category, content and tags. The higher the score, the more likely that post relates to this post.</p>
	</div>

	Tags: <a href="http://www.dougv.com/tag/ajax-2/" title="ajax" rel="tag">ajax</a>, <a href="http://www.dougv.com/tag/server-controls/" title="server controls" rel="tag">server controls</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.dougv.com/2011/12/05/when-i-make-control-dynamically-from-javascript-in-asp-net-then-some-control-make-out-side-of-page-like-div-and-linkbutton/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>hi. i have to implement a sorting concept.</title>
		<link>http://www.dougv.com/2011/12/02/hi-i-have-to-implement-a-sorting-concept/</link>
		<comments>http://www.dougv.com/2011/12/02/hi-i-have-to-implement-a-sorting-concept/#comments</comments>
		<pubDate>Fri, 02 Dec 2011 22:35:30 +0000</pubDate>
		<dc:creator>formspring</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[FormSpring Questions]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[bubble sort]]></category>

		<guid isPermaLink="false">http://www.dougv.com/2011/12/02/hi-i-have-to-implement-a-sorting-concept/</guid>
		<description><![CDATA[Could you clarify what you mean by sorting concept, and what language you&#8217;re using? Short of a clarification, I think the most common example &#8212; in C++ classes, anyway &#8212; of sorting is what&#8217;s called a &#34;bubble sort.&#34; Basically, you use an array of unsorted values. You then iterate that array, checking the values and [...]<div class="yarpp">
	<h5>Related Posts</h5>
		<ol>
				<li><a href="http://www.dougv.com/2009/06/13/sorting-your-mysql-results-set-in-php-using-jquery-and-a-more-traditional-approach/" rel="bookmark">Sorting Your MySQL Results Set In PHP Using jQuery (And A More Traditional Approach)</a> (18.8)</li>
			</ol>
	<p class="note">The numbers inside parentheses are relevance scores. Scoring is based, in order of priority, on title, category, content and tags. The higher the score, the more likely that post relates to this post.
	</div>
]]></description>
			<content:encoded><![CDATA[<p class="formspringmeAnswer">Could you clarify what you mean by sorting concept, and what language you&#8217;re using? Short of a clarification, I think the most common example &#8212; in C++ classes, anyway &#8212; of sorting is what&#8217;s called a &quot;bubble sort.&quot; Basically, you use an array of unsorted values. You then iterate that array, checking the values and swapping positions in the array if one value is &quot;greater&quot; than the next. By repeating this process several times, you can effectively, if inefficiently, sort your data. Wikipedia article on bubble sorting: <a href="http://dougv.us/nz" target="_blank" rel="nofollow" class="nofollow">http://dougv.us/nz</a> A tl;dr version with C++ code: <a href="http://dougv.us/ny" target="_blank" rel="nofollow" class="nofollow">http://dougv.us/ny</a></p>
<p class="formspringmeFooter">
    <a href="http://www.formspring.me/dougvdotcom?utm_medium=social&amp;utm_source=wordpress&amp;utm_campaign=shareanswer">Ask me anything</a></p>
<div class="yarpp">
	<h5>Related Posts</h5>
		<ol>
				<li><a href="http://www.dougv.com/2009/06/13/sorting-your-mysql-results-set-in-php-using-jquery-and-a-more-traditional-approach/" rel="bookmark">Sorting Your MySQL Results Set In PHP Using jQuery (And A More Traditional Approach)</a> (18.8)</li>
			</ol>
	<p class="note">The numbers inside parentheses are relevance scores. Scoring is based, in order of priority, on title, category, content and tags. The higher the score, the more likely that post relates to this post.</p>
	</div>

	Tags: <a href="http://www.dougv.com/tag/array/" title="array" rel="tag">array</a>, <a href="http://www.dougv.com/tag/bubble-sort/" title="bubble sort" rel="tag">bubble sort</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.dougv.com/2011/12/02/hi-i-have-to-implement-a-sorting-concept/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Write a pseudocode to accept n number and display their cubes.</title>
		<link>http://www.dougv.com/2011/10/15/write-a-pseudocode-to-accept-n-number-and-display-their-cubes/</link>
		<comments>http://www.dougv.com/2011/10/15/write-a-pseudocode-to-accept-n-number-and-display-their-cubes/#comments</comments>
		<pubDate>Sat, 15 Oct 2011 11:42:17 +0000</pubDate>
		<dc:creator>formspring</dc:creator>
				<category><![CDATA[FormSpring Questions]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.dougv.com/2011/10/15/write-a-pseudocode-to-accept-n-number-and-display-their-cubes/</guid>
		<description><![CDATA[I&#8217;m probably an asshole for being this blunt, but if you can&#8217;t manage this assignment on your own, you shouldn&#8217;t be studying computer science. Ask me anything Related Posts Display A Random Image With JavaScript / DOM (14.5) A Simple Calendar Page To Display Date-Specific Data In PHP (14.1) The numbers inside parentheses are relevance [...]<div class="yarpp">
	<h5>Related Posts</h5>
		<ol>
				<li><a href="http://www.dougv.com/2007/01/14/display-a-random-image-with-javascript-dom/" rel="bookmark">Display A Random Image With JavaScript / DOM</a> (14.5)</li>
				<li><a href="http://www.dougv.com/2006/12/08/a-simple-calendar-page-to-display-date-specific-data-in-php/" rel="bookmark">A Simple Calendar Page To Display Date-Specific Data In PHP</a> (14.1)</li>
			</ol>
	<p class="note">The numbers inside parentheses are relevance scores. Scoring is based, in order of priority, on title, category, content and tags. The higher the score, the more likely that post relates to this post.
	</div>
]]></description>
			<content:encoded><![CDATA[<p class="formspringmeAnswer">I&#8217;m probably an asshole for being this blunt, but if you can&#8217;t manage this assignment on your own, you shouldn&#8217;t be studying computer science.</p>
<p class="formspringmeFooter">
    <a href="http://www.formspring.me/dougvdotcom?utm_medium=social&amp;utm_source=wordpress&amp;utm_campaign=shareanswer">Ask me anything</a></p>
<div class="yarpp">
	<h5>Related Posts</h5>
		<ol>
				<li><a href="http://www.dougv.com/2007/01/14/display-a-random-image-with-javascript-dom/" rel="bookmark">Display A Random Image With JavaScript / DOM</a> (14.5)</li>
				<li><a href="http://www.dougv.com/2006/12/08/a-simple-calendar-page-to-display-date-specific-data-in-php/" rel="bookmark">A Simple Calendar Page To Display Date-Specific Data In PHP</a> (14.1)</li>
			</ol>
	<p class="note">The numbers inside parentheses are relevance scores. Scoring is based, in order of priority, on title, category, content and tags. The higher the score, the more likely that post relates to this post.</p>
	</div>
No tags for this post.]]></content:encoded>
			<wfw:commentRss>http://www.dougv.com/2011/10/15/write-a-pseudocode-to-accept-n-number-and-display-their-cubes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hi Doug, I saw your response to a person on Yahoo answers, It was probably a couple of years ago. I&#8217;m trying toget my hands on a Sap tool to practice on it on my own. You mentioned you were doing the same at that time. Do you still have it? Thanks</title>
		<link>http://www.dougv.com/2011/10/12/hi-doug-i-saw-your-response-to-a-person-on-yahoo-answers-it-was-probably-a-couple-of-years-ago-im-trying-toget-my-hands-on-a-sap-tool-to-practice-on-it-on-my-own-you-mentioned-you-were-doing-the/</link>
		<comments>http://www.dougv.com/2011/10/12/hi-doug-i-saw-your-response-to-a-person-on-yahoo-answers-it-was-probably-a-couple-of-years-ago-im-trying-toget-my-hands-on-a-sap-tool-to-practice-on-it-on-my-own-you-mentioned-you-were-doing-the/#comments</comments>
		<pubDate>Wed, 12 Oct 2011 16:39:48 +0000</pubDate>
		<dc:creator>formspring</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[FormSpring Questions]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.dougv.com/2011/10/12/hi-doug-i-saw-your-response-to-a-person-on-yahoo-answers-it-was-probably-a-couple-of-years-ago-im-trying-toget-my-hands-on-a-sap-tool-to-practice-on-it-on-my-own-you-mentioned-you-were-doing-the/</guid>
		<description><![CDATA[Sorry, I don&#8217;t recall this. I did have a client a while back who was interested in SAP but I don&#8217;t believe I ever followed through. If you could provide a link to the question, it might help refresh my memory. I don&#8217;t believe I&#8217;ve ever said I use pirated software, and I&#8217;d be surprised [...]<div class="yarpp">
	<h5>Related Posts</h5>
		<ol>
				<li><a href="http://www.dougv.com/2010/05/13/designers-and-developers-donate-your-time-talent-at-new-england-give-camp-june-11-13-2010/" rel="bookmark">Designers And Developers: Donate Your Time, Talent At New England GiveCamp, June 11-13, 2010</a> (12)</li>
				<li><a href="http://www.dougv.com/2009/03/05/msdn-roadshow-in-augusta-march-19-well-worth-the-time/" rel="bookmark">MSDN Roadshow In Augusta, March 19: Well Worth The Time</a> (11.6)</li>
				<li><a href="http://www.dougv.com/2007/03/12/displaying-the-correct-time-for-world-cities-with-ajax-javascript-dom/" rel="bookmark">Displaying The Correct Time For World Cities  With AJAX / JavaScript / DOM</a> (10.8)</li>
			</ol>
	<p class="note">The numbers inside parentheses are relevance scores. Scoring is based, in order of priority, on title, category, content and tags. The higher the score, the more likely that post relates to this post.
	</div>
]]></description>
			<content:encoded><![CDATA[<p class="formspringmeAnswer">Sorry, I don&#8217;t recall this. I did have a client a while back who was interested in SAP but I don&#8217;t believe I ever followed through. </p>
<p>If you could provide a link to the question, it might help refresh my memory. </p>
<p>I don&#8217;t believe I&#8217;ve ever said I use pirated software, and I&#8217;d be surprised to see anything in which I offered to share pirated software. It&#8217;s possible I noted that stealing software was an option, but I have to believe that if I said that, I also said that doing so was legally and morally wrong. Again, a link to the question you&#8217;re referencing would clear things up for me.</p>
<p>For the record, I have often said &#8212; and stand by the statement &#8212; that it&#8217;s everyone&#8217;s right to make personal copies of software he has legally purchased, even if a EULA forbids personal copies; but I don&#8217;t believe it&#8217;s OK to distribute copy-restricted software in violation of license terms.</p>
<p class="formspringmeFooter">
    <a href="http://www.formspring.me/dougvdotcom?utm_medium=social&amp;utm_source=wordpress&amp;utm_campaign=shareanswer">Ask me anything</a></p>
<div class="yarpp">
	<h5>Related Posts</h5>
		<ol>
				<li><a href="http://www.dougv.com/2010/05/13/designers-and-developers-donate-your-time-talent-at-new-england-give-camp-june-11-13-2010/" rel="bookmark">Designers And Developers: Donate Your Time, Talent At New England GiveCamp, June 11-13, 2010</a> (12)</li>
				<li><a href="http://www.dougv.com/2009/03/05/msdn-roadshow-in-augusta-march-19-well-worth-the-time/" rel="bookmark">MSDN Roadshow In Augusta, March 19: Well Worth The Time</a> (11.6)</li>
				<li><a href="http://www.dougv.com/2007/03/12/displaying-the-correct-time-for-world-cities-with-ajax-javascript-dom/" rel="bookmark">Displaying The Correct Time For World Cities  With AJAX / JavaScript / DOM</a> (10.8)</li>
			</ol>
	<p class="note">The numbers inside parentheses are relevance scores. Scoring is based, in order of priority, on title, category, content and tags. The higher the score, the more likely that post relates to this post.</p>
	</div>
No tags for this post.]]></content:encoded>
			<wfw:commentRss>http://www.dougv.com/2011/10/12/hi-doug-i-saw-your-response-to-a-person-on-yahoo-answers-it-was-probably-a-couple-of-years-ago-im-trying-toget-my-hands-on-a-sap-tool-to-practice-on-it-on-my-own-you-mentioned-you-were-doing-the/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Book Review: The Art of Deception: Controlling the Human Element of Security</title>
		<link>http://www.dougv.com/2011/10/10/book-review-the-art-of-deception-controlling-the-human-element-of-security/</link>
		<comments>http://www.dougv.com/2011/10/10/book-review-the-art-of-deception-controlling-the-human-element-of-security/#comments</comments>
		<pubDate>Tue, 11 Oct 2011 01:13:36 +0000</pubDate>
		<dc:creator>Doug Vanderweide</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[book review]]></category>
		<category><![CDATA[corporate espionage]]></category>
		<category><![CDATA[exploits]]></category>
		<category><![CDATA[identity theft]]></category>
		<category><![CDATA[kevin mitnick]]></category>
		<category><![CDATA[social engineering]]></category>

		<guid isPermaLink="false">http://www.dougv.com/?p=3938</guid>
		<description><![CDATA[The problem with &#8220;The Art of Deception&#8221; is its age and the limited scope of the exploits Kevin Mitnick discusses. Almost every (usually fictional) exploit that Mitnick describes involves exploiting large organizations &#8212; places where there are clear heirarchies, overlapping departmental responsibilities and integrated networks. Also, a significant amount of what he discusses involves phone [...]<div class="yarpp">
	<h5>Related Posts</h5>
		<ol>
				<li><a href="http://www.dougv.com/2010/09/18/major-security-hole-in-asp-net-requires-error-redirect-workaround/" rel="bookmark">Major Security Hole In ASP.NET Requires Error Redirect Workaround</a> (13.3)</li>
				<li><a href="http://www.dougv.com/2008/12/06/phps-session_register-and-the-fine-art-of-variable-poisoning/" rel="bookmark">PHP&#8217;s session_register() And The Fine Art Of Variable Poisoning</a> (13.1)</li>
				<li><a href="http://www.dougv.com/2009/06/22/automatically-wiring-up-xhtml-element-events-on-page-load-with-jquery/" rel="bookmark">Automatically Wiring Up XHTML Element Events On Page Load With jQuery</a> (12.6)</li>
			</ol>
	<p class="note">The numbers inside parentheses are relevance scores. Scoring is based, in order of priority, on title, category, content and tags. The higher the score, the more likely that post relates to this post.
	</div>
]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-medium wp-image-3939" title="18160" src="http://www.dougv.com/wp-content/uploads/2011/10/18160-232x350.jpg" alt="" width="110" />The problem with &#8220;The Art of Deception&#8221; is its age and the limited scope of the exploits Kevin Mitnick discusses.</p>
<p>Almost every (usually fictional) exploit that Mitnick describes involves exploiting large organizations &#8212; places where there are clear heirarchies, overlapping departmental responsibilities and integrated networks.</p>
<p>Also, a significant amount of what he discusses involves phone phreaking; given that was how he cut his teeth in the social engineering game, it&#8217;s not surprising.</p>
<p>But when you read an example that involves dialing in to a <a href="http://en.wikipedia.org/wiki/DMS-100">Nortel DMS-100</a>, you know you&#8217;re reading dated material. Sure, some companies still use 30-year-old telephone switches, and PBX is still a highly exploitable technology. But an update to 21st century tech is sorely wanted here.</p>
<p>Generally speaking, every example Mitnick provides for a successful social engineering attack comes down to three basic steps:</p>
<ul>
<li>Get a name and title on someone in a large company.</li>
<li>Call a low-level employee on the telephone, masquerading as that person, and ask for some information that lines up the target.</li>
<li>Call the target, repeat the information given by the low-level employee, get the target to compromise the system.</li>
</ul>
<p>Sure, this can work &#8212; if you target large enough an operation. But what about small companies? Or individuals? Or non-corporate espionage? They go largely unaddressed.</p>
<p><span id="more-3938"></span>Mitnick briefly discusses identity theft, and his favored strategy is <a href="http://urbandumpsterdiver.wordpress.com/">Dumpster diving</a>. Which, again, is becoming increasingly less relevant as paper becomes less relevant, at least for smaller organizations / individuals.</p>
<p>He also gives very little attention to face-to-face exploits, claiming that they&#8217;re largely too risky. But by the same token, his constant refrain is that the successful social engineer is first charming and personable. I guess I miss where that would only be true of the average crook when he&#8217;s on the phone.</p>
<p>Finally, when discussing how one goes about protecting against social engineers, Mitnick almost always suggests restrictive rules and punishments, suggesting that the average employee responds appropriately to such inconveniences if it&#8217;s made plain to him the importance of not screwing up. That&#8217;s spoken like someone who&#8217;s never supervised an employee in his life.</p>
<p><a href="http://www.inc.com/guides/2010/08/10-things-employees-want.html">People want autonomy, challenges and proof their work means something</a>. Thus, he should discuss a reward-centered approach that says, &#8220;we trust you to protect your work product, we publicly recognize and reward vigilance, and we find ways to enable you to do what you need to do to get work done, in ways that ensure our information remains secure.&#8221;</p>
<p>I don&#8217;t mean to suggest that Mitnick&#8217;s book is of no relevance today. His basic points &#8212; that human nature is to help others, we can all sympathize with the poor sot who&#8217;s in a jam and needs our help, and what seems innocuous to the average employee is often the information that gets a social engineer&#8217;s foot in the door &#8212; are well-taken and will always be pertinent to security.</p>
<p>But times have changed. This book, unfortunately, hasn&#8217;t.</p>
<p>Finally, I got <a href="http://www.amazon.com/Art-Deception-Controlling-Security-ebook/dp/B000S1LVUY/">the Kindle version of this book</a>, and not enough attention was paid to cleaning up the text during the conversion; punctuation, capitalization and other miscellaneous errors are rampant.</p>
<p>Also, the surfeit of sidebars &#8212; which usually explain a technical term, or give a quick tip on how to avoid an exploit &#8212; weren&#8217;t carefully placed; sometimes, they interrupt paragraphs of the main text.</p>
<p>All links in this post on delicious: <a href="http://delicious.com/dougvdotcom/book-review-the-art-of-deception-controlling-the-human-element-of-security">http://delicious.com/dougvdotcom/book-review-the-art-of-deception-controlling-the-human-element-of-security</a></p>
<div class="yarpp">
	<h5>Related Posts</h5>
		<ol>
				<li><a href="http://www.dougv.com/2010/09/18/major-security-hole-in-asp-net-requires-error-redirect-workaround/" rel="bookmark">Major Security Hole In ASP.NET Requires Error Redirect Workaround</a> (13.3)</li>
				<li><a href="http://www.dougv.com/2008/12/06/phps-session_register-and-the-fine-art-of-variable-poisoning/" rel="bookmark">PHP&#8217;s session_register() And The Fine Art Of Variable Poisoning</a> (13.1)</li>
				<li><a href="http://www.dougv.com/2009/06/22/automatically-wiring-up-xhtml-element-events-on-page-load-with-jquery/" rel="bookmark">Automatically Wiring Up XHTML Element Events On Page Load With jQuery</a> (12.6)</li>
			</ol>
	<p class="note">The numbers inside parentheses are relevance scores. Scoring is based, in order of priority, on title, category, content and tags. The higher the score, the more likely that post relates to this post.</p>
	</div>

	Tags: <a href="http://www.dougv.com/tag/book-review/" title="book review" rel="tag">book review</a>, <a href="http://www.dougv.com/tag/corporate-espionage/" title="corporate espionage" rel="tag">corporate espionage</a>, <a href="http://www.dougv.com/tag/exploits/" title="exploits" rel="tag">exploits</a>, <a href="http://www.dougv.com/tag/identity-theft/" title="identity theft" rel="tag">identity theft</a>, <a href="http://www.dougv.com/tag/kevin-mitnick/" title="kevin mitnick" rel="tag">kevin mitnick</a>, <a href="http://www.dougv.com/tag/social-engineering/" title="social engineering" rel="tag">social engineering</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.dougv.com/2011/10/10/book-review-the-art-of-deception-controlling-the-human-element-of-security/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

