<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>.NET Discussion &#187; Some.Net(Guy)</title>
	<atom:link href="http://dotnetdiscussion.net/author/edelman/feed/" rel="self" type="application/rss+xml" />
	<link>http://dotnetdiscussion.net</link>
	<description>.NET Issues, Problems, Code Samples, and Fixes</description>
	<lastBuildDate>Mon, 21 Dec 2009 19:25:56 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='dotnetdiscussion.net' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/fd4a75d19c20c37040a87ca2160fa573?s=96&#038;d=http://s2.wp.com/i/buttonw-com.png</url>
		<title>.NET Discussion &#187; Some.Net(Guy)</title>
		<link>http://dotnetdiscussion.net</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://dotnetdiscussion.net/osd.xml" title=".NET Discussion" />
	<atom:link rel='hub' href='http://dotnetdiscussion.net/?pushpress=hub'/>
		<item>
		<title>Javascript: How To Implement Callback Functionality</title>
		<link>http://dotnetdiscussion.net/2009/12/21/javascript-how-to-implement-callback-functionality/</link>
		<comments>http://dotnetdiscussion.net/2009/12/21/javascript-how-to-implement-callback-functionality/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 19:25:56 +0000</pubDate>
		<dc:creator>Some.Net(Guy)</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://dotnetdiscussion.net/?p=123</guid>
		<description><![CDATA[I know I haven&#8217;t posted for a while, so for all 1 of my loyal readers (ha, kidding. Friend.), I apologize. Mostly the reason why is that I&#8217;ve been super busy (a good thing)! Anyways, this isn&#8217;t a personal blog, so I&#8217;ll spare you the details and get down to business.
As you may well know [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetdiscussion.net&blog=1333069&post=123&subd=dotnetdiscussion&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I know I haven&#8217;t posted for a while, so for all 1 of my loyal readers (ha, kidding. Friend.), I apologize. Mostly the reason why is that I&#8217;ve been super busy (a good thing)! Anyways, this isn&#8217;t a personal blog, so I&#8217;ll spare you the details and get down to business.</p>
<p>As you may well know from my <a href="http://dotnetdiscussion.net/2009/07/31/simple-jquery-expandcontract-functionality/">previous</a> <a href="http://dotnetdiscussion.net/2009/07/28/javascript-setting-month-date-object/">few</a> <a href="http://dotnetdiscussion.net/2009/06/12/jquery-awesome/">posts</a>, I&#8217;ve been dipping my toes into the <a title="jQuery" href="http://jquery.com" target="_blank">jQuery</a> and Javascript world for quite some time now. I actually learned jQuery first before I had any real experience with Javascript (yes, that&#8217;s how freakishly easy it is to learn and use), so a lot of what jQuery did I took for granted: DOM manipulation, event binding, and, as mentioned in the title of this post, callbacks. If you&#8217;re not TOTALLY familiar with how Javascript works (don&#8217;t worry, it took me a while, too), digest this:</p>
<p>In static languages such as VB.NET or C#, a variable at its most basic level contains an instance of an object, such as a String object or an instantiated class of some sort. In dynamic languages (e.g., Javascript), not only can variables house objects (which may or may not be instantiated), but they can store <em>functions</em> as well. As in, the whole function itself. This function can be anonymous or a predefined named function. For instance:</p>
<pre class="brush: jscript;">
var myFunction = function () {
    //do work here
};
</pre>
<p>Which, depending on how it&#8217;s referenced, can do two different things. Let&#8217;s say you have a function called <code>callingFunction()</code> that needs to pass a parameter of some sort. Using the <code>myFunction()</code> example above as the parameter, calling <code>callingFunction(myFunction())</code> and <code>callingFunction(myFunction)</code> do two different things.</p>
<p><strong><code>callingFunction(myFunction())</code></strong> passes the <em>value returned by</em> <code>myFunction</code> as the parameter, which means that <code>myFunction</code> must first run before <code>callingFunction</code> does so that it may pass along its result. If <code>myFunction</code> returns, say, the number 2, this is effectively the same as calling <code>callingFunction(2)</code>. (Assuming that <code>myFunction</code> has no other functionality than doing some work and returning a number. If <code>myFunction</code> does anything else, it will run before <code>callingFunction</code>, as described.) </p>
<p><strong><code>callingFunction(myFunction)</code></strong> passes the <em>function</em> <code>myFunction</code> to be used at a later time by <code>callingFunction</code>. This means the function being passed along as a parameter has not run yet. This is how callback functionality is created. Essentially, once <code>callingFunction</code> has successfully run, a typical control flow would be to run the callback function passed along (after checking if one exists). This is convenient (and more dynamic than, well, static languages) because you don&#8217;t have to hard-code which functionality occurs after a certain process finishes. You can just pass in whatever functionality you want, which leads to the beauty of anonymous functions. Example:</p>
<pre class="brush: jscript;">
function callingFunction(someFunction) {
    var someVar;
    //do some work here
    //after work is done:
    if (someFunction != null) {
        someFunction(someVar);
    }
}
</pre>
<p>Viola! Callback functionality.</p>
<p>In jQuery, if you want to add click handler functionality, it&#8217;s as simple as <code>$('.myClass').click(function() { //some work });</code>. That <code>function()</code> is just an anonymous (nameless) function passed along to dictate the functionality that must happen once your selector has been clicked. The beauty of jQuery is in its abstraction. You don&#8217;t have to try to wire up the actual event listeners for the clicking of the mouse, you <strong>just tell jQuery what to do after the mouse has clicked on your selector</strong>.</p>
<p>IMHO, this couldn&#8217;t be any easier. As a newbie, it took me a while to wrap my head around it, but I hope that these examples may help someone save a bit of time trying to figure this out.</p>
<br />Posted in Javascript, jquery, Tips &amp; Tricks  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetdiscussion.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetdiscussion.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetdiscussion.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetdiscussion.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetdiscussion.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetdiscussion.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetdiscussion.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetdiscussion.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetdiscussion.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetdiscussion.wordpress.com/123/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetdiscussion.net&blog=1333069&post=123&subd=dotnetdiscussion&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://dotnetdiscussion.net/2009/12/21/javascript-how-to-implement-callback-functionality/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0e2e822d32a7ab3d7f0b7098d03b1d16?s=96&#38;d=identicon&#38;r=X" medium="image">
			<media:title type="html">Some.Net(Guy)</media:title>
		</media:content>
	</item>
		<item>
		<title>Simple jQuery Expand/Contract Functionality</title>
		<link>http://dotnetdiscussion.net/2009/07/31/simple-jquery-expandcontract-functionality/</link>
		<comments>http://dotnetdiscussion.net/2009/07/31/simple-jquery-expandcontract-functionality/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 19:36:51 +0000</pubDate>
		<dc:creator>Some.Net(Guy)</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[expand/collapse]]></category>
		<category><![CDATA[show/hide]]></category>

		<guid isPermaLink="false">http://dotnetdiscussion.net/?p=119</guid>
		<description><![CDATA[I can&#8217;t express enough how much learning jQuery has expanded my ability to simply and dynamically add amazing effects very easily to my User Interfaces. Maybe I should start a jQuery blog?  
One feature I come across a lot is the ability to expand and contract a section of the page, say a &#60;div&#62;. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetdiscussion.net&blog=1333069&post=119&subd=dotnetdiscussion&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I can&#8217;t express enough how much learning <a href="http://www.jquery.com" target="_blank">jQuery</a> has expanded my ability to simply and dynamically add amazing effects very easily to my User Interfaces. Maybe I should start a jQuery blog? <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>One feature I come across a lot is the ability to expand and contract a section of the page, say a <code>&lt;div&gt;</code>. Before when I wanted to do this, I had to resort to either adding markup to my code and importing huge function-specific script files (ie, all they did was perform the expand/contract) or rely on ASP.NET&#8217;s AjaxToolkit&#8217;s <a href="http://www.asp.net/AJAX/AjaxControlToolkit/Samples/CollapsiblePanel/CollapsiblePanel.aspx" target="_blank">Collapsible Panel Extender</a>. While these solutions&#8230; worked&#8230; I was never really comfortable using them, and they were hardly reusable or scalable. Enter jQuery.</p>
<p>Let&#8217;s say I have a bit of HTML that is like so:</p>
<pre class="brush: xml;">
&lt;p class=&quot;toggle&quot;&gt;Expand/Collapse&lt;/p&gt;
&lt;div&gt;
    &lt;p&gt;Some text goes here!&lt;/p&gt;
&lt;/div&gt;
&lt;p class=&quot;toggle&quot;&gt;Expand/Collapse&lt;/p&gt;
&lt;div&gt;
    &lt;p&gt;Some more text goes here!&lt;/p&gt;
&lt;/div&gt;
</pre>
<p>If you wanted the ability to show/hide that following div, the jQuery is ridiculously simple:</p>
<pre class="brush: jscript;">
$(document).ready(function() {
    $(&quot;.toggle&quot;).click(function () {
        $(this).next(&quot;div&quot;).slideToggle(&quot;fast&quot;);
    });
});
</pre>
<p>Yes, literally that&#8217;s it. So long as you keep with the HTML convention above, that&#8217;s all the jQuery you would need. You don&#8217;t have to add any extra markup or link one ID to another or anything. It&#8217;s all done via jQuery, and pretty much in one line (<code>$(this).next("div").slideToggle("fast");</code>).</p>
<p>Of course, sometimes you may want to do more. For instance, what if you wanted to change the text of the toggle button? Assume now that &#8220;Expand/Collapse&#8221; now reads &#8220;View Additional Info&#8221;. Here&#8217;s your jQuery:</p>
<pre class="brush: jscript;">
$(document).ready(function() {
    $(&quot;.toggle&quot;).toggle(function () {
        $(this).text(&quot;Hide Additional Info&quot;)
        $(this).next(&quot;div&quot;).slideDown(&quot;fast&quot;);
        }, function() {
        $(this).text(&quot;View Additional Info&quot;)
        $(this).next(&quot;div&quot;).slideUp(&quot;fast&quot;);
    });
});
</pre>
<p>Extremely simple, elegant, and even intuitive! If you ever doubted jQuery&#8217;s power before, you may want to reconsider. I sure did.</p>
<br />Posted in jquery, Tips &amp; Tricks Tagged: expand/collapse, show/hide <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetdiscussion.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetdiscussion.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetdiscussion.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetdiscussion.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetdiscussion.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetdiscussion.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetdiscussion.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetdiscussion.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetdiscussion.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetdiscussion.wordpress.com/119/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetdiscussion.net&blog=1333069&post=119&subd=dotnetdiscussion&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://dotnetdiscussion.net/2009/07/31/simple-jquery-expandcontract-functionality/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0e2e822d32a7ab3d7f0b7098d03b1d16?s=96&#38;d=identicon&#38;r=X" medium="image">
			<media:title type="html">Some.Net(Guy)</media:title>
		</media:content>
	</item>
		<item>
		<title>Javascript: Setting the Month on a Date Object</title>
		<link>http://dotnetdiscussion.net/2009/07/28/javascript-setting-month-date-object/</link>
		<comments>http://dotnetdiscussion.net/2009/07/28/javascript-setting-month-date-object/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 19:40:46 +0000</pubDate>
		<dc:creator>Some.Net(Guy)</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[gotchas]]></category>

		<guid isPermaLink="false">http://dotnetdiscussion.net/?p=117</guid>
		<description><![CDATA[While working with dates in Javascript I came across some weirdness that was messing with my date parsing. Apparently in Javascript, years and days are 1-based, but months are 0-based. To set the correct date:
var someDate = new Date(yourYear, yourMonth - 1, yourDay);
Crazy, I know, but hopefully this helps someone out.
Posted in Javascript, Tips &#38; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetdiscussion.net&blog=1333069&post=117&subd=dotnetdiscussion&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>While working with dates in Javascript I came across some weirdness that was messing with my date parsing. Apparently in Javascript, years and days are 1-based, but months are 0-based. To set the correct date:</p>
<p><code>var someDate = new Date(yourYear, yourMonth - 1, yourDay);</code></p>
<p>Crazy, I know, but hopefully this helps someone out.</p>
<br />Posted in Javascript, Tips &amp; Tricks Tagged: gotchas <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetdiscussion.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetdiscussion.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetdiscussion.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetdiscussion.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetdiscussion.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetdiscussion.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetdiscussion.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetdiscussion.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetdiscussion.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetdiscussion.wordpress.com/117/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetdiscussion.net&blog=1333069&post=117&subd=dotnetdiscussion&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://dotnetdiscussion.net/2009/07/28/javascript-setting-month-date-object/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0e2e822d32a7ab3d7f0b7098d03b1d16?s=96&#38;d=identicon&#38;r=X" medium="image">
			<media:title type="html">Some.Net(Guy)</media:title>
		</media:content>
	</item>
		<item>
		<title>Shameless Plug: Quotidian Word</title>
		<link>http://dotnetdiscussion.net/2009/06/22/shameless-plug-quotidian-word/</link>
		<comments>http://dotnetdiscussion.net/2009/06/22/shameless-plug-quotidian-word/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 17:58:04 +0000</pubDate>
		<dc:creator>Some.Net(Guy)</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[plug]]></category>
		<category><![CDATA[quotidianword]]></category>
		<category><![CDATA[vocabulary]]></category>
		<category><![CDATA[words]]></category>

		<guid isPermaLink="false">http://dotnetdiscussion.net/?p=114</guid>
		<description><![CDATA[The site is now live! Check it out: http://www.quotidianword.com. For those who know me, you know that I am a perfectionist and that I pour every ounce of me into whatever project I&#8217;m in. This site is no exception. It has some very cool technical features as well as simply just being easy, fun, and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetdiscussion.net&blog=1333069&post=114&subd=dotnetdiscussion&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>The site is now live! Check it out: <a href="http://www.quotidianword.com">http://www.quotidianword.com</a>. For those who know me, you know that I am a perfectionist and that I pour every ounce of me into whatever project I&#8217;m in. This site is no exception. It has some very cool technical features as well as simply just being easy, fun, and actually educational if you use it right. My favorite feature is the dynamic signature bar that you can drop in a forum signature:</p>
<p><a href="http://www.quotidianword.com/default.aspx?sig=true"><img src="http://www.quotidianword.com/feeds/sig.aspx" alt="QuotidianWord.com" /></a></p>
<p>You should see that this image will change every day, staying current with the current word. It&#8217;s a cool way to keep your signature fresh and interesting (at least I think so <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ) Anyways, I hope you enjoy using the site as much as I do, and as much as I enjoyed making it!</p>
<br />Posted in ASP.NET, Portfolio Tagged: plug, quotidianword, vocabulary, words <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetdiscussion.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetdiscussion.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetdiscussion.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetdiscussion.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetdiscussion.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetdiscussion.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetdiscussion.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetdiscussion.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetdiscussion.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetdiscussion.wordpress.com/114/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetdiscussion.net&blog=1333069&post=114&subd=dotnetdiscussion&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://dotnetdiscussion.net/2009/06/22/shameless-plug-quotidian-word/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0e2e822d32a7ab3d7f0b7098d03b1d16?s=96&#38;d=identicon&#38;r=X" medium="image">
			<media:title type="html">Some.Net(Guy)</media:title>
		</media:content>

		<media:content url="http://www.quotidianword.com/feeds/sig.aspx" medium="image">
			<media:title type="html">QuotidianWord.com</media:title>
		</media:content>
	</item>
		<item>
		<title>jQuery: Awesome</title>
		<link>http://dotnetdiscussion.net/2009/06/12/jquery-awesome/</link>
		<comments>http://dotnetdiscussion.net/2009/06/12/jquery-awesome/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 16:34:22 +0000</pubDate>
		<dc:creator>Some.Net(Guy)</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Visual Studio.NET]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://dotnetdiscussion.net/?p=112</guid>
		<description><![CDATA[Back in the day, I discovered jQuery, but never really did anything with it. I always wanted to learn, but really never had the time. I do now. Let me tell you something:
jQuery is friggin awesome.
Let me preface with the fact that I know little to no JavaScript. I once wrote one function to add [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetdiscussion.net&blog=1333069&post=112&subd=dotnetdiscussion&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Back in the day, <a href="http://dotnetdiscussion.net/2007/12/11/javascript-jquery-interesting/">I discovered jQuery</a>, but never really did anything with it. I always wanted to learn, but really never had the time. I do now. Let me tell you something:</p>
<p><strong><a href="http://www.jquery.com" target="_blank">jQuery</a> is friggin awesome.</strong></p>
<p>Let me preface with the fact that I know little to no JavaScript. I once wrote one function to add the current date to a textbox in JS and it took me around half the day. However, in that same amount of time about two weeks ago, I was able to nearly completely understand how jQuery works. After a week, I was helping out others with their problems.</p>
<p>Don&#8217;t get me wrong, jQuery can&#8217;t do <em>everything</em>, but it sure can do some powerful stuff. For instance, AJAX is a breeze. For one project I had to make an AJAX call to check to see if someone was posting a comment as someone else while logged in as themselves, so I had to write my AJAX function myself. It took me 53 lines of JS and maybe 3 days to get it working right (along with a TON of research). When I wanted to apply that same function to my new project, I thought I would give jQuery a chance.</p>
<p>Eight lines of code. Actually, technically one line of code because I broke it into several lines: </p>
<p><code>function MakeCall(url,doAsync,callback) {<br />
    $.ajax({<br />
        url: url,<br />
        async: doAsync,<br />
        dataType: "text",<br />
        success: callback<br />
    });<br />
}</code></p>
<p>Of course I have to handle the &#8220;callback&#8221; in the function that&#8217;s calling the MakeCall() function, but the actual making the call has been reduced by 85%. And it&#8217;s easier to maintain and reuse! This isn&#8217;t all that jQuery is good for. I believe jQuery&#8217;s strongest feature is its document manipulation. If you want to change something, all you have to do is select the element or class and, well, change it. For instance, if you have a div with an id of &#8220;myDiv&#8221;, to change the CSS class on it, you just do:</p>
<p><code>$("#myDiv").addClass("someClass");</code></p>
<p>Really, that&#8217;s it. If you wanted to do that when something is clicked, you could do:</p>
<p><code>$("#myLink").click(function () { $("#myDiv").addClass("someClass"); });</code></p>
<p>No, for real. That&#8217;s all you have to do. You can also manipulate things on page load:</p>
<p><code>$.(document).ready( function () { //run functions here });</code></p>
<p>The last and I think one of the most important aspects of jQuery is that it is VERY well documented, VERY ardently followed, and VERY well supported. You can even <a href="http://mwtech.blogspot.com/2009/05/how-to-get-jquery-intellisense-working.html" target="_blank">get Intellisense in Visual Studio 2008</a>! I couldn&#8217;t possibly go through all the cool stuff that jQuery can do. You&#8217;ll have to see for yourself. It truly is amazing, and it is, as I was told, &#8220;brain-dead-stupid easy to learn&#8221;.</p>
<br />Posted in AJAX, CSS, Javascript, jquery, Tips &amp; Tricks, Visual Studio.NET  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetdiscussion.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetdiscussion.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetdiscussion.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetdiscussion.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetdiscussion.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetdiscussion.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetdiscussion.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetdiscussion.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetdiscussion.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetdiscussion.wordpress.com/112/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetdiscussion.net&blog=1333069&post=112&subd=dotnetdiscussion&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://dotnetdiscussion.net/2009/06/12/jquery-awesome/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0e2e822d32a7ab3d7f0b7098d03b1d16?s=96&#38;d=identicon&#38;r=X" medium="image">
			<media:title type="html">Some.Net(Guy)</media:title>
		</media:content>
	</item>
		<item>
		<title>Visual Studio/VB.NET: How To Easily Document Your Code</title>
		<link>http://dotnetdiscussion.net/2009/05/20/visual-studiovb-net-how-to-easily-document-your-code/</link>
		<comments>http://dotnetdiscussion.net/2009/05/20/visual-studiovb-net-how-to-easily-document-your-code/#comments</comments>
		<pubDate>Wed, 20 May 2009 22:36:51 +0000</pubDate>
		<dc:creator>Some.Net(Guy)</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[VB.NET]]></category>
		<category><![CDATA[Visual Studio.NET]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[vs2005]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://dotnetdiscussion.net/?p=105</guid>
		<description><![CDATA[If you&#8217;re a routine Visual Studio user like me, I don&#8217;t need to tell you how awesome Intellisense is. Not only would some of us be lost without it, but it also helps us be way more efficient programmers either through simple selection of methods or properties or by discovering new object members that maybe [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetdiscussion.net&blog=1333069&post=105&subd=dotnetdiscussion&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re a routine Visual Studio user like me, I don&#8217;t need to tell you how awesome Intellisense is. Not only would some of us be lost without it, but it also helps us be way more efficient programmers either through simple selection of methods or properties or by discovering new object members that maybe we didn&#8217;t know about previously. Additionally, one of the main benefits of Intellisense is that it tells you  <em>about</em> the item in question, for instance, that the String.IsNullOrEmpty() function &#8220;Indicates whether the specified System.String object is null or an System.String.Empty string.&#8221;</p>
<p><img class="aligncenter size-full wp-image-106" title="Visual Studio Intellisense" src="http://dotnetdiscussion.files.wordpress.com/2009/05/intellisense.gif?w=451&#038;h=187" alt="Visual Studio Intellisense" width="451" height="187" /></p>
<p>When writing my own objects, however, I used to find myself yearning for this kind of help for my own functions. Wouldn&#8217;t it be great to get Intellisense to tell me what that &#8220;GetUserInfo&#8221; function I wrote five weeks ago does rather than me having to go look it up? What about what those parameter names mean? Luckily, there is a way, and it is super easy.</p>
<p>For example, let&#8217;s say you have an object that returns its own permalink in a shared function called <code>GetHTMLPermaLink()</code>. To document it, simply place your cursor above the function and press the apostrophe key three times: <code>'''</code>. Automagically, the following pops up:</p>
<p><img src="http://dotnetdiscussion.files.wordpress.com/2009/05/documentation.gif?w=452&#038;h=167" alt="Function Documentation" title="Function Documentation" width="452" height="167" class="aligncenter size-full wp-image-109" /></p>
<p>All you have to do is fill in the blanks and viola, you have documented code! (NOTE: in C#, I believe the syntax is <code>///</code> but I&#8217;m not sure.) To see this in action, after you fill in the appropriate information, go try to pull up your function somewhere and watch the magic:</p>
<p style="text-align:center;"><img class="aligncenter size-full wp-image-106" title="Visual Studio Intellisense" src="http://dotnetdiscussion.files.wordpress.com/2009/05/intellisense2.gif" alt="Visual Studio Intellisense" /></p>
<p>More information on <a href="http://aspalliance.com/696_Code_Documentation_in_NET" target="_blank">Visual Studio Code Documentation (C#)</a></p>
<p>Happy documenting!</p>
<br />Posted in Tips &amp; Tricks, VB.NET, Visual Studio.NET Tagged: documentation, vs2005, xml <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetdiscussion.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetdiscussion.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetdiscussion.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetdiscussion.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetdiscussion.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetdiscussion.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetdiscussion.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetdiscussion.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetdiscussion.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetdiscussion.wordpress.com/105/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetdiscussion.net&blog=1333069&post=105&subd=dotnetdiscussion&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://dotnetdiscussion.net/2009/05/20/visual-studiovb-net-how-to-easily-document-your-code/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0e2e822d32a7ab3d7f0b7098d03b1d16?s=96&#38;d=identicon&#38;r=X" medium="image">
			<media:title type="html">Some.Net(Guy)</media:title>
		</media:content>

		<media:content url="http://dotnetdiscussion.files.wordpress.com/2009/05/intellisense.gif" medium="image">
			<media:title type="html">Visual Studio Intellisense</media:title>
		</media:content>

		<media:content url="http://dotnetdiscussion.files.wordpress.com/2009/05/documentation.gif" medium="image">
			<media:title type="html">Function Documentation</media:title>
		</media:content>

		<media:content url="http://dotnetdiscussion.files.wordpress.com/2009/05/intellisense2.gif" medium="image">
			<media:title type="html">Visual Studio Intellisense</media:title>
		</media:content>
	</item>
		<item>
		<title>My Foray into Regular Expressions with ASP.NET</title>
		<link>http://dotnetdiscussion.net/2009/05/15/my-foray-into-regular-expressions-with-asp-net/</link>
		<comments>http://dotnetdiscussion.net/2009/05/15/my-foray-into-regular-expressions-with-asp-net/#comments</comments>
		<pubDate>Fri, 15 May 2009 18:45:55 +0000</pubDate>
		<dc:creator>Some.Net(Guy)</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Regex]]></category>
		<category><![CDATA[VB.NET]]></category>
		<category><![CDATA[Visual Studio.NET]]></category>

		<guid isPermaLink="false">http://dotnetdiscussion.net/?p=103</guid>
		<description><![CDATA[I know it&#8217;s been a while since I posted here. I&#8217;ve been working pretty diligently on my newest creation, Quotidian Word, which will essentially be a &#8220;word-a-day&#8221; site that encourages users to actually learn the word and use it actively in everyday speech or writing. Right now it&#8217;s only an email harvester so that I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetdiscussion.net&blog=1333069&post=103&subd=dotnetdiscussion&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I know it&#8217;s been a while since I posted here. I&#8217;ve been working pretty diligently on my newest creation, <a title="Quotidian Word" href="http://www.quotidianword.com" target="_blank">Quotidian Word</a>, which will essentially be a &#8220;word-a-day&#8221; site that encourages users to actually learn the word and use it actively in everyday speech or writing. Right now it&#8217;s only an email harvester so that I can send an email to those interested when it&#8217;s ready, but I&#8217;m nearing the launch point every day <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Anyways, the point of this post is to discuss my dip into the world of <a title="Regular Expressions" href="http://en.wikipedia.org/wiki/Regular_expressions" target="_blank">Regular Expressions</a>. I needed to come up with a way to find the word I wanted in a sentence. Easy enough, right? Just <code>mySentence.Contains("myword")</code> and there you go. It would be nice if that&#8217;s all I had to do, but English is a funny language. Every word can assume many forms. For instance, if I want to find the word &#8220;entry&#8221; in a sentence, I also would like to find &#8220;entries&#8221;. Or more simply, if i&#8217;m looking for &#8220;dog&#8221; I also want to find &#8220;dogs&#8221;. Using the <code>mySentence.Contains()</code> method, I would not find &#8220;entries&#8221; and I would find only the &#8220;dog&#8221; in &#8220;dogs&#8221;.</p>
<p>Enter regular expressions.</p>
<p>I had previously shied away from them because when one looks at a regular expression (aka &#8220;regex&#8221;), it can be rather intimidating. Take this stock regular expression that comes with Visual Studio as a default for finding an email address:</p>
<p><code>\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*</code></p>
<p>Your reaction may be the same as mine was: WTF. But when you try to enter an email in a textbox validated by this regex, it knows if you are or not. So my problem was still, how do I find all forms of any word I choose? I took a couple factors into mind, such as, I will mostly be using more obscure words with less common roots, so that will help a bit, and I won&#8217;t be using too many really short words that can be blended into other words in a sentence.</p>
<p>My first thought was ok, how about I first try to find the whole word, then the whole word plus a suffix, then the whole word minus a letter plus a suffix, then a the whole word minus <em>two</em> letters plus a suffix:</p>
<p><code>\bentry\b|((\bentry|\bentr|\bent)(s|es|ies)\b)</code></p>
<p>I used the word &#8220;entry&#8221; as an example here. &#8220;\b&#8221; means either the beginning or the end of a word and &#8220;|&#8221; means &#8220;or&#8221;. The rest is just separated by parens. This worked out ok for a while until I realized that the English language has something like a thousand suffixes. I knew regexes were more powerful than that. There had to be an easier way.</p>
<p>And there was! I was sort of on the right track with the losing of the last two letters. In English, <strong>most</strong> words either simply append a suffix (dog -&gt; dogs), drop one letter and append a suffix (happy -&gt; happiness) or drop two letters and append a suffix (cactus -&gt; cacti). Aside from the word &#8220;person&#8221; (person -&gt; people) I could not think of an instance where a word dropped three or more and would profide me with enough remaining information to actually distinguish it from other words in the sentence. If you can, let me know.</p>
<p>So after a bit more research, and the testing from a handy regex tool called <a href="http://www.ultrapico.com/Expresso.htm" target="_blank">Expresso</a>, my regex eventually evolved into: <code>(?:ent(?:r|ry)?).+?\b</code></p>
<p>Explanation: &#8220;ent&#8221; is what I called the &#8220;root&#8221; of the word, essentially the letters remaining after the last two have been stripped off. &#8220;(?:&#8221; is a grouping that means &#8220;find whatever&#8217;s here, but don&#8217;t actually match it alone&#8221;. This way it doesn&#8217;t find only &#8220;ent&#8221; or &#8220;r&#8221; or &#8220;ry&#8221; and match it, but rather matches the whole thing all together. The clause &#8220;(?:r|ry)?&#8221; means find &#8220;r&#8221; OR &#8220;ry&#8221; (in addition to what comes before it, so &#8220;entr&#8221; or &#8220;entry&#8221;). The &#8220;?&#8221; at the end means the whole clause before it is optional, meaning if it&#8217;s not there, it&#8217;s ok. The &#8220;.+&#8221; means find any character after the previous clause for as many repetitions as you can, so for instance, if the word in the sentence is &#8220;entries&#8221; it will first find the &#8220;ent&#8221; then the &#8220;r&#8221; then any characters that follow &#8220;ies&#8221; up until the end of the word, &#8220;\b&#8221;. The &#8220;?&#8221; at the end of the &#8220;.+&#8221; just means take as few characters as possible up to the next clause, which is the &#8220;\b&#8221;.</p>
<p>Whew! That&#8217;s a lot. I found that this found about 99% of the words that I would be using in all their various forms. But then I got to thinking, what about prefixes? What if someone used something like &#8220;anti&#8221; or &#8220;pre&#8221; or something in front of a word to change it just slightly? Hence, my (nearly) final product:</p>
<p><code>(?:(?:\b\w+)?{1}(?:{2}|{3})?).+?\b</code></p>
<p>where {1} is the word minus the last two letters, {2} is the penultimate letter, and {3} is the last two letters. The optional clause at the beginning takes care of any prefix if it happens to exist.</p>
<p>Great! All done. It can pull it out of a string, no problem. Now if someone enters the word in a sentence in my textbox it will find&#8230;it&#8230; crap. It doesn&#8217;t work as is with the RegexValidator in ASP.NET on textboxes. Why? Because the validator is looking at the <em>whole string</em> in the textbox to see if it fits the regular expression. For instance, the email regular expression assumes that whatever you enter into that textbox is going to be an email, nothing else. If you enter a sentence into a textbox, it assumes that whatever you enter into that textbox is going to fit the regex.</p>
<p>In order to counter this problem, I put in a simple fix: I prepended and appended my regex for textboxes with &#8220;.*&#8221;, which means that it will find any characters before or after the word we&#8217;re looking for. Done! &#8230; Right?</p>
<p>So I thought, until I realized that when people enter sentences, usually they do so in multiline textboxes, as they&#8217;re easier to see everything you&#8217;re doing. This regex works until the user hits the &#8220;Enter&#8221; key and inserts a new line. After much research and hair pulling, I eventually found the solution:</p>
<p><code>^(.|\r|\n)*(?:(?:\b\w+)?{1}(?:{2}|{3})?).+?\b(.|\r|\n)*$</code></p>
<p>with {1},{2}, and {3} meaning the same thing. The interesting thing about the &#8220;.&#8221; character in regexes is it means &#8220;match any character&#8230;..except new lines and carriage returns&#8221;, which means if you&#8217;re using multiline textboxes, you have to account for that. So I had to prepend &#8220;^(.|\r|\n)*&#8221; and append &#8220;(.|\r|\n)*$&#8221; to my already unwieldy regex. &#8220;\r&#8221; is a carriage return and &#8220;\n&#8221; is a new line. The &#8220;^&#8221; symbol means start at the beginning of the string, and the &#8220;$&#8221; means continue to the end of the string, with the &#8220;*&#8221; symbols meaning repeat as often as necessary.</p>
<p>To finalize the product, I simply plugged all of this information into a shared function that returns the proper regex (based on a parameter that determines if I&#8217;m using it on a regular string, a textbox, or a multiline textbox) and set my validator&#8217;s ValidationExpression at runtime based on the word I was looking for. It actually works pretty well&#8230; so far&#8230;. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>All in all, I think I like regexes. They are undoubtedly powerful and can save many programming hours if you know how to use them. I know the initial function I was using to find words in a sentence took me maybe two hours to write and it didn&#8217;t even work all the time. It was also about 200ish lines of code. My new function using regexes is 17 lines of actual code, and 7 of that is a Select statement for string/textbox/multiline textbox.</p>
<p>While the initial learning curve is quite steep for regexes, if you&#8217;re serious about programming, I highly suggest that you take a day or two to learn them, as that day or two investment could save you weeks or months down the line of your programming career.</p>
<p>Some regex resources:</p>
<ul>
<li><a href="http://www.regular-expressions.info">www.regular-expressions.info</a></li>
<li><a href="http://gnosis.cx/publish/programming/regular_expressions.html">http://gnosis.cx/publish/programming/regular_expressions.html</a></li>
<li><a href="http://www.silverstones.com/thebat/Regex.html">http://www.silverstones.com/thebat/Regex.html</a></li>
<li><a href="http://www.codeproject.com/KB/dotnet/regextutorial.aspx">http://www.codeproject.com/KB/dotnet/regextutorial.aspx</a></li>
</ul>
<p><strong>What&#8217;s your craziest regex?</strong></p>
<br />Posted in ASP.NET, Javascript, Regex, VB.NET, Visual Studio.NET  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetdiscussion.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetdiscussion.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetdiscussion.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetdiscussion.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetdiscussion.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetdiscussion.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetdiscussion.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetdiscussion.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetdiscussion.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetdiscussion.wordpress.com/103/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetdiscussion.net&blog=1333069&post=103&subd=dotnetdiscussion&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://dotnetdiscussion.net/2009/05/15/my-foray-into-regular-expressions-with-asp-net/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0e2e822d32a7ab3d7f0b7098d03b1d16?s=96&#38;d=identicon&#38;r=X" medium="image">
			<media:title type="html">Some.Net(Guy)</media:title>
		</media:content>
	</item>
		<item>
		<title>ASP.NET: Create a User Control Property with Selectable Options</title>
		<link>http://dotnetdiscussion.net/2009/02/05/aspnet-create-a-user-control-property-with-selectable-options/</link>
		<comments>http://dotnetdiscussion.net/2009/02/05/aspnet-create-a-user-control-property-with-selectable-options/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 16:04:42 +0000</pubDate>
		<dc:creator>Some.Net(Guy)</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[VB.NET]]></category>
		<category><![CDATA[Visual Studio.NET]]></category>

		<guid isPermaLink="false">http://dotnetdiscussion.net/?p=94</guid>
		<description><![CDATA[I guess I&#8217;ve always taken those little options for granted whenever I want to pick something in a control, say what mode to put a textbox in (text, multiline, or password), because when I wanted to add something similar for a user control, I had no idea how to do it. Thanks to the friendly [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetdiscussion.net&blog=1333069&post=94&subd=dotnetdiscussion&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I guess I&#8217;ve always taken those little options for granted whenever I want to pick something in a control, say what mode to put a textbox in (text, multiline, or password), because when I wanted to add something similar for a user control, I had no idea how to do it. Thanks to the friendly and extremely helpful people at <a title="Stack Overflow" href="http://stackoverflow.com" target="_blank">StackOverflow</a>, I was able to grok the answer.</p>
<p><img class="aligncenter size-full wp-image-95" title="Intellisense options" src="http://dotnetdiscussion.files.wordpress.com/2009/02/options.jpg?w=305&#038;h=96" alt="Intellisense options" width="305" height="96" /></p>
<p>Here&#8217;s the scenario: you have a user control in your .aspx page with one property, say &#8220;addedorapproved&#8221; as in the above image. You want the options &#8220;Added&#8221; and &#8220;Approved&#8221; to show up as your selectable options. To do so, you must complete the following steps:</p>
<ol>
<li>Create an enum with your available options:<br />
<span style="color:#0000ff;">Enum </span>AddApproveOptions<br />
Added<br />
Approved<br />
<span style="color:#0000ff;">End Enum</span></li>
<li>Create your private member as your Enum:<br />
<span style="color:#0000ff;">Private</span> _addedapproved <span style="color:#0000ff;">As</span> AddApproveOptions</li>
<li>Create your property as your Enum:<br />
<span style="color:#0000ff;">Public Property</span> AddedOrApproved() <span style="color:#0000ff;">As</span> AddApproveOptions<br />
<span style="color:#0000ff;">Get</span><br />
<span style="color:#0000ff;">Return</span> _addedapproved<br />
<span style="color:#0000ff;">End Get<br />
</span><span style="color:#0000ff;">Set</span>(<span style="color:#0000ff;">ByVal</span> value <span style="color:#0000ff;">As</span> AddApproveOptions)<br />
_addedapproved = value<br />
<span style="color:#0000ff;">End Set<br />
End Property</span></li>
</ol>
<p> And that&#8217;s it! You should see the little Intellisense box pop up with your options for your new property!</p>
<br />Posted in ASP.NET, Tips &amp; Tricks, VB.NET, Visual Studio.NET  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetdiscussion.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetdiscussion.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetdiscussion.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetdiscussion.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetdiscussion.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetdiscussion.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetdiscussion.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetdiscussion.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetdiscussion.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetdiscussion.wordpress.com/94/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetdiscussion.net&blog=1333069&post=94&subd=dotnetdiscussion&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://dotnetdiscussion.net/2009/02/05/aspnet-create-a-user-control-property-with-selectable-options/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0e2e822d32a7ab3d7f0b7098d03b1d16?s=96&#38;d=identicon&#38;r=X" medium="image">
			<media:title type="html">Some.Net(Guy)</media:title>
		</media:content>

		<media:content url="http://dotnetdiscussion.files.wordpress.com/2009/02/options.jpg" medium="image">
			<media:title type="html">Intellisense options</media:title>
		</media:content>
	</item>
		<item>
		<title>Google Search Funny</title>
		<link>http://dotnetdiscussion.net/2008/12/03/google-search-funny/</link>
		<comments>http://dotnetdiscussion.net/2008/12/03/google-search-funny/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 15:43:15 +0000</pubDate>
		<dc:creator>Some.Net(Guy)</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://dotnetdiscussion.wordpress.com/?p=86</guid>
		<description><![CDATA[Although a bit unrelated to .NET, this was too funny not to share:
Every morning, I go through my www.columbussupply.com logs to see how products are doing, which are being visited, and where people come from to see how we&#8217;re placed and what other products show up. One such referral URL caught my eye: http://www.google.com/search?q=Deluxe+Model+Inflatable+Woman&#38;ie=utf-8&#38;oe=utf-8&#38;aq=t&#38;rls=org.mozilla:en-US:official&#38;client=firefox-a
Which results [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetdiscussion.net&blog=1333069&post=86&subd=dotnetdiscussion&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Although a bit unrelated to .NET, this was too funny not to share:</p>
<p>Every morning, I go through my <a href="http://www.columbussupply.com">www.columbussupply.com</a> logs to see how products are doing, which are being visited, and where people come from to see how we&#8217;re placed and what other products show up. One such referral URL caught my eye: <a href="http://www.google.com/search?q=Deluxe+Model+Inflatable+Woman&amp;ie=utf-8&amp;oe=utf-8&amp;aq=t&amp;rls=org.mozilla:en-US:official&amp;client=firefox-a">http://www.google.com/search?q=Deluxe+Model+Inflatable+Woman&amp;ie=utf-8&amp;oe=utf-8&amp;aq=t&amp;rls=org.mozilla:en-US:official&amp;client=firefox-a</a></p>
<p>Which results in this (Note: I moved the results count to the left in photoshop to keep the image smaller):</p>
<p><a href="http://dotnetdiscussion.files.wordpress.com/2008/12/ss1.jpg"><img class="size-full wp-image-89 alignnone" title="Google Screen Shot" src="http://dotnetdiscussion.files.wordpress.com/2008/12/ss1.jpg?w=539&#038;h=203" alt="Google Screen Shot" width="539" height="203" /></a></p>
<p style="text-align:center;">
<p>Yes, that is someone searching for a blowup doll and found my site. As the first result in Google. At 6am. Hey, traffic is traffic, right?</p>
<br />Posted in Google, Random  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetdiscussion.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetdiscussion.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetdiscussion.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetdiscussion.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetdiscussion.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetdiscussion.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetdiscussion.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetdiscussion.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetdiscussion.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetdiscussion.wordpress.com/86/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetdiscussion.net&blog=1333069&post=86&subd=dotnetdiscussion&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://dotnetdiscussion.net/2008/12/03/google-search-funny/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0e2e822d32a7ab3d7f0b7098d03b1d16?s=96&#38;d=identicon&#38;r=X" medium="image">
			<media:title type="html">Some.Net(Guy)</media:title>
		</media:content>

		<media:content url="http://dotnetdiscussion.files.wordpress.com/2008/12/ss1.jpg" medium="image">
			<media:title type="html">Google Screen Shot</media:title>
		</media:content>
	</item>
		<item>
		<title>Advertising Update</title>
		<link>http://dotnetdiscussion.net/2008/11/10/advertising-update/</link>
		<comments>http://dotnetdiscussion.net/2008/11/10/advertising-update/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 14:29:25 +0000</pubDate>
		<dc:creator>Some.Net(Guy)</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[Adsense]]></category>
		<category><![CDATA[Advertising]]></category>

		<guid isPermaLink="false">http://dotnetdiscussion.wordpress.com/?p=80</guid>
		<description><![CDATA[After speaking some more with the &#8221;powers that be&#8221; I decided to go forth with the ad units. You can find them on any product page at www.columbussupply.com. I tried to blend the ads into the theme of the site without hiding them entirely. The purpose of the ads is still for them to be clicked, but [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetdiscussion.net&blog=1333069&post=80&subd=dotnetdiscussion&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>After speaking some more with the &#8221;powers that be&#8221; I decided to go forth with the ad units. You can find them on any product page at <a href="http://www.columbussupply.com">www.columbussupply.com</a>. I tried to blend the ads into the theme of the site without hiding them entirely. The purpose of the ads is still for them to be clicked, but not to overpower the message of the product description, as the purpose of the product description is still to sell the product. Essentially, we&#8217;re trying to monetize the casual browser who is not really intending to buy anything but is rather looking around or comparison shopping. Those who are looking to buy something will buy something, ad click or not, since we really (actually) do have the best prices on the internet for virtually everything we sell.</p>
<p>I&#8217;m not new to adsense or the placement of ads. I am aware that the placement of the ad is not optimal for the best clickthroughs, but that&#8217;s not the point. I don&#8217;t want my customers to see an ad as the first thing on the page, but rather as they work their way down and have already been served the product description message. The primary goal is to sell products, and I feel that some people may get turned off if they are bombarded with ads as soon as they hit the page.</p>
<p>I&#8217;m interested to hear feedback on how the ads are placed, if they&#8217;re too overbearing, too obvious, not obvious enough, whatever. Do the ads serve their purpose?</p>
<br />Posted in Random Tagged: Adsense, Advertising <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetdiscussion.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetdiscussion.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetdiscussion.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetdiscussion.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetdiscussion.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetdiscussion.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetdiscussion.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetdiscussion.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetdiscussion.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetdiscussion.wordpress.com/80/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetdiscussion.net&blog=1333069&post=80&subd=dotnetdiscussion&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://dotnetdiscussion.net/2008/11/10/advertising-update/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0e2e822d32a7ab3d7f0b7098d03b1d16?s=96&#38;d=identicon&#38;r=X" medium="image">
			<media:title type="html">Some.Net(Guy)</media:title>
		</media:content>
	</item>
	</channel>
</rss>