<?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>SODEVE &#187; Programming</title>
	<atom:link href="http://sodeve.net/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://sodeve.net</link>
	<description>a Software Developer(SODEVE)&#039;s blog recording his journey in pursuit of happyness.</description>
	<lastBuildDate>Fri, 13 Apr 2012 03:24:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Free Web Workshop on Reactive.NET</title>
		<link>http://sodeve.net/2012/03/free-web-workshop-on-reactive-net/</link>
		<comments>http://sodeve.net/2012/03/free-web-workshop-on-reactive-net/#comments</comments>
		<pubDate>Mon, 12 Mar 2012 15:05:55 +0000</pubDate>
		<dc:creator>Hardono</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[rx.net]]></category>

		<guid isPermaLink="false">http://sodeve.net/?p=2464</guid>
		<description><![CDATA[Reactive.NET is an extension to LINQ which will make asynchronous programming a breeze. It has been around for quite sometime. I first heard about it maybe 2-3 years ago, but I didn&#8217;t have the will-power to follow through. But today at office I re-realize that asynchronous programming is really hard. All these plumbing methods and [...]
Related posts:<ol>
<li><a href='http://sodeve.net/2010/10/free-e-books-for-net-programmers-and-architects/' rel='bookmark' title='Free E-Books for .NET Programmers and Architects'>Free E-Books for .NET Programmers and Architects</a></li>
<li><a href='http://sodeve.net/2009/04/get-your-free-ebook-illustrated-c-2008/' rel='bookmark' title='Get Your Free eBook: Illustrated C# 2008'>Get Your Free eBook: Illustrated C# 2008</a></li>
<li><a href='http://sodeve.net/2007/06/so-you-like-ms-paint-here-is-the-free-and-much-much-better-replacement/' rel='bookmark' title='So You Like MS Paint? Here is the Free and Much much better Replacement'>So You Like MS Paint? Here is the Free and Much much better Replacement</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Reactive.NET is an extension to LINQ which will make asynchronous programming a breeze. It has been around for quite sometime. I first heard about it maybe 2-3 years ago, but I didn&#8217;t have the will-power to follow through. But today at office I <em>re-</em>realize that asynchronous programming is <em>really</em> hard. All these plumbing methods and delegates are simply boring.</p>
<p>So I found the needed <a href="http://channel9.msdn.com/Series/Rx-Workshop" title="Rx Workshop" target="_blank">video workshops</a> at Channel 9. I think they have the order quite mixed-up. So here are the video workshops in the correct order:</p>
<ol>
<li><a href="http://channel9.msdn.com/Series/Rx-Workshop/Rx-Workshop-Introduction" title="Rx Workshop: Introduction" target="_blank">Rx Workshop: Introduction</a></li>
<li><a href="http://http://channel9.msdn.com/Series/Rx-Workshop/Rx-Workshop-Observables-versus-Events" title="Rx Workshop: Observables versus Events" target="_blank">Rx Workshop: Observables versus Events</a></li>
<li><a href="http://http://channel9.msdn.com/Series/Rx-Workshop/Rx-Workshop-Unified-Programming-Model" title="Rx Workshop: Unified Programming Model" target="_blank">Rx Workshop: Unified Programming Model</a></li>
<li><a href="http://http://channel9.msdn.com/Series/Rx-Workshop/Rx-Workshop-Writing-Queries" title="Rx Workshop: Writing Queries" target="_blank">Rx Workshop: Writing Queries</a></li>
<li><a href="http://http://channel9.msdn.com/Series/Rx-Workshop/Rx-Workshop-Schedulers" title="Rx Workshop: Schedulers" target="_blank">Rx Workshop: Schedulers</a></li>
<li><a href="http://http://channel9.msdn.com/Series/Rx-Workshop/Rx-Workshop-Event-Processing" title="Rx Workshop: Event Processing" target="_blank">Rx Workshop: Event Processing</a></li>
<li><a href="http://http://channel9.msdn.com/Series/Rx-Workshop/Rx-Workshop-7-Reactive-Coincidence" title="Rx Workshop: Reactive Coincidence" target="_blank">Rx Workshop: Reactive Coincidence</a></li>
<li><a href="http://http://channel9.msdn.com/Series/Rx-Workshop/Rx-Workshop-8-Programming-the-Cloud" title="Rx Workshop: Programming the Cloud" target="_blank">Rx Workshop: Programming the Cloud</a></li>
</ol>
<p>I&#8217;ll write more post about Reactive.NET once I become familiar with it <img src='http://sodeve.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h2>Share and Enjoy</h2>

<!-- Start WP Socializer - Social Buttons - Output -->
<div class="wp-socializer 32px">
<ul class="wp-socializer-jump columns-no">
 <li><a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsodeve.net%2F2012%2F03%2Ffree-web-workshop-on-reactive-net%2F&amp;t=Free+Web+Workshop+on+Reactive.NET" title="Share this on Facebook" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Facebook" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -330px; border:0;"/></a></li> 

 <li><a href="http://twitter.com/home?status=Free+Web+Workshop+on+Reactive.NET%20-%20http%3A%2F%2Fsodeve.net%3Fp%3D2464%20@sodeve" title="Tweet this !" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Twitter" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -1386px; border:0;"/></a></li> 

 <li><a href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsodeve.net%2F2012%2F03%2Ffree-web-workshop-on-reactive-net%2F&amp;title=Free+Web+Workshop+on+Reactive.NET&amp;annotation=Reactive.NET+is+an+extension+to+LINQ+which+will+make+asynchronous+programming+a+breeze.+It+has+been+around+for+quite+sometime.+I+first+heard+about+it+maybe+2-3+years+ago%2C+but+I+didn%27t+have+the+will-power+to+follow+through.+But+today+at+office+I+re-re" title="Bookmark this on Google" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Google" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -462px; border:0;"/></a></li> 

 <li><a href="http://delicious.com/post?url=http%3A%2F%2Fsodeve.net%2F2012%2F03%2Ffree-web-workshop-on-reactive-net%2F&amp;title=Free+Web+Workshop+on+Reactive.NET&amp;notes=Reactive.NET+is+an+extension+to+LINQ+which+will+make+asynchronous+programming+a+breeze.+It+has+been+around+for+quite+sometime.+I+first+heard+about+it+maybe+2-3+years+ago%2C+but+I+didn%27t+have+the+will-power+to+follow+through.+But+today+at+office+I+re-re" title="Post this on Delicious" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Delicious" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -132px; border:0;"/></a></li> 

 <li><a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsodeve.net%2F2012%2F03%2Ffree-web-workshop-on-reactive-net%2F&amp;title=Free+Web+Workshop+on+Reactive.NET&amp;bodytext=Reactive.NET+is+an+extension+to+LINQ+which+will+make+asynchronous+programming+a+breeze.+It+has+been+around+for+quite+sometime.+I+first+heard+about+it+maybe+2-3+years+ago%2C+but+I+didn%27t+have+the+will-power+to+follow+through.+But+today+at+office+I+re-re" title="Submit this to Digg" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Digg" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -231px; border:0;"/></a></li> 

 <li><a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsodeve.net%2F2012%2F03%2Ffree-web-workshop-on-reactive-net%2F&amp;title=Free+Web+Workshop+on+Reactive.NET" title="Submit this to StumbleUpon" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="StumbleUpon" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -1287px; border:0;"/></a></li> 

 <li><a href="http://sodeve.net/2012/03/free-web-workshop-on-reactive-net/" onclick="addBookmark(event);" title="Free Web Workshop on Reactive.NET" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Add to favorites" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -0px; border:0;"/></a></li> 

 <li><a href="mailto:subject=Free Web Workshop on Reactive.NET&amp;body=Reactive.NET is an extension to LINQ which will make asynchronous programming a breeze. It has been around for quite sometime. I first heard about it maybe 2-3 years ago, but I didn't have the will-power to follow through. But today at office I re-re - http://sodeve.net/2012/03/free-web-workshop-on-reactive-net/" title="Email this" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Email" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -297px; border:0;"/></a></li> 

 <li><a href="http://sodeve.net/feed/rss/" title="Subscribe to RSS" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="RSS" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -1221px; border:0;"/></a></li> 
</ul> 
<div class="wp-socializer-clearer"></div></div>
<!-- End WP Socializer - Social Buttons - Output -->
<p>Related posts:</p><ol>
<li><a href='http://sodeve.net/2010/10/free-e-books-for-net-programmers-and-architects/' rel='bookmark' title='Free E-Books for .NET Programmers and Architects'>Free E-Books for .NET Programmers and Architects</a></li>
<li><a href='http://sodeve.net/2009/04/get-your-free-ebook-illustrated-c-2008/' rel='bookmark' title='Get Your Free eBook: Illustrated C# 2008'>Get Your Free eBook: Illustrated C# 2008</a></li>
<li><a href='http://sodeve.net/2007/06/so-you-like-ms-paint-here-is-the-free-and-much-much-better-replacement/' rel='bookmark' title='So You Like MS Paint? Here is the Free and Much much better Replacement'>So You Like MS Paint? Here is the Free and Much much better Replacement</a></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://sodeve.net/2012/03/free-web-workshop-on-reactive-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Change Your WordPress&#8217;s Prev/Next Link Style Using jQuery</title>
		<link>http://sodeve.net/2012/02/how-to-change-your-wordpresss-navigational-style-using-jquery/</link>
		<comments>http://sodeve.net/2012/02/how-to-change-your-wordpresss-navigational-style-using-jquery/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 11:01:27 +0000</pubDate>
		<dc:creator>Hardono</dc:creator>
				<category><![CDATA[Business & Management]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://sodeve.net/?p=2434</guid>
		<description><![CDATA[Apparently, the word &#8216;satisfaction&#8217; is not in my dictionary when related to design of this blog. Just last week, after sailing in the sea of Google search result, I was stranded at Guillermo Rauch&#8217;s beautiful blog &#8211;Devthought reading his post about Node.JS. While scrolling ups and downs trying to digest the content, I noticed that [...]
Related posts:<ol>
<li><a href='http://sodeve.net/2009/09/how-to-use-jquery-in-your-wordpress-post/' rel='bookmark' title='How to use jQuery in Your WordPress Post'>How to use jQuery in Your WordPress Post</a></li>
<li><a href='http://sodeve.net/2009/09/how-to-prevent-wordpress-loads-jquery-twice/' rel='bookmark' title='How to Prevent WordPress Loads jQuery Twice'>How to Prevent WordPress Loads jQuery Twice</a></li>
<li><a href='http://sodeve.net/2009/09/using-jquery-to-enhance-google-syntax-highligher-wordpress-plugin/' rel='bookmark' title='Using jQuery to Enhance Google Syntax Highligher WordPress Plugin'>Using jQuery to Enhance Google Syntax Highligher WordPress Plugin</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Apparently, the word &#8216;satisfaction&#8217; is not in my dictionary when related to design of this blog. Just last week, after sailing in the sea of Google search result, I was stranded at Guillermo Rauch&#8217;s beautiful blog &#8211;<a href="http://www.devthought.com" target="_blank">Devthought</a> reading his post about Node.JS.</p>
<p>While scrolling ups and downs trying to digest the content, I noticed that there are left and right navigational buttons which are statically positioned. So even when I scrolled all the way up or down, the buttons will remain at the same position.</p>
<p>I totally bought this very good idea. I realized that this help the readers alot. They did not need to comb through the page to find the previous/next buttons.</p>
<p><img src="http://sodeve.net/wp-content/uploads/2012/02/devthought-nav.png" alt="" title="devthought-nav" width="620" height="326" class="aligncenter size-full wp-image-2439" /></p>
<p>Then I looked back at this very own blog&#8217;s navigational links. To my dismay, they are now looks totally unacceptable <img src='http://sodeve.net/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  </p>
<p><img src="http://sodeve.net/wp-content/uploads/2012/02/sodeve-nav.png" alt="" title="sodeve-nav" width="620" height="298" class="aligncenter size-full wp-image-2442" /></p>
<p>So, I want to make this blog navigational buttons statically positioned too. But then I remember, visitors to this blog are not all using 24&#8243; wide flat screen. To validate my suspicion, I logged in to Google Analytics and look at the visitors&#8217; browser information.</p>
<p><img src="http://sodeve.net/wp-content/uploads/2012/02/sodeve-browser-stat.png" alt="" title="sodeve-browser-stat" width="620" height="273" class="aligncenter size-full wp-image-2443" /></p>
<p>Aha! Many of this blog&#8217;s visitors are still using resolution with 1024 pixels of width. Considering that this blog requires at least 960 pixels, I need to ensure that this changes only affect those visitors that have enough free pixels on the left and right side for the links. For that very reason, I can&#8217;t do the modification on the WordPress&#8217; template. Hence, jQuery is the only way to go.</p>
<p>In summary, the jQuery script will do the following steps:</p>
<ol>
<li>get the width of browser&#8217;s window.</li>
<li>if have enough space for the links, then set the links into fixed position and then hide the links&#8217; original container.</li>
<li>if not, check whether the links&#8217; container is hidden. If hidden, make it visible and move the links inside</li>
<li>repeat step 1,2,3 when the window is resized</li>
</ol>
<p>To implement this, I need to firstly modify the navigational links in my template&#8217;s <span class="method">index.php</span> and <span class="method">single.php</span>.</p>
<h3>index.php</h3>
<pre name="code" class="html">
&lt;div class=&quot;navigation&quot;  id=&quot;divPostNav&quot;&gt;
	&lt;div id=&quot;divPrev&quot; class=&quot;left&quot;&gt;
		&lt;h3&gt;&lt;?php next_posts_link(__('&amp;laquo; Previous Entries', 'pyrmont_v2')); ?&gt;&lt;/h3&gt;
	&lt;/div&gt;
	&lt;div id=&quot;divNext&quot; class=&quot;right&quot;&gt;
		&lt;h3&gt;&lt;?php previous_posts_link(__('Next Entries &amp;raquo;', 'pyrmont_v2')); ?&gt;&lt;/h3&gt;
	&lt;/div&gt;
	&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
</pre>
<h3>single.php</h3>
<pre name="code" class="html">
&lt;div class=&quot;post&quot; id=&quot;divPostNav&quot;&gt;
	&lt;div class=&quot;navigation&quot;&gt;
	&lt;div id=&quot;divPrev&quot; style=&quot;width:50%&quot; class=&quot;left&quot;&gt;
		&lt;h3&gt;&lt;?php previous_post_link('%link','&amp;lt;&amp;lt; %title'); ?&gt;&lt;/h3&gt;
	&lt;/div&gt;
	&lt;div id=&quot;divNext&quot; style=&quot;width:50%; text-align:right;&quot; class=&quot;right&quot;&gt;
		&lt;h3&gt;&lt;?php next_post_link('%link','%title &amp;gt;&amp;gt;'); ?&gt;&lt;/h3&gt;
	&lt;/div&gt;
	&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
 &lt;/div&gt;
</pre>
<p>Next, I need to add the following script to <span class="method">footer.php</span></p>
<pre name="code" class="js">
if (jQuery)
{
	/* obtain jQuery instance */
	$sdv = jQuery.noConflict();

	/* ensure the links look &#038; feel consistent */
	var formatLink = function(strEl){
		var pEl = $sdv(strEl);
		if (pEl.length>0) {
			pEl.children().children().css('color','#ccc');
			pEl.children().children().hover(
				function(){$sdv(this).css('color','#E1771E');},
				function(){$sdv(this).css('color','#ccc');}
			);
		}
	}
	formatLink("#divPrev");
	formatLink("#divNext");

	var fnModifyNavigation = function(){
		/* obtain window's width */
		var w = $sdv(window).width();
		var hw = (w-970)/2;
		if (hw>200)
		{
			/* we have enough space for the fixed postion links */
			jQFPL($sdv("#divPrev"),'left',0, hw);
			jQFPL($sdv("#divNext"),'right', 0, hw);
			$sdv("#divPostNav").hide();
		}
		else
		{
			/* not enough space for the fixed postion links */
			var divNav = $sdv("#divPostNav");
			if (divNav.length > 0) {
				if (divNav.css('display') == 'none')
				{
					divNav.show();
					divNav.prepend(jQSPL("#divNext", "right"));
					divNav.prepend(jQSPL("#divPrev", "left"));
				}
			}
		}
	}	

	/* jQuery Fixed Position Link */
	var jQFPL = function(el, remClass, absPosPX, width)
	{
		var pEl = el.detach();
		if (pEl) {
			pEl.removeClass(remClass);
			eval("var objStyle = { 'position':'fixed', 'top':'300px', 'width': '"
				+ width + "px', '" + remClass + "':'" + absPosPX+ "px', 'text-align':'"
				+remClass+"'};");
			pEl.css(objStyle);
			pEl.appendTo("body");
		}
	}

	/* jQuery Static Position Link*/
	var jQSPL = function(strEl, strFloat){
		var el = $sdv(strEl).detach();
		el.css('position','static');
		el.css('width','50%');
		el.css('float',strFloat);
		return el;
	}

	/* run position modification routine
		after the document is loaded */
	$sdv(fnModifyNavigation);	

	/* handle the window's resize event
		and run position modification routine again */
	$sdv(window).resize(fnModifyNavigation);
}
</pre>
<p>That&#8217;s all needed to make the prev/next navigational links statically positioned on the screen.</p>
<p>I hope it helps, cheers!</p>
<h3>References</h3>
<blockquote>
<ol>
<li><a href="http://api.jquery.com/category/selectors/" target="_blank">jQuery Selectors</a></li>
<li><a href="http://api.jquery.com/category/css/" target="_blank">jQuery CSS</a></li>
<li><a href="http://api.jquery.com/category/manipulation/" target="_blank">jQuery DOM Manipulation</a></li>
<li><a href="http://api.jquery.com/category/events/" target="_blank">jQuery Events</a></li>
</li>
</ol>
</blockquote>
<h2>Share and Enjoy</h2>

<!-- Start WP Socializer - Social Buttons - Output -->
<div class="wp-socializer 32px">
<ul class="wp-socializer-jump columns-no">
 <li><a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsodeve.net%2F2012%2F02%2Fhow-to-change-your-wordpresss-navigational-style-using-jquery%2F&amp;t=How+To+Change+Your+WordPress%26%238217%3Bs+Prev%2FNext+Link+Style+Using+jQuery" title="Share this on Facebook" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Facebook" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -330px; border:0;"/></a></li> 

 <li><a href="http://twitter.com/home?status=How+To+Change+Your+WordPress%26%238217%3Bs+Prev%2FNext+Link+Style+Using+jQuery%20-%20http%3A%2F%2Fsodeve.net%3Fp%3D2434%20@sodeve" title="Tweet this !" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Twitter" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -1386px; border:0;"/></a></li> 

 <li><a href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsodeve.net%2F2012%2F02%2Fhow-to-change-your-wordpresss-navigational-style-using-jquery%2F&amp;title=How+To+Change+Your+WordPress%26%238217%3Bs+Prev%2FNext+Link+Style+Using+jQuery&amp;annotation=Apparently%2C+the+word+%27satisfaction%27+is+not+in+my+dictionary+when+related+to+design+of+this+blog.+Just+last+week%2C+after+sailing+in+the+sea+of+Google+search+result%2C+I+was+stranded+at+Guillermo+Rauch%27s+beautiful+blog+--Devthought+reading+his+post+about+" title="Bookmark this on Google" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Google" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -462px; border:0;"/></a></li> 

 <li><a href="http://delicious.com/post?url=http%3A%2F%2Fsodeve.net%2F2012%2F02%2Fhow-to-change-your-wordpresss-navigational-style-using-jquery%2F&amp;title=How+To+Change+Your+WordPress%26%238217%3Bs+Prev%2FNext+Link+Style+Using+jQuery&amp;notes=Apparently%2C+the+word+%27satisfaction%27+is+not+in+my+dictionary+when+related+to+design+of+this+blog.+Just+last+week%2C+after+sailing+in+the+sea+of+Google+search+result%2C+I+was+stranded+at+Guillermo+Rauch%27s+beautiful+blog+--Devthought+reading+his+post+about+" title="Post this on Delicious" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Delicious" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -132px; border:0;"/></a></li> 

 <li><a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsodeve.net%2F2012%2F02%2Fhow-to-change-your-wordpresss-navigational-style-using-jquery%2F&amp;title=How+To+Change+Your+WordPress%26%238217%3Bs+Prev%2FNext+Link+Style+Using+jQuery&amp;bodytext=Apparently%2C+the+word+%27satisfaction%27+is+not+in+my+dictionary+when+related+to+design+of+this+blog.+Just+last+week%2C+after+sailing+in+the+sea+of+Google+search+result%2C+I+was+stranded+at+Guillermo+Rauch%27s+beautiful+blog+--Devthought+reading+his+post+about+" title="Submit this to Digg" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Digg" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -231px; border:0;"/></a></li> 

 <li><a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsodeve.net%2F2012%2F02%2Fhow-to-change-your-wordpresss-navigational-style-using-jquery%2F&amp;title=How+To+Change+Your+WordPress%26%238217%3Bs+Prev%2FNext+Link+Style+Using+jQuery" title="Submit this to StumbleUpon" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="StumbleUpon" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -1287px; border:0;"/></a></li> 

 <li><a href="http://sodeve.net/2012/02/how-to-change-your-wordpresss-navigational-style-using-jquery/" onclick="addBookmark(event);" title="How To Change Your WordPress&#8217;s Prev/Next Link Style Using jQuery" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Add to favorites" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -0px; border:0;"/></a></li> 

 <li><a href="mailto:subject=How To Change Your WordPress&#8217;s Prev/Next Link Style Using jQuery&amp;body=Apparently, the word 'satisfaction' is not in my dictionary when related to design of this blog. Just last week, after sailing in the sea of Google search result, I was stranded at Guillermo Rauch's beautiful blog --Devthought reading his post about  - http://sodeve.net/2012/02/how-to-change-your-wordpresss-navigational-style-using-jquery/" title="Email this" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Email" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -297px; border:0;"/></a></li> 

 <li><a href="http://sodeve.net/feed/rss/" title="Subscribe to RSS" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="RSS" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -1221px; border:0;"/></a></li> 
</ul> 
<div class="wp-socializer-clearer"></div></div>
<!-- End WP Socializer - Social Buttons - Output -->
<p>Related posts:</p><ol>
<li><a href='http://sodeve.net/2009/09/how-to-use-jquery-in-your-wordpress-post/' rel='bookmark' title='How to use jQuery in Your WordPress Post'>How to use jQuery in Your WordPress Post</a></li>
<li><a href='http://sodeve.net/2009/09/how-to-prevent-wordpress-loads-jquery-twice/' rel='bookmark' title='How to Prevent WordPress Loads jQuery Twice'>How to Prevent WordPress Loads jQuery Twice</a></li>
<li><a href='http://sodeve.net/2009/09/using-jquery-to-enhance-google-syntax-highligher-wordpress-plugin/' rel='bookmark' title='Using jQuery to Enhance Google Syntax Highligher WordPress Plugin'>Using jQuery to Enhance Google Syntax Highligher WordPress Plugin</a></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://sodeve.net/2012/02/how-to-change-your-wordpresss-navigational-style-using-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Goodbye Dynamic Widgets, Welcome Widget Logic</title>
		<link>http://sodeve.net/2012/01/goodbye-dynamic-widgets-welcome-widget-logic/</link>
		<comments>http://sodeve.net/2012/01/goodbye-dynamic-widgets-welcome-widget-logic/#comments</comments>
		<pubDate>Sat, 28 Jan 2012 05:42:34 +0000</pubDate>
		<dc:creator>Hardono</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[blogging]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://sodeve.net/?p=2390</guid>
		<description><![CDATA[About two or three months ago, I started using Dynamic Widgets to regulate how the *ehm* Google&#8217;s Ads is showing in the sidebar. This is due to Google&#8217;s policy on how many number of ads can be displayed in a page. I was happy Dynamic Widgets user interface is really easy. You just need to [...]
Related posts:<ol>
<li><a href='http://sodeve.net/2011/11/how-to-show-authorship-in-google-search-result-for-wordpress-blog/' rel='bookmark' title='How To Show Authorship In Google Search Result For WordPress Blog'>How To Show Authorship In Google Search Result For WordPress Blog</a></li>
<li><a href='http://sodeve.net/2007/03/ms-sql-stored-procedure-for-absolute-beginner-part-1/' rel='bookmark' title='MS-SQL Stored Procedure for Absolute Beginner, Part 1'>MS-SQL Stored Procedure for Absolute Beginner, Part 1</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>About two or three months ago, I started using <a href="http://www.qurl.nl/dynamic-widgets/" title="Dynamic Widgets" target="_blank">Dynamic Widgets</a> to regulate how the <strong>*ehm*</strong> Google&#8217;s Ads is showing in the sidebar. This is due to Google&#8217;s policy on how many number of ads can be displayed in a page.</p>
<p>I was happy <img src='http://sodeve.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Dynamic Widgets user interface is really easy. You just need to declare your sidebar widgets as a dynamic instead of static. Then continued by define the rules that regulate when that particular widget is shown or hidden by clicking list of check-boxes describing the conditional logic.</p>
<p>Sadly, today I found out that the Dynamic Widget is broken. It didn&#8217;t recognize that the current page is a Tags archive page. The result is obvious, it disregard any logical conditions that I previously set and messed up my sidebar.</p>
<p>It is very likely that my recent upgrade to WordPress 3.3.1 is the primary cause. Since I don&#8217;t want to revert to previous WordPress version, I look out for replacement. Then I found out <a href="http://wordpress.org/extend/plugins/widget-logic/" title="Widget Logic" target="_blank">Widget Logic</a>. If you are familiar with Boolean logic, Widget Logic is super effective. Instead of clicking check-boxes for configuration, you write your own logical condition. Widget Logic only evaluate those widgets that have something in their &#8216;Widget logic&#8217; field. If their &#8216;Widget logic&#8217; field is empty, the widget is simply treated as static widget.</p>
<p><img src="http://sodeve.net/wp-content/uploads/2012/01/widget.logic_.interface.png" alt="" title="widget.logic.interface" width="438" height="405" class="aligncenter size-full wp-image-2391" /></p>
<p>As you can see, the logical condition is composed using WordPress&#8217;s functions. Here are the list of WP&#8217;s commonly-used functions that could help you:</p>
<ul>
<li><span class="method">is_front_page()</span></li>
<li><span class="method">is_page()</span></li>
<li><span class="method">is_single()</span></li>
<li><span class="method">is_tag()</span></li>
<li><span class="method">is_category()</span></li>
<li><span class="method">is_archive()</span></li>
</ul>
<p>For complete list of functions, you could refer to WordPress <a href="http://codex.wordpress.org/Function_Reference#Miscellaneous_Functions" title="Conditional Tags Index" target="_blank">documentation</a>.</p>
<p>And if you&#8217;re not familiar with Boolean logic, you could learn how to do it <a href="http://www.php.net/manual/en/language.operators.logical.php" title="PHP Logical Operators" target="_blank">HERE</a>.</p>
<h3>Quick Example</h3>
<blockquote><p><span class="method">!is_tag() &#038;&#038; !is_page() &#038;&#038; !is_single() &#038;&#038; !is_category()</span><br/>This widget will be shown if the current page:</p>
<ol>
<li>is not a Tags page, and</li>
<li>is not a Page (not a Post), and</li>
<li>is not a Single post, and</li>
<li>is not a Category page</li>
</ol>
</blockquote>
<p>I hope it helps, cheers!</p>
<h2>Share and Enjoy</h2>

<!-- Start WP Socializer - Social Buttons - Output -->
<div class="wp-socializer 32px">
<ul class="wp-socializer-jump columns-no">
 <li><a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsodeve.net%2F2012%2F01%2Fgoodbye-dynamic-widgets-welcome-widget-logic%2F&amp;t=Goodbye+Dynamic+Widgets%2C+Welcome+Widget+Logic" title="Share this on Facebook" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Facebook" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -330px; border:0;"/></a></li> 

 <li><a href="http://twitter.com/home?status=Goodbye+Dynamic+Widgets%2C+Welcome+Widget+Logic%20-%20http%3A%2F%2Fsodeve.net%3Fp%3D2390%20@sodeve" title="Tweet this !" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Twitter" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -1386px; border:0;"/></a></li> 

 <li><a href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsodeve.net%2F2012%2F01%2Fgoodbye-dynamic-widgets-welcome-widget-logic%2F&amp;title=Goodbye+Dynamic+Widgets%2C+Welcome+Widget+Logic&amp;annotation=About+two+or+three+months+ago%2C+I+started+using+Dynamic+Widgets+to+regulate+how+the+%2Aehm%2A+Google%27s+Ads+is+showing+in+the+sidebar.+This+is+due+to+Google%27s+policy+on+how+many+number+of+ads+can+be+displayed+in+a+page.%0D%0A%0D%0AI+was+happy+%3A%29+Dynamic+Widgets+us" title="Bookmark this on Google" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Google" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -462px; border:0;"/></a></li> 

 <li><a href="http://delicious.com/post?url=http%3A%2F%2Fsodeve.net%2F2012%2F01%2Fgoodbye-dynamic-widgets-welcome-widget-logic%2F&amp;title=Goodbye+Dynamic+Widgets%2C+Welcome+Widget+Logic&amp;notes=About+two+or+three+months+ago%2C+I+started+using+Dynamic+Widgets+to+regulate+how+the+%2Aehm%2A+Google%27s+Ads+is+showing+in+the+sidebar.+This+is+due+to+Google%27s+policy+on+how+many+number+of+ads+can+be+displayed+in+a+page.%0D%0A%0D%0AI+was+happy+%3A%29+Dynamic+Widgets+us" title="Post this on Delicious" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Delicious" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -132px; border:0;"/></a></li> 

 <li><a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsodeve.net%2F2012%2F01%2Fgoodbye-dynamic-widgets-welcome-widget-logic%2F&amp;title=Goodbye+Dynamic+Widgets%2C+Welcome+Widget+Logic&amp;bodytext=About+two+or+three+months+ago%2C+I+started+using+Dynamic+Widgets+to+regulate+how+the+%2Aehm%2A+Google%27s+Ads+is+showing+in+the+sidebar.+This+is+due+to+Google%27s+policy+on+how+many+number+of+ads+can+be+displayed+in+a+page.%0D%0A%0D%0AI+was+happy+%3A%29+Dynamic+Widgets+us" title="Submit this to Digg" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Digg" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -231px; border:0;"/></a></li> 

 <li><a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsodeve.net%2F2012%2F01%2Fgoodbye-dynamic-widgets-welcome-widget-logic%2F&amp;title=Goodbye+Dynamic+Widgets%2C+Welcome+Widget+Logic" title="Submit this to StumbleUpon" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="StumbleUpon" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -1287px; border:0;"/></a></li> 

 <li><a href="http://sodeve.net/2012/01/goodbye-dynamic-widgets-welcome-widget-logic/" onclick="addBookmark(event);" title="Goodbye Dynamic Widgets, Welcome Widget Logic" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Add to favorites" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -0px; border:0;"/></a></li> 

 <li><a href="mailto:subject=Goodbye Dynamic Widgets, Welcome Widget Logic&amp;body=About two or three months ago, I started using Dynamic Widgets to regulate how the *ehm* Google's Ads is showing in the sidebar. This is due to Google's policy on how many number of ads can be displayed in a page.

I was happy :) Dynamic Widgets us - http://sodeve.net/2012/01/goodbye-dynamic-widgets-welcome-widget-logic/" title="Email this" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Email" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -297px; border:0;"/></a></li> 

 <li><a href="http://sodeve.net/feed/rss/" title="Subscribe to RSS" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="RSS" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -1221px; border:0;"/></a></li> 
</ul> 
<div class="wp-socializer-clearer"></div></div>
<!-- End WP Socializer - Social Buttons - Output -->
<p>Related posts:</p><ol>
<li><a href='http://sodeve.net/2011/11/how-to-show-authorship-in-google-search-result-for-wordpress-blog/' rel='bookmark' title='How To Show Authorship In Google Search Result For WordPress Blog'>How To Show Authorship In Google Search Result For WordPress Blog</a></li>
<li><a href='http://sodeve.net/2007/03/ms-sql-stored-procedure-for-absolute-beginner-part-1/' rel='bookmark' title='MS-SQL Stored Procedure for Absolute Beginner, Part 1'>MS-SQL Stored Procedure for Absolute Beginner, Part 1</a></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://sodeve.net/2012/01/goodbye-dynamic-widgets-welcome-widget-logic/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Quickly Convert Ancient JSP Page into ASP.NET MVC + Ext.NET</title>
		<link>http://sodeve.net/2011/12/quickly-convert-ancient-jsp-page-into-asp-net-mvc-ext-net/</link>
		<comments>http://sodeve.net/2011/12/quickly-convert-ancient-jsp-page-into-asp-net-mvc-ext-net/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 15:30:38 +0000</pubDate>
		<dc:creator>Hardono</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[ext.net]]></category>
		<category><![CDATA[mvc]]></category>

		<guid isPermaLink="false">http://sodeve.net/?p=2031</guid>
		<description><![CDATA[Last week, I was required to quickly do maintenance to an ancient JSP page. The page basically is a spaghetti code that retrieve shipment data from Oracle, transform it into HTML output. The page itself is residing in an old Allaire JRun server. So yeah, it&#8217;s really that ancient Due to the time constraint and [...]
Related posts:<ol>
<li><a href='http://sodeve.net/2007/08/printing-the-content-of-gridview/' rel='bookmark' title='Printing The Content of GridView'>Printing The Content of GridView</a></li>
<li><a href='http://sodeve.net/2007/12/enableeventvalidation-error/' rel='bookmark' title='EnableEventValidation Error'>EnableEventValidation Error</a></li>
<li><a href='http://sodeve.net/2008/12/how_to_quickly_format_excel_document_for_your_database_query_result/' rel='bookmark' title='How To Quickly Format Excel Document for Your Database Query Result'>How To Quickly Format Excel Document for Your Database Query Result</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Last week, I was required to quickly do maintenance to an ancient JSP page. The page basically is a spaghetti code that retrieve shipment data from Oracle, transform it into HTML output. The page itself is residing in an old Allaire JRun server. So yeah, it&#8217;s really that ancient <img src='http://sodeve.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Due to the time constraint and my lack of familiarity with the overall Java EE environment, I decided to move it into my comfort zone <img src='http://sodeve.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>To create the overall layout, we can always derive from <a href="http://code.google.com/p/extnet-mvc/" title="Ext.NET MVC" target="_blank">Ext.NET MVC project</a>. So I made a few changes and I have something like this:</p>
<p><img src="http://sodeve.net/wp-content/uploads/2011/12/nutms.ext_.net_.png" alt="" title="Ext.Net MVC " width="595" height="377" class="aligncenter size-full wp-image-2033" /></p>
<p>When the user clicked the Search button, we need to submit to backend processing and show the output in the Result panel.</p>
<pre name="code" class="html">
&lt;ext:Button Width=&quot;100&quot; Height=&quot;20&quot; runat=&quot;server&quot; ID=&quot;btnSearch&quot; Text=&quot;Search&quot;&gt;
	&lt;Listeners&gt;
		&lt;Click Fn=&quot;fnSearch&quot; /&gt;
	&lt;/Listeners&gt;
&lt;/ext:Button&gt;
</pre>
<p>The click event handler is in JavaScript:</p>
<pre name="code" class="javascript">
var fnSearch = function(sender, ev) {
   pnlResult.load({
	url:'/Job/Search',
	params:{shipref: txtShipRef.getValue()},
	callback:function(el){
		el.applyStyles("overflow:scroll");
	},
	text:'loading...',
	timeout:30
   });
}
</pre>
<p>Meanwhile at the backend, JobController.cs will have the following the action handler:</p>
<pre name="code" class="csharp">
public ContentResult Search(String shipref)
{
	var res = new ContentResult();
	res.ContentType = "text/html";
	var sb = new StringBuilder();
	try
	{
	    //Convert the Java code in JSP page into C# code
	    //Highly recommended to use sb.Append()
	    //instead of + operator for String concatenating
	    res.Content = sb.ToString();
	}
	catch (Exception ex) {
		res.Content = ex.ToString();
	}
	return res;
}
</pre>
<p>There you go, at least now we can move this application to a newer and better server. Which should translates as a better experience to the user <img src='http://sodeve.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>I hope it helps. Cheers!</p>
<h2>Share and Enjoy</h2>

<!-- Start WP Socializer - Social Buttons - Output -->
<div class="wp-socializer 32px">
<ul class="wp-socializer-jump columns-no">
 <li><a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsodeve.net%2F2011%2F12%2Fquickly-convert-ancient-jsp-page-into-asp-net-mvc-ext-net%2F&amp;t=Quickly+Convert+Ancient+JSP+Page+into+ASP.NET+MVC+%2520+Ext.NET" title="Share this on Facebook" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Facebook" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -330px; border:0;"/></a></li> 

 <li><a href="http://twitter.com/home?status=Quickly+Convert+Ancient+JSP+Page+into+ASP.NET+MVC+%2520+Ext.NET%20-%20http%3A%2F%2Fsodeve.net%3Fp%3D2031%20@sodeve" title="Tweet this !" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Twitter" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -1386px; border:0;"/></a></li> 

 <li><a href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsodeve.net%2F2011%2F12%2Fquickly-convert-ancient-jsp-page-into-asp-net-mvc-ext-net%2F&amp;title=Quickly+Convert+Ancient+JSP+Page+into+ASP.NET+MVC+%2520+Ext.NET&amp;annotation=Last+week%2C+I+was+required+to+quickly+do+maintenance+to+an+ancient+JSP+page.+The+page+basically+is+a+spaghetti+code+that+retrieve+shipment+data+from+Oracle%2C+transform+it+into+HTML+output.+The+page+itself+is+residing+in+an+old+Allaire+JRun+server.+So+y" title="Bookmark this on Google" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Google" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -462px; border:0;"/></a></li> 

 <li><a href="http://delicious.com/post?url=http%3A%2F%2Fsodeve.net%2F2011%2F12%2Fquickly-convert-ancient-jsp-page-into-asp-net-mvc-ext-net%2F&amp;title=Quickly+Convert+Ancient+JSP+Page+into+ASP.NET+MVC+%2520+Ext.NET&amp;notes=Last+week%2C+I+was+required+to+quickly+do+maintenance+to+an+ancient+JSP+page.+The+page+basically+is+a+spaghetti+code+that+retrieve+shipment+data+from+Oracle%2C+transform+it+into+HTML+output.+The+page+itself+is+residing+in+an+old+Allaire+JRun+server.+So+y" title="Post this on Delicious" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Delicious" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -132px; border:0;"/></a></li> 

 <li><a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsodeve.net%2F2011%2F12%2Fquickly-convert-ancient-jsp-page-into-asp-net-mvc-ext-net%2F&amp;title=Quickly+Convert+Ancient+JSP+Page+into+ASP.NET+MVC+%2520+Ext.NET&amp;bodytext=Last+week%2C+I+was+required+to+quickly+do+maintenance+to+an+ancient+JSP+page.+The+page+basically+is+a+spaghetti+code+that+retrieve+shipment+data+from+Oracle%2C+transform+it+into+HTML+output.+The+page+itself+is+residing+in+an+old+Allaire+JRun+server.+So+y" title="Submit this to Digg" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Digg" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -231px; border:0;"/></a></li> 

 <li><a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsodeve.net%2F2011%2F12%2Fquickly-convert-ancient-jsp-page-into-asp-net-mvc-ext-net%2F&amp;title=Quickly+Convert+Ancient+JSP+Page+into+ASP.NET+MVC+%2520+Ext.NET" title="Submit this to StumbleUpon" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="StumbleUpon" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -1287px; border:0;"/></a></li> 

 <li><a href="http://sodeve.net/2011/12/quickly-convert-ancient-jsp-page-into-asp-net-mvc-ext-net/" onclick="addBookmark(event);" title="Quickly Convert Ancient JSP Page into ASP.NET MVC %20 Ext.NET" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Add to favorites" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -0px; border:0;"/></a></li> 

 <li><a href="mailto:subject=Quickly Convert Ancient JSP Page into ASP.NET MVC %20 Ext.NET&amp;body=Last week, I was required to quickly do maintenance to an ancient JSP page. The page basically is a spaghetti code that retrieve shipment data from Oracle, transform it into HTML output. The page itself is residing in an old Allaire JRun server. So y - http://sodeve.net/2011/12/quickly-convert-ancient-jsp-page-into-asp-net-mvc-ext-net/" title="Email this" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Email" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -297px; border:0;"/></a></li> 

 <li><a href="http://sodeve.net/feed/rss/" title="Subscribe to RSS" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="RSS" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -1221px; border:0;"/></a></li> 
</ul> 
<div class="wp-socializer-clearer"></div></div>
<!-- End WP Socializer - Social Buttons - Output -->
<p>Related posts:</p><ol>
<li><a href='http://sodeve.net/2007/08/printing-the-content-of-gridview/' rel='bookmark' title='Printing The Content of GridView'>Printing The Content of GridView</a></li>
<li><a href='http://sodeve.net/2007/12/enableeventvalidation-error/' rel='bookmark' title='EnableEventValidation Error'>EnableEventValidation Error</a></li>
<li><a href='http://sodeve.net/2008/12/how_to_quickly_format_excel_document_for_your_database_query_result/' rel='bookmark' title='How To Quickly Format Excel Document for Your Database Query Result'>How To Quickly Format Excel Document for Your Database Query Result</a></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://sodeve.net/2011/12/quickly-convert-ancient-jsp-page-into-asp-net-mvc-ext-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inline JavaScript Code That Broke My Feed</title>
		<link>http://sodeve.net/2011/12/inline-javascript-code-that-broke-my-feed/</link>
		<comments>http://sodeve.net/2011/12/inline-javascript-code-that-broke-my-feed/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 13:49:51 +0000</pubDate>
		<dc:creator>Hardono</dc:creator>
				<category><![CDATA[Laughs]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[gallery]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://sodeve.net/?p=2010</guid>
		<description><![CDATA[In my previous post, I needed to embed Flash object. To do that, the post needs to have two inline JavaScript code blocks embedded inside. This two code blocks apparently killed my RSS Feed! I didn&#8217;t know about this, until I visited my LinkedIn page. LinkedIn page was prompting me to enter my WordPress blog [...]
Related posts:<ol>
<li><a href='http://sodeve.net/2009/09/how-to-use-javascript-in-your-wordpress-blog-post/' rel='bookmark' title='How to Use Javascript in Your WordPress Blog Post'>How to Use Javascript in Your WordPress Blog Post</a></li>
<li><a href='http://sodeve.net/2008/07/singapore-nric-generator/' rel='bookmark' title='Singapore NRIC Generator'>Singapore NRIC Generator</a></li>
<li><a href='http://sodeve.net/2007/03/how-to-check-that-javascript-is-enabled-from-server/' rel='bookmark' title='How to Check Whether JavaScript is Enabled From Server'>How to Check Whether JavaScript is Enabled From Server</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>In my previous <a href="http://sodeve.net/2011/11/download-data-terbaru-sertifikasi-guru-2012/" title="Download Data Terbaru Sertifikasi Guru 2012">post</a>, I needed to embed Flash object. To do that, the post needs to have two inline JavaScript code blocks embedded inside.</p>
<p>This two code blocks apparently killed my RSS Feed! I didn&#8217;t know about this, until I visited my LinkedIn page. LinkedIn page was prompting me to enter my WordPress blog URL address. Hmm.. that&#8217;s weird. I remember I have done that immediately when I created my LinkedIn account. I squinted my eyes to find any error messages. Below the WordPress form, I saw broken red lines with varying degree of thickness. Apparently the error message was outside the DIV&#8217;s visible area. The error message reads &#8220;Error in parsing http://sodeve.net?feed=rss2&#8243;.</p>
<p>Here&#8217;s the offending inline codes:</p>
<pre name="code" class="html">
&lt;script type=&quot;text/javascript&quot;&gt;
		var swfVersionStr = &quot;10.2.0&quot;; var xiSwfUrlStr = &quot;/swf/playerProductInstall.swf&quot;;
		var flashvars = {}; var params = {};
		params.quality = &quot;high&quot;; params.bgcolor = &quot;#3a3737&quot;;
		params.allowscriptaccess = &quot;always&quot;; params.allowfullscreen = &quot;true&quot;;
		var attributes = {}; attributes.id = &quot;SertifikasiDownloader&quot;;
		attributes.name = &quot;SertifikasiDownloader&quot;; attributes.align = &quot;left&quot;;
		swfobject.embedSWF(&quot;/swf/Downloader.swf&quot;, &quot;flashSertifikasiDownloader&quot;, &quot;493&quot;, &quot;332&quot;, swfVersionStr, xiSwfUrlStr, flashvars, params, attributes);
		swfobject.createCSS(&quot;#flashSertifikasiDownloader&quot;, &quot;display:block;text-align:left;&quot;);
&lt;/script&gt;
</pre>
<p>And</p>
<pre name="code" class="html">
&lt;script type=&quot;text/javascript&quot;&gt;
		var pageHost = ((document.location.protocol == &quot;https:&quot;) ? &quot;https://&quot; : &quot;http://&quot;);
		document.write(&quot;&lt;a href='http://www.adobe.com/go/getflashplayer'&gt;&lt;img src='&quot;
			+ pageHost + &quot;www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /&gt;&lt;/a&gt;&quot; );
&lt;/script&gt;
</pre>
<p>Btw, please note that I made the JavaScript codes in multiple lines to make it readable. In its original form, each code block will be merged into a single line.</p>
<p>When I opened up this blog&#8217;s RSS Feed URL using Google Chrome, it spitted back red rectangle error message back at me. I opened the same URL with Safari, and it simply give up without even telling what&#8217;s the source of the error. Still not satisfied, I launched both IE9 and Firefox to the same URL.</p>
<p>Surprise surprise, these two browsers didn&#8217;t report any error. IE9 incompletely renderred the XML as a full-page of words without any arrangement. But it actually stopped rendering the content half-way. Perhaps it saw the error, got depressed, then perhaps go hiding somewhere trying to get high. Great, IE9, your act is just like <a href="http://en.wikipedia.org/wiki/Towelie" title="Towelie" target="_blank">Towelie</a>.</p>
<p>If IE9 is like Towelie, I think Firefox is like Eddie Mora from <a href="http://www.imdb.com/title/tt1219289/" title="Limitless" target="_blank">Limitless</a>. Although there&#8217;s error in the feed, it is still showing everything perfectly. And by perfectly, I mean everything. The FeedBurner&#8217;s favicon, the layout, the form to subscribe to the feed. </p>
<p>Last but not least, Opera. I think Opera is the most informative among all. It prompted the error, described what kind of error is it, which location the error was triggered from, and it even shown the part of the XML code where the error is originated.</p>
<p>Based on this razor-sharp information from Opera, I look into the XML file. I found out that the second JavaScript code block was auto-encapsulated inside CDATA section. But why only the second code block was auto-encapsulated? What makes the first code block so special (or not so special, depending on your today&#8217;s mood) that it wasn&#8217;t auto-encapsulated?</p>
<p>Anyway, I solved this issue by taking out both code blocks, and put them into two separate external .js file. Yes, this is actually the recommended practice should you ever need to include JavaScript code in your WordPress blog post. Why didn&#8217;t I do it in the first place? In my defense, the inline JavaScript code did work. As long as you make them in one single line.</p>
<p>What I did&#8217;t realize was that I accidentally depended on a &#8216;hack&#8217;, deprecated-method, or whatever it is that now WordPress (or W3 Total Cache) doesn&#8217;t support. I am not sure whether I should call this a bug. What do you think?</p>
<p>Moral of the story, use the recommended best practice when doing something, but don&#8217;t stop yourself from hacking <img src='http://sodeve.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Show me your hand if your&#8217;re agree!</p>
<p>Cheers!</p>
<p>The screenshots from the browsers:<br />

<div class="ngg-galleryoverview" id="ngg-gallery-5-2010">


	
	<!-- Thumbnails -->
		
	<div id="ngg-image-36" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://sodeve.net/wp-content/gallery/browser-feed-error/chrome-feed_-error_.png" title=" " class="shutterset_set_5" >
								<img title="chrome-feed_-error_" alt="chrome-feed_-error_" src="http://sodeve.net/wp-content/gallery/browser-feed-error/thumbs/thumbs_chrome-feed_-error_.png" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-37" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://sodeve.net/wp-content/gallery/browser-feed-error/chrome-feed_-fixed_.png" title=" " class="shutterset_set_5" >
								<img title="chrome-feed_-fixed_" alt="chrome-feed_-fixed_" src="http://sodeve.net/wp-content/gallery/browser-feed-error/thumbs/thumbs_chrome-feed_-fixed_.png" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-38" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://sodeve.net/wp-content/gallery/browser-feed-error/firefox-feed_.png" title=" " class="shutterset_set_5" >
								<img title="firefox-feed_" alt="firefox-feed_" src="http://sodeve.net/wp-content/gallery/browser-feed-error/thumbs/thumbs_firefox-feed_.png" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-39" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://sodeve.net/wp-content/gallery/browser-feed-error/ie9-feed_.png" title=" " class="shutterset_set_5" >
								<img title="ie9-feed_" alt="ie9-feed_" src="http://sodeve.net/wp-content/gallery/browser-feed-error/thumbs/thumbs_ie9-feed_.png" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-40" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://sodeve.net/wp-content/gallery/browser-feed-error/opera-fee_-fixed_.png" title=" " class="shutterset_set_5" >
								<img title="opera-fee_-fixed_" alt="opera-fee_-fixed_" src="http://sodeve.net/wp-content/gallery/browser-feed-error/thumbs/thumbs_opera-fee_-fixed_.png" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-41" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://sodeve.net/wp-content/gallery/browser-feed-error/opera-feed_-error_.png" title=" " class="shutterset_set_5" >
								<img title="opera-feed_-error_" alt="opera-feed_-error_" src="http://sodeve.net/wp-content/gallery/browser-feed-error/thumbs/thumbs_opera-feed_-error_.png" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-42" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://sodeve.net/wp-content/gallery/browser-feed-error/safari-feed_-error_.png" title=" " class="shutterset_set_5" >
								<img title="safari-feed_-error_" alt="safari-feed_-error_" src="http://sodeve.net/wp-content/gallery/browser-feed-error/thumbs/thumbs_safari-feed_-error_.png" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-43" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://sodeve.net/wp-content/gallery/browser-feed-error/safari-feed_-fixed_.png" title=" " class="shutterset_set_5" >
								<img title="safari-feed_-fixed_" alt="safari-feed_-fixed_" src="http://sodeve.net/wp-content/gallery/browser-feed-error/thumbs/thumbs_safari-feed_-fixed_.png" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 	 	
	<!-- Pagination -->
 	<div class='ngg-clear'></div>
 	
</div>

</p>
<h2>Share and Enjoy</h2>

<!-- Start WP Socializer - Social Buttons - Output -->
<div class="wp-socializer 32px">
<ul class="wp-socializer-jump columns-no">
 <li><a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsodeve.net%2F2011%2F12%2Finline-javascript-code-that-broke-my-feed%2F&amp;t=Inline+JavaScript+Code+That+Broke+My+Feed" title="Share this on Facebook" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Facebook" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -330px; border:0;"/></a></li> 

 <li><a href="http://twitter.com/home?status=Inline+JavaScript+Code+That+Broke+My+Feed%20-%20http%3A%2F%2Fsodeve.net%3Fp%3D2010%20@sodeve" title="Tweet this !" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Twitter" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -1386px; border:0;"/></a></li> 

 <li><a href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsodeve.net%2F2011%2F12%2Finline-javascript-code-that-broke-my-feed%2F&amp;title=Inline+JavaScript+Code+That+Broke+My+Feed&amp;annotation=In+my+previous+post%2C+I+needed+to+embed+Flash+object.+To+do+that%2C+the+post+needs+to+have+two+inline+JavaScript+code+blocks+embedded+inside.%0D%0A%0D%0AThis+two+code+blocks+apparently+killed+my+RSS+Feed%21+I+didn%27t+know+about+this%2C+until+I+visited+my+LinkedIn+pa" title="Bookmark this on Google" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Google" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -462px; border:0;"/></a></li> 

 <li><a href="http://delicious.com/post?url=http%3A%2F%2Fsodeve.net%2F2011%2F12%2Finline-javascript-code-that-broke-my-feed%2F&amp;title=Inline+JavaScript+Code+That+Broke+My+Feed&amp;notes=In+my+previous+post%2C+I+needed+to+embed+Flash+object.+To+do+that%2C+the+post+needs+to+have+two+inline+JavaScript+code+blocks+embedded+inside.%0D%0A%0D%0AThis+two+code+blocks+apparently+killed+my+RSS+Feed%21+I+didn%27t+know+about+this%2C+until+I+visited+my+LinkedIn+pa" title="Post this on Delicious" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Delicious" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -132px; border:0;"/></a></li> 

 <li><a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsodeve.net%2F2011%2F12%2Finline-javascript-code-that-broke-my-feed%2F&amp;title=Inline+JavaScript+Code+That+Broke+My+Feed&amp;bodytext=In+my+previous+post%2C+I+needed+to+embed+Flash+object.+To+do+that%2C+the+post+needs+to+have+two+inline+JavaScript+code+blocks+embedded+inside.%0D%0A%0D%0AThis+two+code+blocks+apparently+killed+my+RSS+Feed%21+I+didn%27t+know+about+this%2C+until+I+visited+my+LinkedIn+pa" title="Submit this to Digg" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Digg" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -231px; border:0;"/></a></li> 

 <li><a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsodeve.net%2F2011%2F12%2Finline-javascript-code-that-broke-my-feed%2F&amp;title=Inline+JavaScript+Code+That+Broke+My+Feed" title="Submit this to StumbleUpon" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="StumbleUpon" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -1287px; border:0;"/></a></li> 

 <li><a href="http://sodeve.net/2011/12/inline-javascript-code-that-broke-my-feed/" onclick="addBookmark(event);" title="Inline JavaScript Code That Broke My Feed" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Add to favorites" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -0px; border:0;"/></a></li> 

 <li><a href="mailto:subject=Inline JavaScript Code That Broke My Feed&amp;body=In my previous post, I needed to embed Flash object. To do that, the post needs to have two inline JavaScript code blocks embedded inside.

This two code blocks apparently killed my RSS Feed! I didn't know about this, until I visited my LinkedIn pa - http://sodeve.net/2011/12/inline-javascript-code-that-broke-my-feed/" title="Email this" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Email" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -297px; border:0;"/></a></li> 

 <li><a href="http://sodeve.net/feed/rss/" title="Subscribe to RSS" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="RSS" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -1221px; border:0;"/></a></li> 
</ul> 
<div class="wp-socializer-clearer"></div></div>
<!-- End WP Socializer - Social Buttons - Output -->
<p>Related posts:</p><ol>
<li><a href='http://sodeve.net/2009/09/how-to-use-javascript-in-your-wordpress-blog-post/' rel='bookmark' title='How to Use Javascript in Your WordPress Blog Post'>How to Use Javascript in Your WordPress Blog Post</a></li>
<li><a href='http://sodeve.net/2008/07/singapore-nric-generator/' rel='bookmark' title='Singapore NRIC Generator'>Singapore NRIC Generator</a></li>
<li><a href='http://sodeve.net/2007/03/how-to-check-that-javascript-is-enabled-from-server/' rel='bookmark' title='How to Check Whether JavaScript is Enabled From Server'>How to Check Whether JavaScript is Enabled From Server</a></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://sodeve.net/2011/12/inline-javascript-code-that-broke-my-feed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Force ASP.NET MVC To Serve Index.PHP</title>
		<link>http://sodeve.net/2011/12/how-to-force-asp-net-mvc-to-serve-index-php/</link>
		<comments>http://sodeve.net/2011/12/how-to-force-asp-net-mvc-to-serve-index-php/#comments</comments>
		<pubDate>Mon, 12 Dec 2011 12:05:49 +0000</pubDate>
		<dc:creator>Hardono</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[mvc]]></category>

		<guid isPermaLink="false">http://sodeve.net/?p=1997</guid>
		<description><![CDATA[What a weird title for a solution that I don&#8217;t think many people would need But apparently I needed it. So after scratching my head for non-dandruff-related cause, I found out how to do it. Just a short background story. We have ASP.NET MVC application already deployed in the production server. Unfortunately, the launch date [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>What a weird title for a solution that I don&#8217;t think many people would need <img src='http://sodeve.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  But apparently I needed it. So after scratching my head for non-dandruff-related cause, I found out how to do it.</p>
<p>Just a short background story. We have ASP.NET MVC application already deployed in the production server. Unfortunately, the launch date of the application is still days ahead. So instead of showing the application, a countdown page is more appropriate.</p>
<p>So somebody come up with the countdown page. Sadly, it was in PHP. It was a quite challenge to make IIS serve the index.php. I tried set the IIS&#8217; default document priority, but it didn&#8217;t work. </p>
<p>Then I realized that Global.asax is overriding IIS behavior. Since the index.php needs a few .js files, .css and few .png images, I amended the Global.asax.cs into something like this:</p>
<pre name="code" class="csharp">
protected void Application_AuthenticateRequest(object sender, System.EventArgs e)
{
	string url = HttpContext.Current.Request.RawUrl.ToLower();
	if (!(url.EndsWith("index.php")
		|| url.EndsWith(".js")
		|| url.EndsWith(".css")
		|| url.EndsWith(".png")))
	{
		Response.Redirect("http://www.project.com/index.php", true);
	}
	//.....
	//Your exisiting code
	//....
}
</pre>
<p>To deploy this solution, first I recompile the project. Then I backup my original dll by renaming it into .bak file. Lastly, I copied the newly compiled dll into the Server&#8217;s bin folder.</p>
<p>This way, it would be a minor change on the launch date D-Day. I could simply delete the application&#8217;s main dll file, and rename the existing .bak file into .dll.</p>
<p>I hope it helps. Cheers!</p>
<blockquote><p>Image courtesy of: <a href="http://humanangels.wordpress.com/fractals/" target="_blank">Human Angel</a></p></blockquote>
<h2>Share and Enjoy</h2>

<!-- Start WP Socializer - Social Buttons - Output -->
<div class="wp-socializer 32px">
<ul class="wp-socializer-jump columns-no">
 <li><a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsodeve.net%2F2011%2F12%2Fhow-to-force-asp-net-mvc-to-serve-index-php%2F&amp;t=How+To+Force+ASP.NET+MVC+To+Serve+Index.PHP" title="Share this on Facebook" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Facebook" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -330px; border:0;"/></a></li> 

 <li><a href="http://twitter.com/home?status=How+To+Force+ASP.NET+MVC+To+Serve+Index.PHP%20-%20http%3A%2F%2Fsodeve.net%3Fp%3D1997%20@sodeve" title="Tweet this !" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Twitter" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -1386px; border:0;"/></a></li> 

 <li><a href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsodeve.net%2F2011%2F12%2Fhow-to-force-asp-net-mvc-to-serve-index-php%2F&amp;title=How+To+Force+ASP.NET+MVC+To+Serve+Index.PHP&amp;annotation=What+a+weird+title+for+a+solution+that+I+don%27t+think+many+people+would+need+%3A%29+But+apparently+I+needed+it.+So+after+scratching+my+head+for+non-dandruff-related+cause%2C+I+found+out+how+to+do+it.%0D%0A%0D%0AJust+a+short+background+story.+We+have+ASP.NET+MVC+app" title="Bookmark this on Google" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Google" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -462px; border:0;"/></a></li> 

 <li><a href="http://delicious.com/post?url=http%3A%2F%2Fsodeve.net%2F2011%2F12%2Fhow-to-force-asp-net-mvc-to-serve-index-php%2F&amp;title=How+To+Force+ASP.NET+MVC+To+Serve+Index.PHP&amp;notes=What+a+weird+title+for+a+solution+that+I+don%27t+think+many+people+would+need+%3A%29+But+apparently+I+needed+it.+So+after+scratching+my+head+for+non-dandruff-related+cause%2C+I+found+out+how+to+do+it.%0D%0A%0D%0AJust+a+short+background+story.+We+have+ASP.NET+MVC+app" title="Post this on Delicious" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Delicious" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -132px; border:0;"/></a></li> 

 <li><a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsodeve.net%2F2011%2F12%2Fhow-to-force-asp-net-mvc-to-serve-index-php%2F&amp;title=How+To+Force+ASP.NET+MVC+To+Serve+Index.PHP&amp;bodytext=What+a+weird+title+for+a+solution+that+I+don%27t+think+many+people+would+need+%3A%29+But+apparently+I+needed+it.+So+after+scratching+my+head+for+non-dandruff-related+cause%2C+I+found+out+how+to+do+it.%0D%0A%0D%0AJust+a+short+background+story.+We+have+ASP.NET+MVC+app" title="Submit this to Digg" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Digg" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -231px; border:0;"/></a></li> 

 <li><a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsodeve.net%2F2011%2F12%2Fhow-to-force-asp-net-mvc-to-serve-index-php%2F&amp;title=How+To+Force+ASP.NET+MVC+To+Serve+Index.PHP" title="Submit this to StumbleUpon" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="StumbleUpon" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -1287px; border:0;"/></a></li> 

 <li><a href="http://sodeve.net/2011/12/how-to-force-asp-net-mvc-to-serve-index-php/" onclick="addBookmark(event);" title="How To Force ASP.NET MVC To Serve Index.PHP" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Add to favorites" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -0px; border:0;"/></a></li> 

 <li><a href="mailto:subject=How To Force ASP.NET MVC To Serve Index.PHP&amp;body=What a weird title for a solution that I don't think many people would need :) But apparently I needed it. So after scratching my head for non-dandruff-related cause, I found out how to do it.

Just a short background story. We have ASP.NET MVC app - http://sodeve.net/2011/12/how-to-force-asp-net-mvc-to-serve-index-php/" title="Email this" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Email" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -297px; border:0;"/></a></li> 

 <li><a href="http://sodeve.net/feed/rss/" title="Subscribe to RSS" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="RSS" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -1221px; border:0;"/></a></li> 
</ul> 
<div class="wp-socializer-clearer"></div></div>
<!-- End WP Socializer - Social Buttons - Output -->
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://sodeve.net/2011/12/how-to-force-asp-net-mvc-to-serve-index-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Create Expandable / Collapsible Box with jQuery Within WordPress</title>
		<link>http://sodeve.net/2011/12/how-to-create-expandablecollapsible-box-with-jquery-within-wordpress/</link>
		<comments>http://sodeve.net/2011/12/how-to-create-expandablecollapsible-box-with-jquery-within-wordpress/#comments</comments>
		<pubDate>Sat, 10 Dec 2011 19:46:21 +0000</pubDate>
		<dc:creator>Hardono</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://sodeve.net/?p=1958</guid>
		<description><![CDATA[jQuery makes a lot of things easier. I have blogged before about creating collapsible/expandable box. But jQuery make that blog post obsolete and too &#8216;dirty&#8217;. After consulting with Google, it pointed out a great website that teaches tips &#38; tricks on Javascript. I modified his project to suit what I need. Below is the code, [...]
Related posts:<ol>
<li><a href='http://sodeve.net/2009/09/how-to-prevent-wordpress-loads-jquery-twice/' rel='bookmark' title='How to Prevent WordPress Loads jQuery Twice'>How to Prevent WordPress Loads jQuery Twice</a></li>
<li><a href='http://sodeve.net/2009/09/using-jquery-to-enhance-google-syntax-highligher-wordpress-plugin/' rel='bookmark' title='Using jQuery to Enhance Google Syntax Highligher WordPress Plugin'>Using jQuery to Enhance Google Syntax Highligher WordPress Plugin</a></li>
<li><a href='http://sodeve.net/2007/03/adding-an-expandable-snippet-box-to-your-wordpress-blog/' rel='bookmark' title='Adding an expandable snippet box to your WordPress blog'>Adding an expandable snippet box to your WordPress blog</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>jQuery makes a lot of things easier. I have blogged <a title="Adding an expandable snippet box to your WordPress blog" href="http://sodeve.net/2007/03/adding-an-expandable-snippet-box-to-your-wordpress-blog/">before</a> about creating collapsible/expandable box. But jQuery make that blog post obsolete and too &#8216;dirty&#8217;.</code></p>
<p>After consulting with Google, it pointed out a great <a title="Matt Kruse's Tips &amp; Tricks" href="http://www.javascripttoolbox.com/jquery/" target="_blank">website</a> that teaches tips &amp; tricks on Javascript. I modified his project to suit what I need. Below is the code, and after it, you could find the Live Demo.</p>
<p>&nbsp;</p>
<h3>Original Code</h3>
<pre name="code" class="html">&lt;html&gt;
	&lt;head&gt;
		&lt;title&gt;Test JQuery&lt;/title&gt;
		&lt;script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js'&gt;&lt;/script&gt;
		&lt;script type="text/javascript"&gt;
			$(function() {
			$('div.sdvExp')
				.css("cursor","pointer")
				.attr("title","Click to expand/collapse")
				.click(function(){
					$(this).siblings('.child-'+this.id).toggle();
				});
			$('div[class^=child-]').hide();
		});
		&lt;/script&gt;
	&lt;/head&gt;
	&lt;body&gt;
		&lt;div class="sdvExp" id="div1"&gt;
			&lt;p&gt;Lorem Ipsum&lt;/p&gt;
		&lt;/div&gt;
		&lt;div class="child-div1"&gt;
			Lorem ipsum dolor sit amet, consectetur adipiscing elit. In at commodo tortor. Donec condimentum rutrum dui,
			vitae rutrum dolor malesuada a. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac
			turpis egestas. Donec facilisis ligula eu risus cursus cursus. Curabitur nec bibendum nulla.
			Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.
			Vivamus eu dolor et enim egestas pellentesque ac a sapien. Maecenas aliquam adipiscing fermentum.
			Quisque egestas dui sed lacus congue id sagittis urna mattis. Duis ut cursus libero.
			Pellentesque lorem neque, fermentum sed fermentum at, auctor et nisl. Nulla lobortis elit odio.
			Suspendisse laoreet volutpat adipiscing.
		&lt;/div&gt;
	&lt;/body&gt;
&lt;/html&gt;
</pre>
<h3>Live Demo</h3>
<div class="sdvExp" style="background:#333;border:1px" id="sdvExp1958">Expandable/Collapsible Box Demo</div>
<div class="child-sdvExp1958">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In at commodo tortor. Donec condimentum rutrum dui, vitae rutrum dolor malesuada a. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec facilisis ligula eu risus cursus cursus. Curabitur nec bibendum nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vivamus eu dolor et enim egestas pellentesque ac a sapien. Maecenas aliquam adipiscing fermentum. Quisque egestas dui sed lacus congue id sagittis urna mattis. Duis ut cursus libero. Pellentesque lorem neque, fermentum sed fermentum at, auctor et nisl. Nulla lobortis elit odio. Suspendisse laoreet volutpat adipiscing.
</div>
<h3>Making it Work in WordPress</h3>
<p>To make the box working in WordPress, please observe the following source code and follow the three steps: </p>
<pre name="code" class="html">
&lt;!-- STEP 1: Create the control DIV. Its class name should be sdvExp. It also must have an ID (e.g. sdvExp1958) --&gt;
&lt;div class=&quot;sdvExp&quot; style=&quot;background:#333;border:1px&quot; id=&quot;sdvExp1958&quot;&gt;&lt;p&gt;Expandable/Collapsible Box Demo&lt;/p&gt;&lt;/div&gt;

&lt;!-- STEP 2: Create the content DIV. Its class name should be child-{control-div-ID} (e.g. child-sdvExp1958) --&gt;
&lt;div class=&quot;child-sdvExp1958&quot;&gt;
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In at commodo tortor. Donec condimentum rutrum dui, vitae rutrum dolor malesuada a. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec facilisis ligula eu risus cursus cursus. Curabitur nec bibendum nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vivamus eu dolor et enim egestas pellentesque ac a sapien. Maecenas aliquam adipiscing fermentum. Quisque egestas dui sed lacus congue id sagittis urna mattis. Duis ut cursus libero. Pellentesque lorem neque, fermentum sed fermentum at, auctor et nisl. Nulla lobortis elit odio. Suspendisse laoreet volutpat adipiscing.
&lt;/div&gt;

&lt;!-- STEP 3: Add the following code --&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;https://s3-us-west-1.amazonaws.com/sodevejs/sodeve.expander.js&quot;&gt;&lt;/script&gt;
</pre>
<p>If you follow three steps above, you should get your expandable/collapsible box working. </p>
<p>Good luck!</p>
<h2>Share and Enjoy</h2>

<!-- Start WP Socializer - Social Buttons - Output -->
<div class="wp-socializer 32px">
<ul class="wp-socializer-jump columns-no">
 <li><a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsodeve.net%2F2011%2F12%2Fhow-to-create-expandablecollapsible-box-with-jquery-within-wordpress%2F&amp;t=How+To+Create+Expandable+%2F+Collapsible+Box+with+jQuery+Within+WordPress" title="Share this on Facebook" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Facebook" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -330px; border:0;"/></a></li> 

 <li><a href="http://twitter.com/home?status=How+To+Create+Expandable+%2F+Collapsible+Box+with+jQuery+Within+WordPress%20-%20http%3A%2F%2Fsodeve.net%3Fp%3D1958%20@sodeve" title="Tweet this !" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Twitter" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -1386px; border:0;"/></a></li> 

 <li><a href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsodeve.net%2F2011%2F12%2Fhow-to-create-expandablecollapsible-box-with-jquery-within-wordpress%2F&amp;title=How+To+Create+Expandable+%2F+Collapsible+Box+with+jQuery+Within+WordPress&amp;annotation=jQuery+makes+a+lot+of+things+easier.+I+have+blogged+before+about+creating+collapsible%2Fexpandable+box.+But+jQuery+make+that+blog+post+obsolete+and+too+%27dirty%27.%0D%0A%0D%0AAfter+consulting+with+Google%2C+it+pointed+out+a+great+website+that+teaches+tips+%26amp%3B+tri" title="Bookmark this on Google" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Google" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -462px; border:0;"/></a></li> 

 <li><a href="http://delicious.com/post?url=http%3A%2F%2Fsodeve.net%2F2011%2F12%2Fhow-to-create-expandablecollapsible-box-with-jquery-within-wordpress%2F&amp;title=How+To+Create+Expandable+%2F+Collapsible+Box+with+jQuery+Within+WordPress&amp;notes=jQuery+makes+a+lot+of+things+easier.+I+have+blogged+before+about+creating+collapsible%2Fexpandable+box.+But+jQuery+make+that+blog+post+obsolete+and+too+%27dirty%27.%0D%0A%0D%0AAfter+consulting+with+Google%2C+it+pointed+out+a+great+website+that+teaches+tips+%26amp%3B+tri" title="Post this on Delicious" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Delicious" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -132px; border:0;"/></a></li> 

 <li><a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsodeve.net%2F2011%2F12%2Fhow-to-create-expandablecollapsible-box-with-jquery-within-wordpress%2F&amp;title=How+To+Create+Expandable+%2F+Collapsible+Box+with+jQuery+Within+WordPress&amp;bodytext=jQuery+makes+a+lot+of+things+easier.+I+have+blogged+before+about+creating+collapsible%2Fexpandable+box.+But+jQuery+make+that+blog+post+obsolete+and+too+%27dirty%27.%0D%0A%0D%0AAfter+consulting+with+Google%2C+it+pointed+out+a+great+website+that+teaches+tips+%26amp%3B+tri" title="Submit this to Digg" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Digg" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -231px; border:0;"/></a></li> 

 <li><a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsodeve.net%2F2011%2F12%2Fhow-to-create-expandablecollapsible-box-with-jquery-within-wordpress%2F&amp;title=How+To+Create+Expandable+%2F+Collapsible+Box+with+jQuery+Within+WordPress" title="Submit this to StumbleUpon" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="StumbleUpon" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -1287px; border:0;"/></a></li> 

 <li><a href="http://sodeve.net/2011/12/how-to-create-expandablecollapsible-box-with-jquery-within-wordpress/" onclick="addBookmark(event);" title="How To Create Expandable / Collapsible Box with jQuery Within WordPress" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Add to favorites" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -0px; border:0;"/></a></li> 

 <li><a href="mailto:subject=How To Create Expandable / Collapsible Box with jQuery Within WordPress&amp;body=jQuery makes a lot of things easier. I have blogged before about creating collapsible/expandable box. But jQuery make that blog post obsolete and too 'dirty'.

After consulting with Google, it pointed out a great website that teaches tips &amp; tri - http://sodeve.net/2011/12/how-to-create-expandablecollapsible-box-with-jquery-within-wordpress/" title="Email this" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Email" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -297px; border:0;"/></a></li> 

 <li><a href="http://sodeve.net/feed/rss/" title="Subscribe to RSS" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="RSS" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -1221px; border:0;"/></a></li> 
</ul> 
<div class="wp-socializer-clearer"></div></div>
<!-- End WP Socializer - Social Buttons - Output -->
<p>Related posts:</p><ol>
<li><a href='http://sodeve.net/2009/09/how-to-prevent-wordpress-loads-jquery-twice/' rel='bookmark' title='How to Prevent WordPress Loads jQuery Twice'>How to Prevent WordPress Loads jQuery Twice</a></li>
<li><a href='http://sodeve.net/2009/09/using-jquery-to-enhance-google-syntax-highligher-wordpress-plugin/' rel='bookmark' title='Using jQuery to Enhance Google Syntax Highligher WordPress Plugin'>Using jQuery to Enhance Google Syntax Highligher WordPress Plugin</a></li>
<li><a href='http://sodeve.net/2007/03/adding-an-expandable-snippet-box-to-your-wordpress-blog/' rel='bookmark' title='Adding an expandable snippet box to your WordPress blog'>Adding an expandable snippet box to your WordPress blog</a></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://sodeve.net/2011/12/how-to-create-expandablecollapsible-box-with-jquery-within-wordpress/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>How To Add Javascript Beep That Runs in All Browsers</title>
		<link>http://sodeve.net/2011/10/how-to-add-javascript-beep-that-runs-in-all-browsers/</link>
		<comments>http://sodeve.net/2011/10/how-to-add-javascript-beep-that-runs-in-all-browsers/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 16:04:55 +0000</pubDate>
		<dc:creator>Hardono</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://sodeve.net/?p=1294</guid>
		<description><![CDATA[In a project that my team did recently, we build a web interface which receive inputs from a barcode scanner. Let&#8217;s focus to the textbox in which the scanning result will be entered. When its content changed, textbox&#8217;s event handler will submit the value to backend process for validation. If valid, the textbox content will [...]
Related posts:<ol>
<li><a href='http://sodeve.net/2007/03/how-to-check-that-javascript-is-enabled-from-server/' rel='bookmark' title='How to Check Whether JavaScript is Enabled From Server'>How to Check Whether JavaScript is Enabled From Server</a></li>
<li><a href='http://sodeve.net/2007/04/css-font-size-illustrated/' rel='bookmark' title='CSS Font-Size Illustrated'>CSS Font-Size Illustrated</a></li>
<li><a href='http://sodeve.net/2009/09/how-to-use-javascript-in-your-wordpress-blog-post/' rel='bookmark' title='How to Use Javascript in Your WordPress Blog Post'>How to Use Javascript in Your WordPress Blog Post</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-1305" title="speaker" src="http://sodeve.net/wp-content/uploads/2011/10/speaker.png" alt="" width="200" height="199" />In a project that my team did recently, we build a web interface which receive inputs from a barcode scanner. Let&#8217;s focus to the textbox in which the scanning result will be entered.</p>
<p>When its content changed, textbox&#8217;s event handler will submit the value to backend process for validation. If valid, the textbox content will be cleared and a single beep sound will be played. If not, a triple beep sound will be played.</p>
<p>Apparently we had a quite challenge in implementing these single beep and triple beep sounds <img src='http://sodeve.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> . So today I want to share what I have learned. When I googled for this topic, I found that there are at least three ways to do this. So I did made a simple HTML project, which you can download at the bottom of this article. I then tested each method using all major browsers (Firefox, Google Chrome, Internet Explorer 9, Opera and Safari).</p>
<p>The first two methods are utilizing plugins. IE will use Windows Media Player plugin, while the rest requires QuickTime plugin. Without these plugins, the first two methods won&#8217;t work.</p>
<h3>1. Using EMBED tag.</h3>
<pre name="code" class="html">&lt;html&gt;
   &lt;head&gt;
      &lt;script type="text/javascript"&gt;
         function PlaySound(soundObj) {
           var sound = document.getElementById(soundObj);
           if (sound)
              sound.Play();
         }
      &lt;/script&gt;
   &lt;/head&gt;
   &lt;body&gt;
      &lt;embed src="sounds/beep.wav" autostart="false" width="0" height="0" id="beep"
      enablejavascript="true"&gt;
      &lt;embed src="sounds/beep3.wav" autostart="false" width="0" height="0" id="beep3"
      enablejavascript="true"&gt;
      &lt;form&gt;
         &lt;input type="button" Value="Beep" onclick="PlaySound('beep')" /&gt;
         &lt;input type="button" Value="3 Beeps" onclick="PlaySound('beep3')" /&gt;
      &lt;/form&gt;
   &lt;/body&gt;
&lt;/html&gt;</pre>
<p>Tested working on:</p>
<p style="margin-left: 30px;"><img class="alignnone size-full wp-image-1314" title="Internet Explorer 9" src="http://sodeve.net/wp-content/uploads/2011/10/ie.png" alt="" width="70" height="66" /><img class="alignnone size-full wp-image-1315" title="Opera 11" src="http://sodeve.net/wp-content/uploads/2011/10/opera.png" alt="" width="70" height="66" /><img class="alignnone size-full wp-image-1320" title="Google Chrome 14" src="http://sodeve.net/wp-content/uploads/2011/10/chrome.png" alt="" width="70" height="66" /><img class="alignnone size-full wp-image-1321" title="Safari 5.1" src="http://sodeve.net/wp-content/uploads/2011/10/safari.png" alt="" width="70" height="66" /></p>
<p>Surprisingly, it doesn&#8217;t work in current version Firefox (7.0.1). Once the page is loaded, Firefox simply barfed error message saying that the QuickTime plugin is crashed.</p>
<h3>2. Using OBJECT tag.</h3>
<pre name="code" class="html">&lt;html&gt;
   &lt;head&gt;
      &lt;script type="text/javascript"&gt;
         function PlaySound(soundObj) {
           var sound = document.getElementById(soundObj);
           if (sound) {
               if (sound.object)
                  //IE needs this
                  sound.object.Play();
               else
                  sound.Play();
              }
         }
      &lt;/script&gt;
   &lt;/head&gt;
   &lt;body&gt;
      &lt;object id="beep3" type="audio/wav" style="visibility:hidden;" data="sounds/beep3.wav"&gt;
         &lt;param name="autostart" value="false" /&gt;
      &lt;/object&gt;
      &lt;object id="beep" type="audio/wav" style="visibility:hidden;" data="sounds/beep.wav"&gt;
         &lt;param name="autostart" value="false" /&gt;
      &lt;/object&gt;
      &lt;form&gt;
         &lt;input type="button" Value="Beep" onclick="PlaySound('beep')" /&gt;
         &lt;input type="button" Value="3 Beeps" onclick="PlaySound('beep3')" /&gt;
      &lt;/form&gt;
   &lt;/body&gt;
&lt;/html&gt;</pre>
<p>Tested working on:</p>
<p style="margin-left: 30px;"><img class="alignnone size-full wp-image-1315" title="Opera 11" src="http://sodeve.net/wp-content/uploads/2011/10/opera.png" alt="" width="70" height="66" /><img class="alignnone size-full wp-image-1320" title="Google Chrome 14" src="http://sodeve.net/wp-content/uploads/2011/10/chrome.png" alt="" width="70" height="66" /><img class="alignnone size-full wp-image-1321" title="Safari 5.1" src="http://sodeve.net/wp-content/uploads/2011/10/safari.png" alt="" width="70" height="66" /><img class="alignnone size-full wp-image-1340" title="Firefox 7.0.1" src="http://sodeve.net/wp-content/uploads/2011/10/firefox.png" alt="" width="70" height="66" /></p>
<p>This method doesn&#8217;t work on IE9. Surprisingly, I get random results when testing in IE9. Sometimes it hanged when it enters <strong style="color: #2ba5d8;">getElementById</strong> method. Some other times it gets &#8220;Access denied&#8221; error when accessing <strong style="color: #2ba5d8;">sound.object.Play()</strong>.</p>
<h3>3. Using AUDIO tag.</h3>
<pre name="code" class="html">&lt;html&gt;
	&lt;head&gt;
		&lt;script type="text/javascript"&gt;
         function PlaySound(soundObj) {
            var sound = document.getElementById(soundObj);
            if (sound)
               sound.play();
         }
      &lt;/script&gt;
   &lt;/head&gt;
   &lt;body&gt;
      &lt;form&gt;
         &lt;button type="button" onclick="PlaySound('beep')"&gt;Beep&lt;/button&gt;
         &lt;button type="button" onclick="PlaySound('beep3')"&gt;Beep 3&lt;/button&gt;
      &lt;/form&gt;
      &lt;audio src="sounds/beep3.wav"  id="beep3" /&gt;
      &lt;audio src="sounds/beep.wav"  id="beep" /&gt;
   &lt;/body&gt;
&lt;/html&gt;</pre>
<p>Audio tag seems to behave abnormally. When I put the audio tag above the form, nothing rendered in the page. Weird, right?<br />
This method tested working on:</p>
<p style="margin-left: 30px;"><img class="alignnone size-full wp-image-1315" title="Opera 11" src="http://sodeve.net/wp-content/uploads/2011/10/opera.png" alt="" width="70" height="66" /><img class="alignnone size-full wp-image-1320" title="Google Chrome 14" src="http://sodeve.net/wp-content/uploads/2011/10/chrome.png" alt="" width="70" height="66" /><img class="alignnone size-full wp-image-1321" title="Safari 5.1" src="http://sodeve.net/wp-content/uploads/2011/10/safari.png" alt="" width="70" height="66" /><img class="alignnone size-full wp-image-1340" title="Firefox 7.0.1" src="http://sodeve.net/wp-content/uploads/2011/10/firefox.png" alt="" width="70" height="66" /></p>
<p>IE9 still not working. When I debug it, it able to return <strong style="color: #2ba5d8;">getElementById</strong> correctly. It&#8217;s just that the <strong style="color: #2ba5d8;">play()</strong> method does nothing.</p>
<h3>Conclusion</h3>
<p>Sadly, we are still unable to have one single solution that works in all major browsers. If we target various browsers, I suggest to use both AUDIO and EMBED tags. Then we select which element to play based on the browser type.</p>
<p>Btw, you can download the project files (html and wav files) <a title="Beep Sound Test Project" href="http://sodeve.net/wp-content/downloads/soundtest.7z">HERE</a>. Please test it yourself. I hope you get the same result as mine <img src='http://sodeve.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  But if you don&#8217;t, please report your finding and let&#8217;s discuss it.</p>
<p>Alright, I hope it helps <img src='http://sodeve.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Cheers!</p>
<p><strong>Reference:</strong></p>
<ol>
<li><a href="http://stackoverflow.com/questions/879152/how-do-i-make-javascript-beep" target="_blank">http://stackoverflow.com/questions/879152/how-do-i-make-javascript-beep</a></li>
<li><a href="http://html5doctor.com/native-audio-in-the-browser/" target="_blank">http://html5doctor.com/native-audio-in-the-browser/</a></li>
</ol>
<h2>Share and Enjoy</h2>

<!-- Start WP Socializer - Social Buttons - Output -->
<div class="wp-socializer 32px">
<ul class="wp-socializer-jump columns-no">
 <li><a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsodeve.net%2F2011%2F10%2Fhow-to-add-javascript-beep-that-runs-in-all-browsers%2F&amp;t=How+To+Add+Javascript+Beep+That+Runs+in+All+Browsers" title="Share this on Facebook" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Facebook" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -330px; border:0;"/></a></li> 

 <li><a href="http://twitter.com/home?status=How+To+Add+Javascript+Beep+That+Runs+in+All+Browsers%20-%20http%3A%2F%2Fsodeve.net%3Fp%3D1294%20@sodeve" title="Tweet this !" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Twitter" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -1386px; border:0;"/></a></li> 

 <li><a href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsodeve.net%2F2011%2F10%2Fhow-to-add-javascript-beep-that-runs-in-all-browsers%2F&amp;title=How+To+Add+Javascript+Beep+That+Runs+in+All+Browsers&amp;annotation=In+a+project+that+my+team+did+recently%2C+we+build+a+web+interface+which+receive+inputs+from+a+barcode+scanner.+Let%27s+focus+to+the+textbox+in+which+the+scanning+result+will+be+entered.%0D%0A%0D%0AWhen+its+content+changed%2C+textbox%27s+event+handler+will+submit+th" title="Bookmark this on Google" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Google" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -462px; border:0;"/></a></li> 

 <li><a href="http://delicious.com/post?url=http%3A%2F%2Fsodeve.net%2F2011%2F10%2Fhow-to-add-javascript-beep-that-runs-in-all-browsers%2F&amp;title=How+To+Add+Javascript+Beep+That+Runs+in+All+Browsers&amp;notes=In+a+project+that+my+team+did+recently%2C+we+build+a+web+interface+which+receive+inputs+from+a+barcode+scanner.+Let%27s+focus+to+the+textbox+in+which+the+scanning+result+will+be+entered.%0D%0A%0D%0AWhen+its+content+changed%2C+textbox%27s+event+handler+will+submit+th" title="Post this on Delicious" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Delicious" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -132px; border:0;"/></a></li> 

 <li><a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsodeve.net%2F2011%2F10%2Fhow-to-add-javascript-beep-that-runs-in-all-browsers%2F&amp;title=How+To+Add+Javascript+Beep+That+Runs+in+All+Browsers&amp;bodytext=In+a+project+that+my+team+did+recently%2C+we+build+a+web+interface+which+receive+inputs+from+a+barcode+scanner.+Let%27s+focus+to+the+textbox+in+which+the+scanning+result+will+be+entered.%0D%0A%0D%0AWhen+its+content+changed%2C+textbox%27s+event+handler+will+submit+th" title="Submit this to Digg" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Digg" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -231px; border:0;"/></a></li> 

 <li><a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsodeve.net%2F2011%2F10%2Fhow-to-add-javascript-beep-that-runs-in-all-browsers%2F&amp;title=How+To+Add+Javascript+Beep+That+Runs+in+All+Browsers" title="Submit this to StumbleUpon" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="StumbleUpon" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -1287px; border:0;"/></a></li> 

 <li><a href="http://sodeve.net/2011/10/how-to-add-javascript-beep-that-runs-in-all-browsers/" onclick="addBookmark(event);" title="How To Add Javascript Beep That Runs in All Browsers" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Add to favorites" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -0px; border:0;"/></a></li> 

 <li><a href="mailto:subject=How To Add Javascript Beep That Runs in All Browsers&amp;body=In a project that my team did recently, we build a web interface which receive inputs from a barcode scanner. Let's focus to the textbox in which the scanning result will be entered.

When its content changed, textbox's event handler will submit th - http://sodeve.net/2011/10/how-to-add-javascript-beep-that-runs-in-all-browsers/" title="Email this" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Email" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -297px; border:0;"/></a></li> 

 <li><a href="http://sodeve.net/feed/rss/" title="Subscribe to RSS" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="RSS" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -1221px; border:0;"/></a></li> 
</ul> 
<div class="wp-socializer-clearer"></div></div>
<!-- End WP Socializer - Social Buttons - Output -->
<p>Related posts:</p><ol>
<li><a href='http://sodeve.net/2007/03/how-to-check-that-javascript-is-enabled-from-server/' rel='bookmark' title='How to Check Whether JavaScript is Enabled From Server'>How to Check Whether JavaScript is Enabled From Server</a></li>
<li><a href='http://sodeve.net/2007/04/css-font-size-illustrated/' rel='bookmark' title='CSS Font-Size Illustrated'>CSS Font-Size Illustrated</a></li>
<li><a href='http://sodeve.net/2009/09/how-to-use-javascript-in-your-wordpress-blog-post/' rel='bookmark' title='How to Use Javascript in Your WordPress Blog Post'>How to Use Javascript in Your WordPress Blog Post</a></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://sodeve.net/2011/10/how-to-add-javascript-beep-that-runs-in-all-browsers/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>How To Enable Multi Language Translations in Ext.NET MVC &#8211; Part 2</title>
		<link>http://sodeve.net/2011/10/how-to-enable-multi-language-translations-in-ext-net-mvc-part-2/</link>
		<comments>http://sodeve.net/2011/10/how-to-enable-multi-language-translations-in-ext-net-mvc-part-2/#comments</comments>
		<pubDate>Mon, 03 Oct 2011 10:00:32 +0000</pubDate>
		<dc:creator>Hardono</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[ext.net]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://sodeve.net/?p=1212</guid>
		<description><![CDATA[In my previous post, I have discussed on how to enable language translation in your server-side Ext.NET control. But this translation method will not run &#8220;on-the-fly&#8221;. You need to refresh your page to get the new language rendered in the screen. To make it &#8220;on-the-fly&#8221;, you need to do these steps: Add an Ext.NET Store [...]
Related posts:<ol>
<li><a href='http://sodeve.net/2011/09/how-to-enable-multi-language-translations-in-ext-net-mvc/' rel='bookmark' title='How To Enable Multi Language Translations in Ext.NET MVC'>How To Enable Multi Language Translations in Ext.NET MVC</a></li>
<li><a href='http://sodeve.net/2007/03/ms-sql-stored-procedure-for-absolute-beginner-part-1/' rel='bookmark' title='MS-SQL Stored Procedure for Absolute Beginner, Part 1'>MS-SQL Stored Procedure for Absolute Beginner, Part 1</a></li>
<li><a href='http://sodeve.net/2007/03/how-to-check-that-javascript-is-enabled-from-server/' rel='bookmark' title='How to Check Whether JavaScript is Enabled From Server'>How to Check Whether JavaScript is Enabled From Server</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://sodeve.net/2011/10/how-to-enable-multi-language-translations-in-ext-net-mvc-part-2/"><img class="size-full wp-image-1214 alignleft" title="ext.net" src="http://sodeve.net/wp-content/uploads/2011/10/ext.net_.png" alt="" width="250" height="100" /></a>In my previous post, I have discussed on how to <a title="How To Enable Multi Language Translations in Ext.NET MVC" href="http://sodeve.net/2011/09/how-to-enable-multi-language-translations-in-ext-net-mvc/">enable language translation</a> in your server-side Ext.NET control.</p>
<p>But this translation method will not run &#8220;on-the-fly&#8221;. You need to refresh your page to get the new language rendered in the screen. To make it &#8220;on-the-fly&#8221;, you need to do these steps:</p>
<ol>
<li>Add an Ext.NET Store in your View page. The Store will hold all the translation data. It will have two fields. The first field is the Key, which is your Ext.NET control&#8217;s ID. The second field is the Value, which is the translation result</li>
<li>When user changed its language preference, set the selected language in a cookie and reload the Store.</li>
<li>The Store will make a HttpRequest to the server. The server read the cookie, and returned a JSON Store object. </li>
<li>Handle the Ext.NET Store&#8217;s Load event by iterating the Store&#8217;s records, and then use Ext.getCmp to get the affected Ext.NET controls and set their Text/Label property</li>
<li>&#8230;..</li>
<li>Profit!!! <img src='http://sodeve.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ol>
<p>You might ask, &#8220;Why we need to set the language preference to a Cookie?&#8221; It&#8217;s required because it will make the Server know and remember about the changes.</p>
<p>Alright, now that I&#8217;ve told you the general concept, time to get dirty (with Code, not bacteria).</p>
<p>So in your Controller, we&#8217;ll add a method that returns AjaxStoreResult. Its function is to retrieve the resource set based on the language code specified in the cookie:</p>
<pre name="code" class="csharp">
using Ext.Net;
using Ext.Net.MVC;
using System.Globalization;
using System.Threading;

// ... Code Snip ...
	public AjaxStoreResult Translate()
	{
		var lang = Request.Cookies["language"].Value;
		CultureInfo cult = Thread.CurrentThread.CurrentCulture;

		try {
			cult = new CultureInfo(lang);
		}
		catch(Exception ex) {}

		var res = Resources.LocalizedText.ResourceManager.GetResourceSet(cult, true, false);
		var trav = res.GetEnumerator();
		var dict = new Dictionary<String, String>();

		while (trav.MoveNext())
		{
			if (trav.Key.ToString().Length > 2)
				dict.Add(trav.Key.ToString(), trav.Value.ToString());
		}

		var q = from c in dict
				select new { key = c.Key, value = c.Value };

		return new AjaxStoreResult(q, dict.Count);
	}
// ... Code Snip ...
</pre>
<p>And here is the Ext.NET Store in your views:</p>
<pre name="code" class="html">
<!-- Code Snip -->
         <ext:Store runat="server" ID="dsTranslate" AutoLoad="false">
        <Proxy>
            <ext:HttpProxy Url="/Common/Translate">
            </ext:HttpProxy>
        </Proxy>
        <Reader>
            <ext:JsonReader Root="data" TotalProperty="total" IDProperty="key">
                <Fields>
                    <ext:RecordField Name="key" />
                    <ext:RecordField Name="value" />
                </Fields>
            </ext:JsonReader>
        </Reader>
        <Listeners>
            <Load Fn="TranslateLoaded" />
        </Listeners>
    </ext:Store>
<!-- Code Snip -->
</pre>
<p>And finally, the event handler to the Store&#8217;s Load event:</p>
<pre name="code" class="js">
var TranslateLoaded = function (objGrid, gridRecords, objOptions) {
	for (var i = 0; i < gridRecords.length; i++) {
		var cmp = Ext.getCmp(gridRecords[i].data.key);
		if (cmp) {
			//Different Ext.NET control might need
			//different treatment.
			if (cmp instanceof Ext.form.ComboBox) {
				cmp.setFieldLabel(gridRecords[i].data.value);
			}
			else if (cmp instanceof Ext.form.TriggerField) {
				if (cmp.emptyText != '') {
					Ext.apply(cmp, {
							emptyText : gridRecords[i].data.value
						});
					cmp.reset();
				}
				if (cmp.fieldLabel != '')
					cmp.setFieldLabel(gridRecords[i].data.value);
			}
			else if (cmp instanceof Ext.menu.Item) {
				var pnl = tpMain.find('title', cmp.text);
				if (pnl.length > 0) {
					pnl[0].setTitle(gridRecords[i].data.value);
					pnl[0].reload();
				}
				cmp.setText(gridRecords[i].data.value);
			}
			else if (cmp instanceof Ext.form.Label
				 || cmp instanceof Ext.tree.TreeNode
				 || cmp instanceof Ext.data.Node) {
					cmp.setText(gridRecords[i].data.value);
			}
			else if (cmp instanceof Ext.Panel
				|| cmp instanceof Ext.Window)
					cmp.setTitle(gridRecords[i].data.value);
			else if (cmp instanceof Ext.form.TextField
				|| cmp instanceof Ext.form.CompositeField)
					cmp.setFieldLabel(gridRecords[i].data.value);
			else if (cmp instanceof Ext.Button) {
				if (cmp.getText() != '' &#038;&#038; cmp.getText() != undefined)
					cmp.setText(gridRecords[i].data.value);
			} else if (cmp instanceof Ext.form.DisplayField) {
				cmp.setValue(gridRecords[i].data.value);
			}
		}
	}
}
</pre>
<p>I hope it helps <img src='http://sodeve.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Cheers!</p>
<h2>Share and Enjoy</h2>

<!-- Start WP Socializer - Social Buttons - Output -->
<div class="wp-socializer 32px">
<ul class="wp-socializer-jump columns-no">
 <li><a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsodeve.net%2F2011%2F10%2Fhow-to-enable-multi-language-translations-in-ext-net-mvc-part-2%2F&amp;t=How+To+Enable+Multi+Language+Translations+in+Ext.NET+MVC+%26%238211%3B+Part+2" title="Share this on Facebook" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Facebook" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -330px; border:0;"/></a></li> 

 <li><a href="http://twitter.com/home?status=How+To+Enable+Multi+Language+Translations+in+Ext.NET+MVC+%26%238211%3B+Part+2%20-%20http%3A%2F%2Fsodeve.net%3Fp%3D1212%20@sodeve" title="Tweet this !" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Twitter" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -1386px; border:0;"/></a></li> 

 <li><a href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsodeve.net%2F2011%2F10%2Fhow-to-enable-multi-language-translations-in-ext-net-mvc-part-2%2F&amp;title=How+To+Enable+Multi+Language+Translations+in+Ext.NET+MVC+%26%238211%3B+Part+2&amp;annotation=In+my+previous+post%2C+I+have+discussed+on+how+to+enable+language+translation+in+your+server-side+Ext.NET+control.%0D%0A%0D%0ABut+this+translation+method+will+not+run+%22on-the-fly%22.+You+need+to+refresh+your+page+to+get+the+new+language+rendered+in+the+screen.+T" title="Bookmark this on Google" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Google" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -462px; border:0;"/></a></li> 

 <li><a href="http://delicious.com/post?url=http%3A%2F%2Fsodeve.net%2F2011%2F10%2Fhow-to-enable-multi-language-translations-in-ext-net-mvc-part-2%2F&amp;title=How+To+Enable+Multi+Language+Translations+in+Ext.NET+MVC+%26%238211%3B+Part+2&amp;notes=In+my+previous+post%2C+I+have+discussed+on+how+to+enable+language+translation+in+your+server-side+Ext.NET+control.%0D%0A%0D%0ABut+this+translation+method+will+not+run+%22on-the-fly%22.+You+need+to+refresh+your+page+to+get+the+new+language+rendered+in+the+screen.+T" title="Post this on Delicious" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Delicious" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -132px; border:0;"/></a></li> 

 <li><a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsodeve.net%2F2011%2F10%2Fhow-to-enable-multi-language-translations-in-ext-net-mvc-part-2%2F&amp;title=How+To+Enable+Multi+Language+Translations+in+Ext.NET+MVC+%26%238211%3B+Part+2&amp;bodytext=In+my+previous+post%2C+I+have+discussed+on+how+to+enable+language+translation+in+your+server-side+Ext.NET+control.%0D%0A%0D%0ABut+this+translation+method+will+not+run+%22on-the-fly%22.+You+need+to+refresh+your+page+to+get+the+new+language+rendered+in+the+screen.+T" title="Submit this to Digg" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Digg" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -231px; border:0;"/></a></li> 

 <li><a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsodeve.net%2F2011%2F10%2Fhow-to-enable-multi-language-translations-in-ext-net-mvc-part-2%2F&amp;title=How+To+Enable+Multi+Language+Translations+in+Ext.NET+MVC+%26%238211%3B+Part+2" title="Submit this to StumbleUpon" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="StumbleUpon" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -1287px; border:0;"/></a></li> 

 <li><a href="http://sodeve.net/2011/10/how-to-enable-multi-language-translations-in-ext-net-mvc-part-2/" onclick="addBookmark(event);" title="How To Enable Multi Language Translations in Ext.NET MVC &#8211; Part 2" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Add to favorites" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -0px; border:0;"/></a></li> 

 <li><a href="mailto:subject=How To Enable Multi Language Translations in Ext.NET MVC &#8211; Part 2&amp;body=In my previous post, I have discussed on how to enable language translation in your server-side Ext.NET control.

But this translation method will not run "on-the-fly". You need to refresh your page to get the new language rendered in the screen. T - http://sodeve.net/2011/10/how-to-enable-multi-language-translations-in-ext-net-mvc-part-2/" title="Email this" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Email" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -297px; border:0;"/></a></li> 

 <li><a href="http://sodeve.net/feed/rss/" title="Subscribe to RSS" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="RSS" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -1221px; border:0;"/></a></li> 
</ul> 
<div class="wp-socializer-clearer"></div></div>
<!-- End WP Socializer - Social Buttons - Output -->
<p>Related posts:</p><ol>
<li><a href='http://sodeve.net/2011/09/how-to-enable-multi-language-translations-in-ext-net-mvc/' rel='bookmark' title='How To Enable Multi Language Translations in Ext.NET MVC'>How To Enable Multi Language Translations in Ext.NET MVC</a></li>
<li><a href='http://sodeve.net/2007/03/ms-sql-stored-procedure-for-absolute-beginner-part-1/' rel='bookmark' title='MS-SQL Stored Procedure for Absolute Beginner, Part 1'>MS-SQL Stored Procedure for Absolute Beginner, Part 1</a></li>
<li><a href='http://sodeve.net/2007/03/how-to-check-that-javascript-is-enabled-from-server/' rel='bookmark' title='How to Check Whether JavaScript is Enabled From Server'>How to Check Whether JavaScript is Enabled From Server</a></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://sodeve.net/2011/10/how-to-enable-multi-language-translations-in-ext-net-mvc-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Retrieve Multiple Ref Cursors Result from Oracle Procedure Using C#</title>
		<link>http://sodeve.net/2011/10/how-to-retrieve-multiple-ref-cursors-result-from-oracle-procedure-using-c/</link>
		<comments>http://sodeve.net/2011/10/how-to-retrieve-multiple-ref-cursors-result-from-oracle-procedure-using-c/#comments</comments>
		<pubDate>Sun, 02 Oct 2011 01:00:58 +0000</pubDate>
		<dc:creator>Hardono</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[oracle]]></category>

		<guid isPermaLink="false">http://sodeve.net/?p=1164</guid>
		<description><![CDATA[I am recently created an .NET Application that needs to utilize a Procedure from Oracle database. The Stored Procedure has five parameters. The first two is input, one is integer output and the last two is ref cursor output. Roughly, the SP looks like this: PACKAGE PKG_TEST_PACKAGE AS TYPE REF_CURSOR IS REF CURSOR; PROCEDURE SP_TEST_PROCEDURE(strInput1 [...]
Related posts:<ol>
<li><a href='http://sodeve.net/2010/06/how-to-retrieve-users-name-and-email-address-from-active-directory/' rel='bookmark' title='How To Retrieve User&#8217;s Name and Email Address From Active Directory'>How To Retrieve User&#8217;s Name and Email Address From Active Directory</a></li>
<li><a href='http://sodeve.net/2007/04/prevent-error-caused-by-null-value-in-your-stored-procedure/' rel='bookmark' title='Prevent Error Caused By Null-Value in Your Stored Procedure'>Prevent Error Caused By Null-Value in Your Stored Procedure</a></li>
<li><a href='http://sodeve.net/2007/03/ms-sql-stored-procedure-for-absolute-beginner-part-1/' rel='bookmark' title='MS-SQL Stored Procedure for Absolute Beginner, Part 1'>MS-SQL Stored Procedure for Absolute Beginner, Part 1</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I am recently created an .NET Application that needs to utilize a Procedure from Oracle database. The Stored Procedure has five parameters. The first two is input, one is integer output and the last two is ref cursor output. Roughly, the SP looks like this:<br />
<img src="http://sodeve.net/wp-content/uploads/2011/10/sql.jpg" alt="" title="sql" width="160" height="176" class="aligncenter size-full wp-image-2062" /></p>
<pre name="code" class="sql">
PACKAGE PKG_TEST_PACKAGE AS
	TYPE REF_CURSOR IS REF CURSOR;
	PROCEDURE SP_TEST_PROCEDURE(strInput1 IN VARCHAR2,
            intInput2 IN INTEGER, intOutput1 OUT INTEGER,
            recordSet1 OUT REF_CURSOR,
            recordSet2 OUT REF_CURSOR);
END;
</pre>
<p>After much tinkering and searching Internet, I found out that there are at least three ways to do it.</p>
<h3>1. Using ADO.NET</h3>
<p>Since Microsoft has deprecated System.Data.OracleClient, this option might not be good for production release.</p>
<pre name="code" class="csharp">
using System;
using System.Data;
using System.Data.OracleClient;

namespace TestOracle
{
    class Program
    {
        static void Main(string[] args)
        {
            var con = new OracleConnection();
            con.ConnectionString = @"Server=(
                    DESCRIPTION=(
                        ADDRESS_LIST=(
                            ADDRESS=(PROTOCOL=TCP)
                            (HOST=YOUR_ORACLE_HOST_NAME)
                            (PORT=1521)
                        )
                    )
                    (CONNECT_DATA = (SID = YOUR_ORACLE_SID)));
                    Uid=YOUR_USERNAME;
                    pwd=YOUR_PASSWORD;";
            con.Open();
            var cmd = con.CreateCommand();
            cmd.CommandText = "PKG_TEST_PACKAGE.SP_TEST_PROCEDURE";
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add(new OracleParameter
            {
                ParameterName = "strInput1",
                Direction = ParameterDirection.Input,
                Value = "SOME_VALUE"
            });
            cmd.Parameters.Add(new OracleParameter
            {
                ParameterName = "intInput2",
                Direction = ParameterDirection.Input,
                Value = 1903
            });
            cmd.Parameters.Add(new OracleParameter
            {
                ParameterName = "intOutput1",
                Direction = ParameterDirection.Output,
                OracleType = OracleType.Int32
            });
            cmd.Parameters.Add(new OracleParameter
            {
                ParameterName = "recordSet1",
                Direction = ParameterDirection.Output,
                OracleType = OracleType.Cursor
            });
            cmd.Parameters.Add(new OracleParameter
            {
                ParameterName = "recordSet2",
                Direction = ParameterDirection.Output,
                OracleType = OracleType.Cursor
            });
            cmd.ExecuteNonQuery();

            int intOutput1 = (int)cmd.Parameters["intOutput1"].Value;
            var recordSet1 = new DataTable();
            recordSet1.Load((OracleDataReader)cmd.Parameters["recordSet1"].Value);

            var recordSet2 = new DataTable();
            recordSet2.Load((OracleDataReader)cmd.Parameters["recordSet2"].Value);

            con.Close();
        }
    }
}
</pre>
<h3>2. Using <a href="http://www.oracle.com/technetwork/database/windows/downloads/index-101290.html" title="Download ODP.NET" target="_blank">ODP.NET</a></h3>
<p>If you&#8217;re developing in 64-bit environment, you might need to specifically set the running <a href="http://sodeve.net/2011/10/visual-studio-2008-error-vshost32-has-stopped-working/" title="Visual Studio 2008 Error: vshost32 has stopped working">environment to x86</a> to prevent issues. For the time being, I think developing in x64 doesn&#8217;t worth the hassle needed just to get your environment working correctly.<br />
Oh and BEWARE of the difference of Connection String between ADO.NET and ODP.NET</p>
<pre name="code" class="csharp">
using System;
using System.Data;
using Oracle.DataAccess.Client;
using Oracle.DataAccess.Types;

namespace TestOracle
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                var con = new OracleConnection();
                con.ConnectionString = @"Data Source=(
                    DESCRIPTION=(
                        ADDRESS_LIST=(
                            ADDRESS=(PROTOCOL=TCP)
                            (HOST=YOUR_ORACLE_HOST_NAME)
                            (PORT=1521)
                        )
                    )
                    (CONNECT_DATA = (SID = YOUR_ORACLE_SID)));
                    User Id=YOUR_USERNAME;
                    Password=YOUR_PASSWORD;";
                con.Open();
                var cmd = con.CreateCommand();
                cmd.CommandText = "PKG_TEST_PACKAGE.SP_TEST_PROCEDURE";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add(new OracleParameter
                {
                   ParameterName = "strInput1",
                   Direction = ParameterDirection.Input,
                   Value = "SOME_VALUE"
                });
                cmd.Parameters.Add(new OracleParameter
                {
                   ParameterName = "intInput2",
                   Direction = ParameterDirection.Input,
                   Value = 1903
                });
                cmd.Parameters.Add(new OracleParameter
                {
                   ParameterName = "intOutput1",
                   Direction = ParameterDirection.Output,
                   OracleDbType = OracleDbType.Int32
                });
                cmd.Parameters.Add(new OracleParameter
                {
                   ParameterName = "recordSet1",
                   Direction = ParameterDirection.Output,
                   OracleDbType = OracleDbType.RefCursor
                });
                cmd.Parameters.Add(new OracleParameter
                {
                   ParameterName = "recordSet2",
                   Direction = ParameterDirection.Output,
                   OracleDbType = OracleDbType.RefCursor
                });   

                cmd.ExecuteNonQuery();

                var recordSet1 = new DataTable();
                OracleRefCursor ref1 = (OracleRefCursor)cmd.Parameters["recordSet1"].Value;
                recordSet1.Load(ref1.GetDataReader());

                var recordSet2 = new DataTable();
                OracleRefCursor ref2 = (OracleRefCursor)cmd.Parameters["recordSet2"].Value;
                recordSet2.Load(ref2.GetDataReader());

                con.Close();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }
    }
}
</pre>
<h3>3. Using <a href="http://msdn.microsoft.com/en-us/library/ff648951.aspx" title="Microsoft Enterprise Library" target="_blank">Enterprise Library</a></h3>
<p>I found out about this when I was working with a project that utilizes Subsonic to connect Oracle. When you are using ORM, you will likely to interact with classes from System.Data.Common. This is a problem because you can&#8217;t specify the data-type of the SP parameter. Luckily, this <a href="http://www.codeproject.com/KB/database/MultipleRefCursors.aspx" title="Returning Multiple Ref Cursors from Oracle using DAAB" target="_blank">article </a>saved me from confusion by giving me the needed pointer.</p>
<pre name="code" class="csharp">
using System;
using Microsoft.Practices.EnterpriseLibrary.Data;
using System.Data;
using System.Data.Common;

//..... Code Snipped
                //ORACLE_DB is connection string name found
                //in your App.config/web.config
                Database db = DatabaseFactory.CreateDatabase("ORACLE_DB");

                //Specify the number of SP's parameters
                object[] myParams = new object[5];

                //Database object will construct the reqired parameters
                DbCommand dbCmd = db.GetStoredProcCommand("PKG_TEST_PACKAGE.SP_TEST_PROCEDURE", myParams);
                db.SetParameterValue(dbCmd, "strInput1", "SOME_VALUE");
                db.SetParameterValue(dbCmd, "intInput2", 1903);

                //Tran is a transaction object, you can use this if
                //you want to be part of a transaction, otherwise
                //you can remove this parameter
                db.ExecuteNonQuery(dbCmd, Tran);

                int intOutput1 = (int)dbCmd.Parameters["intOutput1"].Value;
                var recordSet1 = new DataTable();
                recordSet1.Load((DbDataReader)dbCmd.Parameters["recordSet1"].Value);

                var recordSet2 = new DataTable();
                recordSet2.Load((DbDataReader)dbCmd.Parameters["recordSet2"].Value);
//..... Code Snipped
</pre>
<p>I hope it helps <img src='http://sodeve.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<h2>Share and Enjoy</h2>

<!-- Start WP Socializer - Social Buttons - Output -->
<div class="wp-socializer 32px">
<ul class="wp-socializer-jump columns-no">
 <li><a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsodeve.net%2F2011%2F10%2Fhow-to-retrieve-multiple-ref-cursors-result-from-oracle-procedure-using-c%2F&amp;t=How+To+Retrieve+Multiple+Ref+Cursors+Result+from+Oracle+Procedure+Using+C%23" title="Share this on Facebook" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Facebook" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -330px; border:0;"/></a></li> 

 <li><a href="http://twitter.com/home?status=How+To+Retrieve+Multiple+Ref+Cursors+Result+from+Oracle+Procedure+Using+C%23%20-%20http%3A%2F%2Fsodeve.net%3Fp%3D1164%20@sodeve" title="Tweet this !" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Twitter" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -1386px; border:0;"/></a></li> 

 <li><a href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsodeve.net%2F2011%2F10%2Fhow-to-retrieve-multiple-ref-cursors-result-from-oracle-procedure-using-c%2F&amp;title=How+To+Retrieve+Multiple+Ref+Cursors+Result+from+Oracle+Procedure+Using+C%23&amp;annotation=I+am+recently+created+an+.NET+Application+that+needs+to+utilize+a+Procedure+from+Oracle+database.+The+Stored+Procedure+has+five+parameters.+The+first+two+is+input%2C+one+is+integer+output+and+the+last+two+is+ref+cursor+output.+Roughly%2C+the+SP+looks+lik" title="Bookmark this on Google" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Google" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -462px; border:0;"/></a></li> 

 <li><a href="http://delicious.com/post?url=http%3A%2F%2Fsodeve.net%2F2011%2F10%2Fhow-to-retrieve-multiple-ref-cursors-result-from-oracle-procedure-using-c%2F&amp;title=How+To+Retrieve+Multiple+Ref+Cursors+Result+from+Oracle+Procedure+Using+C%23&amp;notes=I+am+recently+created+an+.NET+Application+that+needs+to+utilize+a+Procedure+from+Oracle+database.+The+Stored+Procedure+has+five+parameters.+The+first+two+is+input%2C+one+is+integer+output+and+the+last+two+is+ref+cursor+output.+Roughly%2C+the+SP+looks+lik" title="Post this on Delicious" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Delicious" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -132px; border:0;"/></a></li> 

 <li><a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsodeve.net%2F2011%2F10%2Fhow-to-retrieve-multiple-ref-cursors-result-from-oracle-procedure-using-c%2F&amp;title=How+To+Retrieve+Multiple+Ref+Cursors+Result+from+Oracle+Procedure+Using+C%23&amp;bodytext=I+am+recently+created+an+.NET+Application+that+needs+to+utilize+a+Procedure+from+Oracle+database.+The+Stored+Procedure+has+five+parameters.+The+first+two+is+input%2C+one+is+integer+output+and+the+last+two+is+ref+cursor+output.+Roughly%2C+the+SP+looks+lik" title="Submit this to Digg" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Digg" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -231px; border:0;"/></a></li> 

 <li><a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsodeve.net%2F2011%2F10%2Fhow-to-retrieve-multiple-ref-cursors-result-from-oracle-procedure-using-c%2F&amp;title=How+To+Retrieve+Multiple+Ref+Cursors+Result+from+Oracle+Procedure+Using+C%23" title="Submit this to StumbleUpon" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="StumbleUpon" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -1287px; border:0;"/></a></li> 

 <li><a href="http://sodeve.net/2011/10/how-to-retrieve-multiple-ref-cursors-result-from-oracle-procedure-using-c/" onclick="addBookmark(event);" title="How To Retrieve Multiple Ref Cursors Result from Oracle Procedure Using C#" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Add to favorites" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -0px; border:0;"/></a></li> 

 <li><a href="mailto:subject=How To Retrieve Multiple Ref Cursors Result from Oracle Procedure Using C#&amp;body=I am recently created an .NET Application that needs to utilize a Procedure from Oracle database. The Stored Procedure has five parameters. The first two is input, one is integer output and the last two is ref cursor output. Roughly, the SP looks lik - http://sodeve.net/2011/10/how-to-retrieve-multiple-ref-cursors-result-from-oracle-procedure-using-c/" title="Email this" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="Email" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -297px; border:0;"/></a></li> 

 <li><a href="http://sodeve.net/feed/rss/" title="Subscribe to RSS" target="_blank" rel="nofollow"><img src="http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-mask-32px.gif" alt="RSS" style="width:32px; height:32px; background: transparent url(http://sodeve.net/wp-content/plugins/wp-socializer/public/social-icons/wp-socializer-sprite-32px.png) no-repeat; background-position:0px -1221px; border:0;"/></a></li> 
</ul> 
<div class="wp-socializer-clearer"></div></div>
<!-- End WP Socializer - Social Buttons - Output -->
<p>Related posts:</p><ol>
<li><a href='http://sodeve.net/2010/06/how-to-retrieve-users-name-and-email-address-from-active-directory/' rel='bookmark' title='How To Retrieve User&#8217;s Name and Email Address From Active Directory'>How To Retrieve User&#8217;s Name and Email Address From Active Directory</a></li>
<li><a href='http://sodeve.net/2007/04/prevent-error-caused-by-null-value-in-your-stored-procedure/' rel='bookmark' title='Prevent Error Caused By Null-Value in Your Stored Procedure'>Prevent Error Caused By Null-Value in Your Stored Procedure</a></li>
<li><a href='http://sodeve.net/2007/03/ms-sql-stored-procedure-for-absolute-beginner-part-1/' rel='bookmark' title='MS-SQL Stored Procedure for Absolute Beginner, Part 1'>MS-SQL Stored Procedure for Absolute Beginner, Part 1</a></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://sodeve.net/2011/10/how-to-retrieve-multiple-ref-cursors-result-from-oracle-procedure-using-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for ( sssodeveee sodeve.net/category/programming/feed/ ) in 11.57104 seconds, on May 21st, 2012 at 9:40 pm UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on May 22nd, 2012 at 9:40 pm UTC -->
