<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.techbrij.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" version="2.0">

<channel>
	<title>TechBrij</title>
	
	<link>http://techbrij.com</link>
	<description>ASP.NET, C#, jQuery &amp; Wordpress Tips</description>
	<lastBuildDate>Tue, 15 May 2012 16:31:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.techbrij.com/techbrij" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="techbrij" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/</creativeCommons:license><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">techbrij</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Pass Session or Viewbag values to JS Files : ASP.NET MVC 3</title>
		<link>http://techbrij.com/956/pass-session-viewbag-values-js-file-asp-net-mvc</link>
		<comments>http://techbrij.com/956/pass-session-viewbag-values-js-file-asp-net-mvc#comments</comments>
		<pubDate>Tue, 15 May 2012 16:31:12 +0000</pubDate>
		<dc:creator>Brij</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[Dev Corner]]></category>
		<category><![CDATA[Razor]]></category>

		<guid isPermaLink="false">http://techbrij.com/?p=956</guid>
		<description><![CDATA[Learn How to get session, viewbag and server params values in javascript file in ASP.NET MVC 3
Related posts:<ol>
<li><a href='http://techbrij.com/565/quick-view-of-asp-net-mvc-3-razor-view-engine' rel='bookmark' title='Quick View of ASP.NET MVC 3 Razor View Engine'>Quick View of ASP.NET MVC 3 Razor View Engine</a></li>
<li><a href='http://techbrij.com/744/whats-new-in-asp-net-mvc-4' rel='bookmark' title='What&#8217;s New in ASP.NET MVC 4'>What&#8217;s New in ASP.NET MVC 4</a></li>
<li><a href='http://techbrij.com/772/show-modal-popup-edit-aspdotnet-gridview' rel='bookmark' title='Show ModalPopUp to Edit Asp.net Gridview Row Values Without using AjaxControlToolkit'>Show ModalPopUp to Edit Asp.net Gridview Row Values Without using AjaxControlToolkit</a></li>
<li><a href='http://techbrij.com/784/online-ticket-booking-system-asp-net-sql-server' rel='bookmark' title='Online Ticket Booking System using ASP.NET'>Online Ticket Booking System using ASP.NET</a></li>
<li><a href='http://techbrij.com/709/client-side-validation-using-asp-net-validator-controls-from-javascript' rel='bookmark' title='Client Side Validation using ASP.NET Validator Controls from Javascript'>Client Side Validation using ASP.NET Validator Controls from Javascript</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/m4iPaPd6cJhQIVXJb0jxDv3Vp5c/0/da"><img src="http://feedads.g.doubleclick.net/~a/m4iPaPd6cJhQIVXJb0jxDv3Vp5c/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/m4iPaPd6cJhQIVXJb0jxDv3Vp5c/1/da"><img src="http://feedads.g.doubleclick.net/~a/m4iPaPd6cJhQIVXJb0jxDv3Vp5c/1/di" border="0" ismap="true"></img></a></p><p>This post explains different ways to get <strong>Session</strong>, <strong>ViewBag </strong>or server side variable&#8217;s values in your external JS files. In Rich UI web app, there are many JS files having thousands lines of code and It&#8217;s common to need of accessing server side variable or session in external js file. Let&#8217;s see different ways to get it in <a href="techbrij.com/category/asp-net-mvc" target="_blank">ASP.NET MVC</a> 3.<span id="more-956"></span><br />
<img src="http://img.techbrij.com/956/razor-javascript-file2.png" alt="razor javascript file2 Pass Session or Viewbag values to JS Files : ASP.NET MVC 3"  title="Pass Session or Viewbag values to JS Files : ASP.NET MVC 3" /></p>
<h3>1. Using Javascript Variable:</h3>
<p>In your view page, you can access session or server side objects easily. So, declare <a href="http://techbrij.com/category/javascript-jquery" target="_blank">javascript</a> variables, assign Session or ViewBag values and use those variables in JS files.<br />
But your javascript variables must be declared before calling external file. For this, Add section in &lt;head> of layout page(say _layout.cshtml).</p>
<pre class="brush: xml; title: ;">
&lt;head&gt;
	...
    &lt;link href=&quot;@Url.Content(&quot;~/Content/Site.css&quot;)&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;

    @RenderSection(&quot;my_script_variables&quot;, false)

    &lt;script src=&quot;@Url.Content(&quot;~/Scripts/external.js&quot;)&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
	...

&lt;/head&gt;
</pre>
<p>and in your view page:</p>
<pre class="brush: xml; title: ;">
@Section my_script_variables {

    &lt;script type=&quot;text/javascript&quot;&gt;
            var variable1 = '@myVar1',
            variable2 = '@Session[&quot;myVar2&quot;]',
            variable3 = '@ViewBag.myVar3';

        &lt;/script&gt;

}
</pre>
<p>Suppose you have following values:</p>
<pre class="brush: xml; title: ;">
@{
    String myVar1 = &quot;First&quot;;
    Session[&quot;myVar2&quot;] = &quot;Second&quot;;
    ViewBag.myVar3 = &quot;Third&quot;;
 }
</pre>
<p>and in external js file:</p>
<pre class="brush: jscript; title: ;"> alert(variable1 + ' ' +variable2 +' '+ variable3);
</pre>
<p> then you will get &#8216;<strong>First Second Third</strong>&#8216; alert message.</p>
<h3>2. Using Control&#8217;s Attributes:</h3>
<p>You can assign Parameters as value of control </p>
<pre class="brush: xml; title: ;">
    &lt;input type=&quot;hidden&quot; value=&quot;@Session[&quot;myVar2&quot;]&quot; id=&quot;myHiddenVar&quot; /&gt;
</pre>
<p>and get it in js file easily</p>
<pre class="brush: jscript; title: ;">  alert($('#myHiddenVar').val());
</pre>
<p>the output in our case is <strong>second</strong>.</p>
<p>You can use <a href="http://ejohn.org/blog/html-5-data-attributes/" target="_blank">Data </a>Attribute also</p>
<pre class="brush: xml; title: ;">
 &lt;a id=&quot;myLink&quot; data-variable1=&quot;@myVar1&quot; data-variable2=&quot;@Session[&quot;myVar2&quot;]&quot; data-variable3=&quot;@ViewBag.myVar3&quot;&gt;Test&lt;/a&gt;
</pre>
<p>and in external js file</p>
<pre class="brush: jscript; title: ;">
 $('#myLink').click(function () {
            alert($(this).data('variable1')+' ' +$(this).data('variable2')+' '+$(this).data('variable3'));
            });
</pre>
<p>On clicking test link, the output is &#8216;<strong>First Second Third</strong>&#8216;.</p>
<h3>3. RazorJS:</h3>
<p> You can add <a href="http://djsolid.net/blog/razorjs---write-razor-inside-your-javascript-files">RazorJS</a> by using <a href="http://nuget.org/packages/RazorJS">Nuget</a>. It allows to write Razor-Style C# or VB.NET inside your Javascript Files. Right now, It supports <strong>Model </strong>and <strong>Url </strong>Only means you can&#8217;t access Session and ViewBag in js (Hope, It&#8217;ll be implemented soon).</p>
<p>If the view is <strong>NOT </strong>strongly typed(means model type is not specified) then you can pass your parameters as model in javascript. Let us see following example:</p>
<p>In <strong>view page</strong></p>
<pre class="brush: xml; title: ;">
@{

    String var1 = &quot;First&quot;;
    Session[&quot;var2&quot;] = &quot;Second&quot;;
    ViewBag.var3 = &quot;Third&quot;;

    Dictionary&lt;string, string&gt; test1 = new Dictionary&lt;string, string&gt;();
    test1.Add(&quot;var1&quot;, var1);
    test1.Add(&quot;var2&quot;, Session[&quot;var2&quot;].ToString());
    test1.Add(&quot;var3&quot;, ViewBag.var3);    

}
  @Html.RazorJSInline(&quot;~/Scripts/external.js&quot;, test1);
</pre>
<p>Here, you notice all required parameters in js file are added in dictionary and pass as a model.  </p>
<p>In <strong>external.js</strong></p>
<pre class="brush: jscript; title: ;">
@{
var myobj = (Dictionary&lt;string, string&gt;)Model;
}
alert('@myobj[&quot;var1&quot;]' +' '+ '@myobj[&quot;var2&quot;]'+' ' +'@myobj[&quot;var3&quot;]');
</pre>
<p>The output is &#8216;<strong>First Second Third</strong>&#8216; alert.</p>
<p><strong>Note:</strong> RazorJSInline takes second parameter as Model. If model type is not specified in view then you can pass any data type(as you&#8217;ve seen above). If model is specified then you have to pass object of same data type(you can modify values of object).</p>
<p>Hope, It helps. Share your opinion and let us know how you are passing parameters in external js files.</p>
<p>Related posts:<ol>
<li><a href='http://techbrij.com/565/quick-view-of-asp-net-mvc-3-razor-view-engine' rel='bookmark' title='Quick View of ASP.NET MVC 3 Razor View Engine'>Quick View of ASP.NET MVC 3 Razor View Engine</a></li>
<li><a href='http://techbrij.com/744/whats-new-in-asp-net-mvc-4' rel='bookmark' title='What&#8217;s New in ASP.NET MVC 4'>What&#8217;s New in ASP.NET MVC 4</a></li>
<li><a href='http://techbrij.com/772/show-modal-popup-edit-aspdotnet-gridview' rel='bookmark' title='Show ModalPopUp to Edit Asp.net Gridview Row Values Without using AjaxControlToolkit'>Show ModalPopUp to Edit Asp.net Gridview Row Values Without using AjaxControlToolkit</a></li>
<li><a href='http://techbrij.com/784/online-ticket-booking-system-asp-net-sql-server' rel='bookmark' title='Online Ticket Booking System using ASP.NET'>Online Ticket Booking System using ASP.NET</a></li>
<li><a href='http://techbrij.com/709/client-side-validation-using-asp-net-validator-controls-from-javascript' rel='bookmark' title='Client Side Validation using ASP.NET Validator Controls from Javascript'>Client Side Validation using ASP.NET Validator Controls from Javascript</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://techbrij.com/956/pass-session-viewbag-values-js-file-asp-net-mvc/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create LifeHacker OR Gizmodo Style Sidebar To Scroll Independently</title>
		<link>http://techbrij.com/953/lifehacker-gizmodo-sidebar-scroll-css-html</link>
		<comments>http://techbrij.com/953/lifehacker-gizmodo-sidebar-scroll-css-html#comments</comments>
		<pubDate>Sat, 28 Apr 2012 16:49:55 +0000</pubDate>
		<dc:creator>Brij</dc:creator>
				<category><![CDATA[Designer Corner]]></category>
		<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://techbrij.com/?p=953</guid>
		<description><![CDATA[Create LifeHacker OR Gizmodo style Sidebar to scroll independently using HTML, CSS and without Javascript.
Related posts:<ol>
<li><a href='http://techbrij.com/733/fixed-sidebar-scrolling-jquery-div' rel='bookmark' title='Fixed Sidebar during Scrolling between Header &amp; Footer using jQuery'>Fixed Sidebar during Scrolling between Header &#038; Footer using jQuery</a></li>
<li><a href='http://techbrij.com/798/stylish-asp-net-wizard-control-horizontal-sidebar-on-top' rel='bookmark' title='Stylish ASP.NET Wizard Control with Horizontal Sidebar on Top'>Stylish ASP.NET Wizard Control with Horizontal Sidebar on Top</a></li>
<li><a href='http://techbrij.com/74/add-widget-to-page-instead-of-sidebar-in-wordpress' rel='bookmark' title='Add widget to page instead of sidebar in wordpress'>Add widget to page instead of sidebar in wordpress</a></li>
<li><a href='http://techbrij.com/885/responsive-design-make-website-mobile-tablet-compatible' rel='bookmark' title='Responsive Design: Make Your Website Mobile, Tablet, Desktop Compatible'>Responsive Design: Make Your Website Mobile, Tablet, Desktop Compatible</a></li>
<li><a href='http://techbrij.com/173/mac-iphone-style-dock-menu-for-your-website' rel='bookmark' title='Mac/iphone Style Dock menu for your website'>Mac/iphone Style Dock menu for your website</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/hyYULMkbfPyzEWjM5w5JAxcqWFU/0/da"><img src="http://feedads.g.doubleclick.net/~a/hyYULMkbfPyzEWjM5w5JAxcqWFU/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/hyYULMkbfPyzEWjM5w5JAxcqWFU/1/da"><img src="http://feedads.g.doubleclick.net/~a/hyYULMkbfPyzEWjM5w5JAxcqWFU/1/di" border="0" ismap="true"></img></a></p><p>In this article, you will see how to implement <a href="http://Lifehacker.com" target="_blank">Lifehacker.com</a> or <a href="http://Gizmodo.com" target="_blank">Gizmodo.com</a> style sidebar which scrolls independently on mouseover with mouse wheel. It&#8217;s really interesting to show important things in top of sidebar. When any user reads articles(might not focus on sidebar instantly), reaches end of article but there is no change in sidebar position. It&#8217;s good and a chance to make attention on sidebar, otherwise sidebar is also moving along with article and top section of sidebar is not focused. <span id="more-953"></span></p>
<p><iframe width="560" height="315" src="http://www.youtube.com/embed/4JIctwsDSnQ" frameborder="0" allowfullscreen></iframe></p>
<p>Let us start to implement a demo using <a href="http://techbrij.com/category/html-css">HTML-CSS</a> without <a href="http://techbrij.com/category/javascript-jquery">Javascript/jQuery</a>.</p>
<h3>1. HTML structure:</h3>
<pre class="brush: xml; title: ;">
&lt;body&gt;
  &lt;div id=&quot;wrapper&quot;&gt;
	&lt;div id=&quot;content&quot;&gt;
		....
	&lt;/div&gt;
	&lt;div id=&quot;sidebarwrapper&quot;&gt;
		&lt;div id=&quot;sidebar&quot;&gt;
		....
			&lt;div id=&quot;sidebaritem&quot; class=&quot;mousescroll&quot;&gt;
			....
			&lt;/div&gt;
		&lt;/div&gt;
	&lt;/div&gt;
  &lt;/div&gt;
&lt;/body&gt;
</pre>
<h3>2. Layout:</h3>
<p><img src="http://img.techbrij.com/952/scroll-sidebar-lifehacker.png" alt="scroll sidebar lifehacker Create LifeHacker OR Gizmodo Style Sidebar To Scroll Independently"  title="Create LifeHacker OR Gizmodo Style Sidebar To Scroll Independently" /></p>
<h3>3. CSS:</h3>
<pre class="brush: css; title: ;">
body,html{
  font-family: arial,verdana;
  height:100%;
}	

div#wrapper{
	width:975px;
	margin:0 auto;
	position:relative;
}
div#content{
	float: left;
    width: 650px;
}
div#sidebarwrapper{
		position: absolute;
		right: 0px;
		top: 0;
		width: 300px;
	}
div#sidebar{
	width:300px;
	overflow:hidden;
	position:fixed;
	height:100%;
	top:0;
}
div#sidebaritem {
    width: 330px;
}

div.mousescroll {
    overflow: hidden;
	height:100%;
}
div.mousescroll:hover {
    overflow-y: scroll;
}
</pre>
<p>On mouse-over, <strong>overflow-y : scroll</strong> which displays vertical scroll if content is more. To hide scroll bar, the width of parent element (sidebar) is kept smaller than sidebaritem with <strong>overflow :hidden</strong>.</p>
<h3>Why Sidebarwrapper?</h3>
<p>Now you might think, what is role of <strong>sidebarwrapper</strong>? If you use sidebar directly you have to define top and right position. Suppose you set <strong>right: 0</strong> then on different resolution, it&#8217;s always sticked with right side even content appears in middle. To keep sidebar along with content, sidebarwrapper is used with <strong>position: absolute</strong> and sidebar is placed in it with fixed position without right declaration.</p>
<div style="margin:25px auto;width:320px"><a href="http://demo.techbrij.com/952/scroll-lifehacker-gizmodo-css-html.php" target="_blank" style="background-color: #3B5998; border-radius: 6px; color: white; display: block; font-size: 18px; font-weight: bold; margin: 7px; min-width: 300px; padding: 10px; text-align: center; width: 320px;">Live Demo</a></div>
<p>Enjoy Designing !!!</p>
<p>Related posts:<ol>
<li><a href='http://techbrij.com/733/fixed-sidebar-scrolling-jquery-div' rel='bookmark' title='Fixed Sidebar during Scrolling between Header &amp; Footer using jQuery'>Fixed Sidebar during Scrolling between Header &#038; Footer using jQuery</a></li>
<li><a href='http://techbrij.com/798/stylish-asp-net-wizard-control-horizontal-sidebar-on-top' rel='bookmark' title='Stylish ASP.NET Wizard Control with Horizontal Sidebar on Top'>Stylish ASP.NET Wizard Control with Horizontal Sidebar on Top</a></li>
<li><a href='http://techbrij.com/74/add-widget-to-page-instead-of-sidebar-in-wordpress' rel='bookmark' title='Add widget to page instead of sidebar in wordpress'>Add widget to page instead of sidebar in wordpress</a></li>
<li><a href='http://techbrij.com/885/responsive-design-make-website-mobile-tablet-compatible' rel='bookmark' title='Responsive Design: Make Your Website Mobile, Tablet, Desktop Compatible'>Responsive Design: Make Your Website Mobile, Tablet, Desktop Compatible</a></li>
<li><a href='http://techbrij.com/173/mac-iphone-style-dock-menu-for-your-website' rel='bookmark' title='Mac/iphone Style Dock menu for your website'>Mac/iphone Style Dock menu for your website</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://techbrij.com/953/lifehacker-gizmodo-sidebar-scroll-css-html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Add Social Slider (Facebook like box, twitter and Google+ Widgets) in Your Website</title>
		<link>http://techbrij.com/944/add-social-slider-widget-website</link>
		<comments>http://techbrij.com/944/add-social-slider-widget-website#comments</comments>
		<pubDate>Mon, 16 Apr 2012 18:27:13 +0000</pubDate>
		<dc:creator>Brij</dc:creator>
				<category><![CDATA[Blogger Corner]]></category>
		<category><![CDATA[SEO Tips]]></category>
		<category><![CDATA[Web Tools Utilities]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Social Media]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://techbrij.com/?p=944</guid>
		<description><![CDATA[How to Add fixed floated Social Slider for Facebook like box, twitter and Google+ page Widgets in Your Website. 
No related posts.]]></description>
			<content:encoded><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/G3t9d7FZYGkLYpm1JZCPQfRin3U/0/da"><img src="http://feedads.g.doubleclick.net/~a/G3t9d7FZYGkLYpm1JZCPQfRin3U/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/G3t9d7FZYGkLYpm1JZCPQfRin3U/1/da"><img src="http://feedads.g.doubleclick.net/~a/G3t9d7FZYGkLYpm1JZCPQfRin3U/1/di" border="0" ismap="true"></img></a></p><p>Today, Social media is a great way to promote websites, blogs, apps and events. For a website, Facebook, Twitter or Google+ widgets become must have parts to get public interaction, generate traffic. If you add <a href="http://techbrij.com/tag/facebook">Facebook </a>Like box, twitter status and Google+ widget in your web page, it takes too much spaces and it makes webpage too complex. So, alternate is to use icons only and on mouse over display corresponding widget. To attract user, make these icons fixed floated.<br />
<span id="more-944"></span></p>
<div style="margin:25px auto;width:320px"><a style="background-color: #3B5998; border-radius: 6px; color: white; display: block; font-size: 18px; font-weight: bold; margin: 7px; min-width: 300px; padding: 10px; text-align: center; width: 320px;" target="_blank" href="http://demo.techbrij.com/950/social-slider-widget-generator.php">Live Demo</a></div>
<p><img src="http://img.techbrij.com/950/social-slider-widget.png" alt="social slider widget Add Social Slider (Facebook like box, twitter and Google+ Widgets) in Your Website"  title="Add Social Slider (Facebook like box, twitter and Google+ Widgets) in Your Website" /></p>
<h3>How To Add:</h3>
<p>1. Open &#8220;<strong>Social Slider Generator</strong>&#8221; page from here:</p>
<div style="margin:25px auto;width:320px"><a style="background-color: #3B5998; border-radius: 6px; color: white; display: block; font-size: 18px; font-weight: bold; margin: 7px; min-width: 300px; padding: 10px; text-align: center; width: 320px;" target="_blank" href="http://demo.techbrij.com/950/social-slider-widget-generator.php">Social Slider Generator</a></div>
<p>2. Enter Facebook fan page URL, Twitter user name and Google+ Page ID.<br />
It&#8217;s not mandatory to enter all fields, If you want to add only Facebook and twitter, enter  Facebook and twitter information only and leave Google+ ID blank.</p>
<p>3. Click on &#8216;<strong>Grab the Code</strong>&#8216; button, copy generated code and paste it before &lt;/body> tag in your page.</p>
<p>4. If you are getting error: <strong>jQuery is undefined</strong> or<strong> $ is undefined</strong>, it means <a href="http://techbrij.com/category/javascript-jquery" target="_blank">jQuery</a> is not available. </p>
<p>For WordPress blog, Put the following code in your <strong>header.php</strong> file in the &lt;head> section:</p>
<p><strong> wp_enqueue_script(&#8220;jquery&#8221;); </strong></p>
<p>before following line:</p>
<p><strong> wp_head(); </strong></p>
<p>For a simple website, add following line in HTML head tag:</p>
<p><strong>&lt;script src=&#8221;http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js&#8221;>&lt;/script></strong></p>
<p>5. It&#8217;s compatible with the latest browsers. It might not work with older browsers.</p>
<h3>Be Careful:</h3>
<p>It&#8217;s really a great widget, more attractive with less web page space. you can ask me what it means to be careful. One thing you need to keep in mind before using this widget&#8230;what???<br />
If you are using Google Adsense in your website, Widget must not cover any part of adsense unit.<br />
Otherwise It violets <a href="http://techbrij.com/576/google-adsense-tips-placement-experiments">adsense </a>policies.</p>
<p>Here’s what it says in the Program Policies…</p>
<p><strong>“Google ads, search boxes or search results may not be… Obscured by elements on a page.”</strong></p>
<p>The thinking is that if you place a navigation element over an ad, an accidental click could be generated.</p>
<p>If you want to use it, use <a href="http://techbrij.com/834/google-adsense-leaderboard-link-units-navigation-menu">Google leaderboard</a> ad unit in header or footer OR ads in right side bar.</p>
<p>Enjoy Social Digital Life !!! </p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://techbrij.com/944/add-social-slider-widget-website/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>4 Ways to Design Responsive Navigation Menu</title>
		<link>http://techbrij.com/939/design-responsive-navigation-menu-links</link>
		<comments>http://techbrij.com/939/design-responsive-navigation-menu-links#comments</comments>
		<pubDate>Tue, 10 Apr 2012 17:14:23 +0000</pubDate>
		<dc:creator>Brij</dc:creator>
				<category><![CDATA[Designer Corner]]></category>
		<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[navigation]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://techbrij.com/?p=939</guid>
		<description><![CDATA[Different ways to design responsive navigation menu compatible with mobile, tablet, desktop ...etc.
Related posts:<ol>
<li><a href='http://techbrij.com/834/google-adsense-leaderboard-link-units-navigation-menu' rel='bookmark' title='Google Adsense: Leaderboard (728 x 90) vs Link Units as Navigation Menu'>Google Adsense: Leaderboard (728 x 90) vs Link Units as Navigation Menu</a></li>
<li><a href='http://techbrij.com/888/tools-test-responsive-web-design' rel='bookmark' title='How to Test Responsive Web Design'>How to Test Responsive Web Design</a></li>
<li><a href='http://techbrij.com/885/responsive-design-make-website-mobile-tablet-compatible' rel='bookmark' title='Responsive Design: Make Your Website Mobile, Tablet, Desktop Compatible'>Responsive Design: Make Your Website Mobile, Tablet, Desktop Compatible</a></li>
<li><a href='http://techbrij.com/729/design-tips-learned-facebook' rel='bookmark' title='5 things I learned from Facebook design'>5 things I learned from Facebook design</a></li>
<li><a href='http://techbrij.com/173/mac-iphone-style-dock-menu-for-your-website' rel='bookmark' title='Mac/iphone Style Dock menu for your website'>Mac/iphone Style Dock menu for your website</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/ZAOIOVsiQ1azqI-RYzHmi7-o7VQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/ZAOIOVsiQ1azqI-RYzHmi7-o7VQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/ZAOIOVsiQ1azqI-RYzHmi7-o7VQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/ZAOIOVsiQ1azqI-RYzHmi7-o7VQ/1/di" border="0" ismap="true"></img></a></p><p>In my recent posts, You&#8217;ve seen how to <a href="http://techbrij.com/885/responsive-design-make-website-mobile-tablet-compatible" target="_blank">Make the Website Mobile, Tablet, Desktop Compatible</a> and <a href="http://techbrij.com/888/tools-test-responsive-web-design" target="_blank">Test Responsive Web Design</a>. In this post, you&#8217;ll see different ways to design responsive navigation menu.<br />
<span id="more-939"></span></p>
<h3>1. Simple Menu:</h3>
<p>It&#8217;s simple <a href="http://techbrij.com/category/html-css" target="_blank">CSS</a> menu based on &#8220;one design for all&#8221;. Menu links goes to next line if browser window is narrow. Generally It&#8217;s independent of media queries conditions.</p>
<p><img src="http://img.techbrij.com/940/simple-responsive-menu.png" alt="simple responsive menu 4 Ways to Design Responsive Navigation Menu "  title="4 Ways to Design Responsive Navigation Menu " /></p>
<p>In this approach, when any link goes to next line, the empty space after the link become useless and it looks not so good.</p>
<h3>2. Menu Links with alignment:</h3>
<p>In this approach, navigation links are divided into equal parts to cover whole browser width and it reduces with browser width for a limit and after this whole menu divided into two rows with equal width and so on.</p>
<p><img src="http://img.techbrij.com/940/responsive-menu-alignment.png" alt="responsive menu alignment 4 Ways to Design Responsive Navigation Menu "  title="4 Ways to Design Responsive Navigation Menu " /></p>
<div style="background-color: #3B5998; border-radius: 10px 10px 10px 10px; color: #ffffff !important; display: block; font-size: 16px; font-weight: bold; margin:7px auto; padding: 5px 18px; text-align: center; width: 200px; "><a style="color:white;background-color: transparent; margin: 0px; font-size: 1em; min-width: 100px; padding: 0px; width: 200px;" href="http://designshack.net/articles/css/code-a-responsive-navigation-menu/" rel="nofollow external" target="_blank">Code and Demo</a></div>
<h3>3. Menu Links With Button:</h3>
<p>In this approach, one button is displayed for small devices and on clicking or mouse-over button, navigation menu will be displayed as drop-down.</p>
<p><img src="http://img.techbrij.com/940/responsive-menu-button.png" alt="responsive menu button 4 Ways to Design Responsive Navigation Menu "  title="4 Ways to Design Responsive Navigation Menu " /></p>
<div style="background-color: #3B5998; border-radius: 10px 10px 10px 10px; color: #ffffff !important; display: block; font-size: 16px; font-weight: bold; margin:7px auto; padding: 5px 18px; text-align: center; width: 200px; "><a style="color:white;background-color: transparent; margin: 0px; font-size: 1em; min-width: 100px; padding: 0px; width: 200px;" href="http://www.9lessons.info/2012/03/bootstrap-tutorial-for-blog-design.html" rel="nofollow external" target="_blank">Code and Demo</a></div>
<p>It&#8217;s useful when you want to focus on content.</p>
<h3>4. Menu To Dropdown:</h3>
<p>In this approach, When the browser window is narrow, the menu converts from a regular row of links into a dropdown control elements. I like this approach the most. Right now, It&#8217;s done in <a  href="http://www.smashingmagazine.com/"  rel="nofollow external" target="_blank">SmashingMagazine</a>.</p>
<p><iframe width="560" height="315" src="http://www.youtube.com/embed/lq47ihlTj6I" frameborder="0" allowfullscreen></iframe></p>
<div style="background-color: #3B5998; border-radius: 10px 10px 10px 10px; color: #ffffff !important; display: block; font-size: 16px; font-weight: bold; margin:7px auto; padding: 5px 18px; text-align: center; width: 200px; "><a style="color:white;background-color: transparent; margin: 0px; font-size: 1em; min-width: 100px; padding: 0px; width: 200px;" href="http://css-tricks.com/convert-menu-to-dropdown/" rel="nofollow external" target="_blank">Code and Demo</a></div>
<p>In <strong>apporach 3</strong>, the menu links are displayed using javascript and you have controls on link means you can display multiple links in single row, but in <strong>approach 4</strong>, links are displayed as dropdown control items and device browser will have control to display. </p>
<p>Share your opinion and suggestion about responsive navigation menu and let us know how you are implementing it.</p>
<p>Related posts:<ol>
<li><a href='http://techbrij.com/834/google-adsense-leaderboard-link-units-navigation-menu' rel='bookmark' title='Google Adsense: Leaderboard (728 x 90) vs Link Units as Navigation Menu'>Google Adsense: Leaderboard (728 x 90) vs Link Units as Navigation Menu</a></li>
<li><a href='http://techbrij.com/888/tools-test-responsive-web-design' rel='bookmark' title='How to Test Responsive Web Design'>How to Test Responsive Web Design</a></li>
<li><a href='http://techbrij.com/885/responsive-design-make-website-mobile-tablet-compatible' rel='bookmark' title='Responsive Design: Make Your Website Mobile, Tablet, Desktop Compatible'>Responsive Design: Make Your Website Mobile, Tablet, Desktop Compatible</a></li>
<li><a href='http://techbrij.com/729/design-tips-learned-facebook' rel='bookmark' title='5 things I learned from Facebook design'>5 things I learned from Facebook design</a></li>
<li><a href='http://techbrij.com/173/mac-iphone-style-dock-menu-for-your-website' rel='bookmark' title='Mac/iphone Style Dock menu for your website'>Mac/iphone Style Dock menu for your website</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://techbrij.com/939/design-responsive-navigation-menu-links/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Query To Check Money Data Type and Convert it to Decimal Dynamically</title>
		<link>http://techbrij.com/948/sql-convert-money-data-type-decimal-dynamically</link>
		<comments>http://techbrij.com/948/sql-convert-money-data-type-decimal-dynamically#comments</comments>
		<pubDate>Thu, 05 Apr 2012 16:32:46 +0000</pubDate>
		<dc:creator>Brij</dc:creator>
				<category><![CDATA[Dev Corner]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://techbrij.com/?p=948</guid>
		<description><![CDATA[How to convert one data type to another in sql server query dynamically.
Related posts:<ol>
<li><a href='http://techbrij.com/898/sql-where-in-statement-select-all-values' rel='bookmark' title='How To Use SQL IN Statement to Select Data Having All Specified Values'>How To Use SQL IN Statement to Select Data Having All Specified Values</a></li>
<li><a href='http://techbrij.com/926/anonymous-type-linq-gridview-sorting-asp-net' rel='bookmark' title='Anonymous Type LINQ Result and GridView Sorting in ASP.NET'>Anonymous Type LINQ Result and GridView Sorting in ASP.NET</a></li>
<li><a href='http://techbrij.com/282/online-tool-to-convert-a-long-query-xml-content-to-string-and-assign-to-a-variable' rel='bookmark' title='Online tool to convert a long query/xml/content to string and assign to a variable'>Online tool to convert a long query/xml/content to string and assign to a variable</a></li>
<li><a href='http://techbrij.com/922/google-docs-forms-share-filter-data' rel='bookmark' title='Moderate Google Docs Forms Data and Share Filtered Data Only to Public'>Moderate Google Docs Forms Data and Share Filtered Data Only to Public</a></li>
<li><a href='http://techbrij.com/895/audit-trail-microsoft-sql-server-quickly' rel='bookmark' title='Implement Audit Trail Quickly for Microsoft SQL Server'>Implement Audit Trail Quickly for Microsoft SQL Server</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/oZumNLXEDbkDWaXzJ6o5qmWjA7c/0/da"><img src="http://feedads.g.doubleclick.net/~a/oZumNLXEDbkDWaXzJ6o5qmWjA7c/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/oZumNLXEDbkDWaXzJ6o5qmWjA7c/1/da"><img src="http://feedads.g.doubleclick.net/~a/oZumNLXEDbkDWaXzJ6o5qmWjA7c/1/di" border="0" ismap="true"></img></a></p><p>Sometimes we need to convert one data type to another data type to map columns in <a href="http://techbrij.com/category/sql-server-dev" target="_blank">sql server</a>. You might not be allowed to change table structure directly. In this case you&#8217;ve to convert in your query or stored procedure. Suppose you&#8217;ve to convert money data-type to decimal for greater precision in calculation then you can do it easily using <a rel="nofollow external" href="http://msdn.microsoft.com/en-us/library/ms187928.aspx"  target="_blank">Cast or Convert</a> methods.<span id="more-948"></span></p>
<p><img src="http://img.techbrij.com/951/money-to-decimal-sql-server.png" alt="money to decimal sql server SQL Query To Check Money Data Type and Convert it to Decimal Dynamically"  title="SQL Query To Check Money Data Type and Convert it to Decimal Dynamically" /></p>
<p>Suppose you don&#8217;t know which column is money type and have to convert all money type to decimal for a table then you can do it with dynamic SQL.</p>
<pre class="brush: sql; title: ;">
Declare @sql varchar(1000)

SELECT @sql = Coalesce(@sql+',','') +
Case DATA_TYPE
when 'money' then 'Cast(' + COLUMN_NAME  + ' as decimal(19,4)) Amt'
else COLUMN_NAME
end
from INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = N'Orders'

Exec ('select '+ @sql + ' from Orders')
</pre>
<p>In above SQL, Column name is retrieved from information schema, Cast syntax is used for money data type columns and  stored in @sql variable which is a part of dynamic select query.</p>
<p>If you know column name and want to check whether it is money type or not then use <a href="http://msdn.microsoft.com/en-us/library/ms178550.aspx" rel="nofollow external" target="_blank">SQL_VARIANT_PROPERTY</a></p>
<pre class="brush: sql; title: ;">
select OrderID, CustomerID, OrderDate,
(case SQL_VARIANT_PROPERTY(Amount ,'BaseType')
when 'money' then Cast(Amount as decimal(10,2))
else 100.00
end) Amt
from Orders
</pre>
<p>Enjoy SQLing !!!</p>
<p>Related posts:<ol>
<li><a href='http://techbrij.com/898/sql-where-in-statement-select-all-values' rel='bookmark' title='How To Use SQL IN Statement to Select Data Having All Specified Values'>How To Use SQL IN Statement to Select Data Having All Specified Values</a></li>
<li><a href='http://techbrij.com/926/anonymous-type-linq-gridview-sorting-asp-net' rel='bookmark' title='Anonymous Type LINQ Result and GridView Sorting in ASP.NET'>Anonymous Type LINQ Result and GridView Sorting in ASP.NET</a></li>
<li><a href='http://techbrij.com/282/online-tool-to-convert-a-long-query-xml-content-to-string-and-assign-to-a-variable' rel='bookmark' title='Online tool to convert a long query/xml/content to string and assign to a variable'>Online tool to convert a long query/xml/content to string and assign to a variable</a></li>
<li><a href='http://techbrij.com/922/google-docs-forms-share-filter-data' rel='bookmark' title='Moderate Google Docs Forms Data and Share Filtered Data Only to Public'>Moderate Google Docs Forms Data and Share Filtered Data Only to Public</a></li>
<li><a href='http://techbrij.com/895/audit-trail-microsoft-sql-server-quickly' rel='bookmark' title='Implement Audit Trail Quickly for Microsoft SQL Server'>Implement Audit Trail Quickly for Microsoft SQL Server</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://techbrij.com/948/sql-convert-money-data-type-decimal-dynamically/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Linux Servers vs. Windows Servers</title>
		<link>http://techbrij.com/931/linux-vs-windows-servers-hosting</link>
		<comments>http://techbrij.com/931/linux-vs-windows-servers-hosting#comments</comments>
		<pubDate>Wed, 04 Apr 2012 16:27:40 +0000</pubDate>
		<dc:creator>guest</dc:creator>
				<category><![CDATA[General Tips]]></category>
		<category><![CDATA[Web Tools Utilities]]></category>
		<category><![CDATA[Web hosting]]></category>
		<category><![CDATA[web server]]></category>

		<guid isPermaLink="false">http://techbrij.com/?p=931</guid>
		<description><![CDATA[There has always been a debate between Linux and Windows users about which platform is better. Linux, being an open source platform, promises better support apart from the fact that it is free while Windows users would argue about the user friendliness and the number of applications supported by it. Let’s have a look at [...]
Related posts:<ol>
<li><a href='http://techbrij.com/690/advantages-of-dedicated-servers-why' rel='bookmark' title='4 Main Advantages of Dedicated Servers'>4 Main Advantages of Dedicated Servers</a></li>
<li><a href='http://techbrij.com/755/download-install-religare-racepro-trading-app-on-windows' rel='bookmark' title='Download &amp; Install Religare RacePro(Trading App) on Windows'>Download &#038; Install Religare RacePro(Trading App) on Windows</a></li>
<li><a href='http://techbrij.com/674/windows-8-dotnet-html5-silverlight' rel='bookmark' title='Windows 8 &amp; Future of .NET'>Windows 8 &#038; Future of .NET</a></li>
<li><a href='http://techbrij.com/213/create-windows-service-quickly-using-net' rel='bookmark' title='Create Windows Service quickly using .NET'>Create Windows Service quickly using .NET</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/EsmMisENNAAVxqrMk3vFZmLhHR8/0/da"><img src="http://feedads.g.doubleclick.net/~a/EsmMisENNAAVxqrMk3vFZmLhHR8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/EsmMisENNAAVxqrMk3vFZmLhHR8/1/da"><img src="http://feedads.g.doubleclick.net/~a/EsmMisENNAAVxqrMk3vFZmLhHR8/1/di" border="0" ismap="true"></img></a></p><p>There has always been a debate between <strong>Linux</strong> and <strong>Windows</strong> users about which platform is better.  Linux, being an open source platform, promises better support apart from the fact that it is free while Windows users would argue about the user friendliness and the number of applications supported by it. Let’s have a look at both platforms so that we can decide which platform will suit our needs and requirements best.<span id="more-931"></span><br />
<img src="http://img.techbrij.com/930/windows-linux-hosting-server.jpg" alt="windows linux hosting server Linux Servers vs. Windows Servers"  title="Linux Servers vs. Windows Servers" /></p>
<h3>The Low-Cost Solution:</h3>
<p>Linux has always been the main competitor for Windows Servers simply because of the great community support that it has maintained over the years.  Popular distros like <strong>Ubuntu</strong>, <strong>OpenSuse</strong>, <strong>Fedora </strong>and <strong>Debian </strong>are all available for free and are updated regularly by a community of Linux enthusiasts.  Any bugs reported is fixed within a few days due to the large number of programmers around the world that contributes to the Linux code base. Commercial Linux distributions like <strong>Red Hat Enterprise Linux</strong> offer free upgrades for a certain amount of time as well as optional technical support on their purchase; this makes them a good choice for small firms with a limited budget. </p>
<p>If your work environment requires a lot of flexibility in the applications that you are using, then Linux is your ideal choice. Most Linux software source codes are available for free allowing them to be customized to meet the requirements of your business without any legal issues involved. You can create your own patches to fix bugs in your network without relying on third party vendors. Security updates and patches are faster with Linux, as the community works on patches and gets them out as soon as possible. With Windows, you have to rely on Microsoft alone, which can leave the security hole open for months.</p>
<p>When it comes to cost, <strong>Linux would definitely overthrow Windows simply because of the comparatively lesser cost in setting up and maintaining a Linux server</strong>. Many companies offer huge discounts on Linux based devices because there are no licensing fees involved in the operating system or in majority of the software that run on Linux. A quick <a href="http://techbrij.com/category/google-adsense-analytics" target="_blank">Google</a> search can help you find <a href="http://www.fatwallet.com/HP-coupons/" rel="dofollow external" target="_blank">HP coupons</a> that could give you discounts of up to 10% on HP hardware that runs on Linux. The discounts are not only limited to HP though. Other vendors also offer big discounts on Linux based services such as web hosting. </p>
<p>Probably one of the disadvantages of Linux is the fact that<strong> it lacks a single platform and customers would often be confused about the different platforms</strong> available for them to use. Also, there are a lot of issues with the upgrade cycle on most of the Linux distros since a new one rolls out every few months. </p>
<h3>User Friendliness at a Cost:</h3>
<p>Microsoft has always been a front runner in the software business and will perhaps remain in that position for the foreseeable future due to a number of reasons. Microsoft has developed a lot of frameworks and applications to suit its customers’ needs and requirements over the years. The classic ASP or <a href="http://techbrij.com/category/aspdotnet">ASP.NET</a>, MS Access, <a href="http://techbrij.com/category/sql-server-dev">Microsoft SQL Server</a>, C# and Silverlight are all available only on the Windows platform. So if your work requires you to use these platforms, then you have no choice but to go for a license. These platforms are more user-friendly and skilled professionals in the aforementioned platforms above are easier to find compared to Linux-based platforms. Thus, this is definitely one area where Windows edges over Linux.</p>
<p>Although you can get similar discounts for Microsoft based servers, due cost of the operating system it may still be more expensive than Linux based servers. Microsoft users will be happy to know that the software that can be used on the Window-based platforms are much easier to use. Many tasks on <strong>Linux systems require a very high level of knowledge about the terminal while most of the work on Windows can be done at the touch of a button</strong>.</p>
<p>With Windows, you can be sure that the most popular platforms such as <strong>PHP</strong>, <strong>MySQL </strong>and <strong>Perl </strong>will be available on Windows. On the other hand, you can&#8217;t be so sure about the opposite.  Also the software support offered by many third-party software vendors on Linux is close to nonexistent at times. It thrives on community support so you never know when your favorite platforms or services are shutdown. Also check out:</p>
<p><a href="http://techbrij.com/690/advantages-of-dedicated-servers-why" target="_blank">4 Main Advantages of Dedicated Servers</a></p>
<h3>The Final Verdict:</h3>
<p>Both Linux and Windows based-servers have their own positive and negative aspects. The main thing that one should consider while choosing a server should be the budget and the scale of the business along with the software platform. These two platforms will continue to compete with each other in the software market for many years as they both evolve with time. Hence, if you are worried about cost and are very comfortable with a command line interface, then Linux is for you. However, if your main issue is user friendliness and platform-specific software applications, then you can’t do wrong with Windows.<br />
Do Share your opinion, suggestion or experience about windows or Linux hosting?</p>
<p><strong>About the author:</strong><br />
Glee Cunningham has worked with servers and other IT technologies for over 15 years.</p>
<p>If you would like to write for us, please read guidelines <a href="http://techbrij.com/write-for-techbrij" target="_blank">here</a>. </p>
<p>Related posts:<ol>
<li><a href='http://techbrij.com/690/advantages-of-dedicated-servers-why' rel='bookmark' title='4 Main Advantages of Dedicated Servers'>4 Main Advantages of Dedicated Servers</a></li>
<li><a href='http://techbrij.com/755/download-install-religare-racepro-trading-app-on-windows' rel='bookmark' title='Download &amp; Install Religare RacePro(Trading App) on Windows'>Download &#038; Install Religare RacePro(Trading App) on Windows</a></li>
<li><a href='http://techbrij.com/674/windows-8-dotnet-html5-silverlight' rel='bookmark' title='Windows 8 &amp; Future of .NET'>Windows 8 &#038; Future of .NET</a></li>
<li><a href='http://techbrij.com/213/create-windows-service-quickly-using-net' rel='bookmark' title='Create Windows Service quickly using .NET'>Create Windows Service quickly using .NET</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://techbrij.com/931/linux-vs-windows-servers-hosting/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moderate Google Docs Forms Data and Share Filtered Data Only to Public</title>
		<link>http://techbrij.com/922/google-docs-forms-share-filter-data</link>
		<comments>http://techbrij.com/922/google-docs-forms-share-filter-data#comments</comments>
		<pubDate>Thu, 29 Mar 2012 17:48:37 +0000</pubDate>
		<dc:creator>Brij</dc:creator>
				<category><![CDATA[General Tips]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Web Tools Utilities]]></category>
		<category><![CDATA[google doc]]></category>

		<guid isPermaLink="false">http://techbrij.com/?p=922</guid>
		<description><![CDATA[How to Moderate Google Docs Forms Data and Share Filtered Data only to Public
Related posts:<ol>
<li><a href='http://techbrij.com/165/open-view-only-shared-google-doc-form' rel='bookmark' title='Open &#8216;View only&#8217; shared google doc form'>Open &#8216;View only&#8217; shared google doc form</a></li>
<li><a href='http://techbrij.com/589/remove-line-numbers-excel-column' rel='bookmark' title='How to Remove Line Numbers in Excel Column'>How to Remove Line Numbers in Excel Column</a></li>
<li><a href='http://techbrij.com/948/sql-convert-money-data-type-decimal-dynamically' rel='bookmark' title='SQL Query To Check Money Data Type and Convert it to Decimal Dynamically'>SQL Query To Check Money Data Type and Convert it to Decimal Dynamically</a></li>
<li><a href='http://techbrij.com/898/sql-where-in-statement-select-all-values' rel='bookmark' title='How To Use SQL IN Statement to Select Data Having All Specified Values'>How To Use SQL IN Statement to Select Data Having All Specified Values</a></li>
<li><a href='http://techbrij.com/559/subdomain-tracking-report-in-google-analytics' rel='bookmark' title='How To See Subdomain Tracking Report In Google Analytics'>How To See Subdomain Tracking Report In Google Analytics</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/l5ntBTpc-E7nI0BysgJYSfZ0Oi8/0/da"><img src="http://feedads.g.doubleclick.net/~a/l5ntBTpc-E7nI0BysgJYSfZ0Oi8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/l5ntBTpc-E7nI0BysgJYSfZ0Oi8/1/da"><img src="http://feedads.g.doubleclick.net/~a/l5ntBTpc-E7nI0BysgJYSfZ0Oi8/1/di" border="0" ismap="true"></img></a></p><p>If you are using <a href="http://techbrij.com/category/google-adsense-analytics">Google </a>Docs for Forms or Surveys, You might be getting lots of fake (spam) form submissions. The situation becomes more critical when you are sharing data, survey result or summary report to public and It would mislead the objective of forms or surveys. By default, <a href="http://techbrij.com/category/google-adsense-analytics">Google </a>forms doesn&#8217;t support Captcha to stop spam submission. But you can&#8217;t block spammers. In this case, you want to moderate the data and share approved/ filtered data to public. <span id="more-922"></span><br />
<img src="http://img.techbrij.com/920/google-docs-forms-filter-share.png" alt="google docs forms filter share Moderate Google Docs Forms Data and Share Filtered Data Only to Public"  title="Moderate Google Docs Forms Data and Share Filtered Data Only to Public" /></p>
<p>Let us take an example to implement this step by step.</p>
<p>Suppose you have a &#8220;<strong>Comment</strong>&#8221; form having Name, Email, Website and Comment fields Then In spreadsheet, you have following structure:</p>
<p><img src="http://img.techbrij.com/920/google-docs-spreadsheet.png" alt="google docs spreadsheet Moderate Google Docs Forms Data and Share Filtered Data Only to Public"  title="Moderate Google Docs Forms Data and Share Filtered Data Only to Public" /></p>
<p>1. You have to add one more column (say &#8220;<strong>IsValid</strong>&#8220;) manually to approve/reject data. </p>
<p>2. Copy the key value from spreadsheet URL (in image it&#8217;s &#8220;0AuqF9Lo00cllnUFB0Nmc&#8221;)</p>
<p>3. Create a New spreadsheet which will have only approved data and will be shared to public. </p>
<p>4. Suppose you have to show Name, Website and Comment columns only. In first row, type column names manually.</p>
<p>5. In A2 cell, type following<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
<strong>=QUERY(ImportRange(&#8220;Key&#8221;,&#8221;Sheet1!B1:F&#8221;);&#8221;Select Col1,Col3,Col4 Where Col5 = TRUE&#8221;;0)</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Replace <strong>Key </strong>to copied key value. In our case the formula will be<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
<strong>=QUERY(ImportRange(&#8220;0AuqF9Lo00cllnUFB0Nmc&#8221;,&#8221;Sheet1!B1:F&#8221;);&#8221;Select Col1,Col3,Col4 Where Col5 = TRUE&#8221;;0)</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
It&#8217;ll display all approved/valid data. </p>
<p><img src="http://img.techbrij.com/920/google-docs-spreadsheet-result.png" alt="google docs spreadsheet result Moderate Google Docs Forms Data and Share Filtered Data Only to Public"  title="Moderate Google Docs Forms Data and Share Filtered Data Only to Public" /></p>
<p>In our formula, two functions are used:<br />
<strong>Query:</strong> It&#8217;s a built-in function that allows you to perform a query over an array of values using the <a href="http://code.google.com/apis/visualization/documentation/querylanguage.html" rel="nofollow external" target="_blank">Google Visualization API Query</a>.</p>
<p><strong>ImportRange:</strong> It lets you reference another sheet from the spreadsheet that you&#8217;re currently editing. the common syntax is:<br />
<strong>=importRange(spreadsheet-key, range). </strong></p>
<p>In our formula, Sheet1&#8242;s column B to F data are selected then it is filtered where <strong>IsValid = true</strong> and selected columns(1,3,4) are displayed in new spreadsheet.  </p>
<p>Now, you can share this spreadsheet to public(file >share > private..Change > Public On the web) OR publish as a web page (File > Publish to the web).</p>
<p>When the form is submitted, an entry goes to original spreadsheet. When you set <strong>IsValid = true</strong> for the entry then It&#8217;ll appear in shared spreadsheet. Thus you can filter spam out. </p>
<p>You can see another live example <a href="http://techbrij.com/submit-dotnet-blog" target="_blank">here</a>.</p>
<p>Hope, It helps.</p>
<p>Related posts:<ol>
<li><a href='http://techbrij.com/165/open-view-only-shared-google-doc-form' rel='bookmark' title='Open &#8216;View only&#8217; shared google doc form'>Open &#8216;View only&#8217; shared google doc form</a></li>
<li><a href='http://techbrij.com/589/remove-line-numbers-excel-column' rel='bookmark' title='How to Remove Line Numbers in Excel Column'>How to Remove Line Numbers in Excel Column</a></li>
<li><a href='http://techbrij.com/948/sql-convert-money-data-type-decimal-dynamically' rel='bookmark' title='SQL Query To Check Money Data Type and Convert it to Decimal Dynamically'>SQL Query To Check Money Data Type and Convert it to Decimal Dynamically</a></li>
<li><a href='http://techbrij.com/898/sql-where-in-statement-select-all-values' rel='bookmark' title='How To Use SQL IN Statement to Select Data Having All Specified Values'>How To Use SQL IN Statement to Select Data Having All Specified Values</a></li>
<li><a href='http://techbrij.com/559/subdomain-tracking-report-in-google-analytics' rel='bookmark' title='How To See Subdomain Tracking Report In Google Analytics'>How To See Subdomain Tracking Report In Google Analytics</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://techbrij.com/922/google-docs-forms-share-filter-data/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Happy Holi</title>
		<link>http://techbrij.com/907/happy-holi-bikaner</link>
		<comments>http://techbrij.com/907/happy-holi-bikaner#comments</comments>
		<pubDate>Wed, 07 Mar 2012 15:35:43 +0000</pubDate>
		<dc:creator>Brij</dc:creator>
				<category><![CDATA[General Tips]]></category>

		<guid isPermaLink="false">http://techbrij.com/?p=907</guid>
		<description><![CDATA[Wishing a very bright, colourful and joyful Bikaneri Holi.
No related posts.]]></description>
			<content:encoded><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/0_4PvTYSTRPi1zf0gTCPxEuvv7M/0/da"><img src="http://feedads.g.doubleclick.net/~a/0_4PvTYSTRPi1zf0gTCPxEuvv7M/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/0_4PvTYSTRPi1zf0gTCPxEuvv7M/1/da"><img src="http://feedads.g.doubleclick.net/~a/0_4PvTYSTRPi1zf0gTCPxEuvv7M/1/di" border="0" ismap="true"></img></a></p><p>Happy <a href="http://en.wikipedia.org/wiki/Holi" rel="nofollow external" target="_blank">Holi</a> (A festival of Colours) to all TechBrij&#8217;s readers.</p>
<p>The world&#8217;s<strong> Lathmar Holi </strong>of Braj has its own identity but also the colors of <strong>Bikaner </strong>in Rajasthan has fun, frolic with the particular style. The festival of Holi means not only with water balloons, pichhkaris or water guns, gulaal, bhang and mithai but also mutual love and unity in society.<span id="more-907"></span> Being Bikaneri, I like splash of Rammat, playing Tambourine and listening traditional bhajans. Bikaner&#8217;s traditions and customs of the common opinion deeply connects each other and makes a unity. During Holi in Bikaner, a group of persons belonging different casts dancing, singing, playing tambourine in various places out is to create an atmosphere of fun. Bikaneri Holi has their own glorious history, culture and tradition which still followed by people. Bikaneri holi has different colors and all Bikaneri spread all over india come their home town to enjoy the color of Holi.</p>
<p><img src="http://img.techbrij.com/907/Holi.jpg" alt="Holi Happy Holi"  title="Happy Holi" /></p>
<p>In above picture, Both are <strong>my nephews</strong> and one year olds.</p>
<p>Enjoy and Celebrate a very bright, colourful and joyful Bikaneri Holi.</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://techbrij.com/907/happy-holi-bikaner/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert ASP.NET Gridview OR HTML Table to Wizard using jQuery</title>
		<link>http://techbrij.com/901/convert-gridview-to-wizard-jquery-aspdotnet</link>
		<comments>http://techbrij.com/901/convert-gridview-to-wizard-jquery-aspdotnet#comments</comments>
		<pubDate>Sat, 03 Mar 2012 18:13:52 +0000</pubDate>
		<dc:creator>Brij</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Dev Corner]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://techbrij.com/?p=901</guid>
		<description><![CDATA[Learn how to Convert ASP.NET Gridview or HTML Table to Wizard using jQuery.
Related posts:<ol>
<li><a href='http://techbrij.com/497/bind-array-to-column-of-asp-net-gridview' rel='bookmark' title='Bind array to specific column of asp.net gridview'>Bind array to specific column of asp.net gridview</a></li>
<li><a href='http://techbrij.com/831/display-total-gridview-footer-row-linq-asp-net' rel='bookmark' title='Displaying Total in ASP.NET Gridview Footer Row Without using Template Field'>Displaying Total in ASP.NET Gridview Footer Row Without using Template Field</a></li>
<li><a href='http://techbrij.com/869/grouping-gridview-rows-asp-net' rel='bookmark' title='Grouping Data in ASP.NET Gridview Control'>Grouping Data in ASP.NET Gridview Control</a></li>
<li><a href='http://techbrij.com/926/anonymous-type-linq-gridview-sorting-asp-net' rel='bookmark' title='Anonymous Type LINQ Result and GridView Sorting in ASP.NET'>Anonymous Type LINQ Result and GridView Sorting in ASP.NET</a></li>
<li><a href='http://techbrij.com/772/show-modal-popup-edit-aspdotnet-gridview' rel='bookmark' title='Show ModalPopUp to Edit Asp.net Gridview Row Values Without using AjaxControlToolkit'>Show ModalPopUp to Edit Asp.net Gridview Row Values Without using AjaxControlToolkit</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/neCIDwYBVKA9n3h6w3_XQU4VsLQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/neCIDwYBVKA9n3h6w3_XQU4VsLQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/neCIDwYBVKA9n3h6w3_XQU4VsLQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/neCIDwYBVKA9n3h6w3_XQU4VsLQ/1/di" border="0" ismap="true"></img></a></p><p>In <a href="http://techbrij.com/863/create-jquery-wizard-simple-steps" target="_blank">my post</a>, I explained how we can create a simple wizard using <a href="http://techbrij.com/category/javascript-jquery"  target="_blank">jQuery</a>. In this post, we&#8217;ll see how asp.net gridview can be displayed in wizard format. Sometimes, gridview is used to take input from user when multiple fields are required many times. It is not user friendly, We can use wizard but not easy to handle on server side as in gridview. So, It&#8217;s better to convert <a href="http://techbrij.com/category/aspdotnet" target="_blank">ASP.NET</a> gridview to jQuery wizard. So, no need to change on server side and UI is also more user convenient. We&#8217;ll convert gridview structure to wizard structure as explained in <a href="http://techbrij.com/863/create-jquery-wizard-simple-steps" target="_blank">this post</a> and use wizard.js.<span id="more-901"></span></p>
<p><img src="http://img.techbrij.com/901/gridview-to-wizard-jquery.png" alt="gridview to wizard jquery Convert ASP.NET Gridview OR HTML Table to Wizard using jQuery"  title="Convert ASP.NET Gridview OR HTML Table to Wizard using jQuery" /></p>
<h3>HTML Source:</h3>
<pre class="brush: xml; title: ;">
 &lt;asp:GridView ID=&quot;GridView1&quot; runat=&quot;server&quot; AutoGenerateColumns=&quot;False&quot;&gt;
                &lt;Columns&gt;
                    &lt;asp:BoundField DataField=&quot;Product&quot; HeaderText=&quot;Product&quot; /&gt;
                    &lt;asp:BoundField DataField=&quot;Price&quot; HeaderText=&quot;Price&quot; /&gt;
                    &lt;asp:TemplateField HeaderText=&quot;Qty&quot;&gt;
                        &lt;ItemTemplate&gt;
                            &lt;asp:TextBox ID=&quot;txtQty&quot; runat=&quot;server&quot; MaxLength=&quot;5&quot; Width=&quot;75px&quot; &gt;&lt;/asp:TextBox&gt;
                        &lt;/ItemTemplate&gt;
                    &lt;/asp:TemplateField&gt;
                    &lt;asp:TemplateField HeaderText=&quot;Size&quot;&gt;
                        &lt;ItemTemplate&gt;
                            &lt;asp:DropDownList ID=&quot;ddlSize&quot; runat=&quot;server&quot;&gt;
                             &lt;asp:ListItem Text=&quot;S&quot; Value=&quot;S&quot;&gt;&lt;/asp:ListItem&gt;
                            &lt;asp:ListItem Text=&quot;M&quot; Value=&quot;M&quot;&gt;&lt;/asp:ListItem&gt;
                            &lt;asp:ListItem Text=&quot;L&quot; Value=&quot;L&quot;&gt;&lt;/asp:ListItem&gt;
                            &lt;asp:ListItem Text=&quot;XL&quot; Value=&quot;XL&quot;&gt;&lt;/asp:ListItem&gt;
                            &lt;asp:ListItem Text=&quot;XXL&quot; Value=&quot;XXL&quot;&gt;&lt;/asp:ListItem&gt;
                           &lt;/asp:DropDownList&gt;
                        &lt;/ItemTemplate&gt;
                    &lt;/asp:TemplateField&gt;
                    &lt;asp:TemplateField HeaderText=&quot;Color&quot;&gt;
                        &lt;ItemTemplate&gt;
                            &lt;asp:DropDownList ID=&quot;ddlColor&quot; runat=&quot;server&quot;&gt;
                              &lt;asp:ListItem Text=&quot;Red&quot; Value=&quot;1&quot;&gt;&lt;/asp:ListItem&gt;
                              &lt;asp:ListItem Text=&quot;Green&quot; Value=&quot;2&quot;&gt;&lt;/asp:ListItem&gt;
                              &lt;asp:ListItem Text=&quot;Blue&quot; Value=&quot;3&quot;&gt;&lt;/asp:ListItem&gt;
                            &lt;/asp:DropDownList&gt;
                        &lt;/ItemTemplate&gt;
                    &lt;/asp:TemplateField&gt;
                &lt;/Columns&gt;
            &lt;/asp:GridView&gt;

            &lt;div id=&quot;wizHolder&quot; style=&quot;margin:70px auto;&quot;&gt;
                &lt;div id=&quot;title&quot;&gt;&amp;nbsp;&amp;nbsp;Wizard Title&lt;a class=&quot;closeButton&quot;&gt;X&lt;/a&gt;&lt;/div&gt;
                &lt;ul id=&quot;wizard&quot;&gt;&lt;/ul&gt;
            &lt;/div&gt;
</pre>
<p>First, you have to include jQuery and wizard.js file. The logic of conversion is simple, traverse gridview row by row and create a new table having Gridview&#8217;s header and current data row as two columns and put in wizHolder > ul > li. So our objective is to create structure something like this:</p>
<pre class="brush: xml; title: ;">
&lt;table&gt;
&lt;tbody&gt;
	&lt;tr&gt;
		&lt;th&gt;Product&lt;/th&gt;
		&lt;td&gt;Product-1&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;th&gt;Price&lt;/th&gt;
		&lt;td&gt;$404&lt;/td&gt;
	&lt;/tr&gt;
	.....
&lt;/tbody&gt;
&lt;/table&gt;
</pre>
<h3>Script Source:</h3>
<p><strong>To convert Gridview:</strong></p>
<pre class="brush: jscript; title: ;">
				var wiz = $('#wizard');
                    $('#&lt;%=GridView1.ClientID %&gt; tr:not(:first)').each(function () {
                        var row = this;
                        var tbl = $('&lt;table/&gt;');
                        $('td', $(this)).each(function (index) {
                            var tr = $('&lt;tr/&gt;');
                            tr.append($('#&lt;%=GridView1.ClientID %&gt; th').eq(index).clone());
                            tr.append($(this).clone());
                            tbl.append(tr);
                        });
                        wiz.append($('&lt;li&gt;&lt;/li&gt;').append(tbl));
                    });
					  $('#&lt;%=GridView1.ClientID %&gt;').remove();
</pre>
<p><strong>To convert HTML Table:</strong></p>
<p>If you have to convert <a href="http://techbrij.com/category/html-css">HTML </a>Table instead of asp.net gridview, replace <strong>&lt;%=GridView1.ClientID %></strong> with your table ID in above code.</p>
<p><strong>To configure wizard:</strong></p>
<pre class="brush: jscript; title: ;">
				var setting = {
                        ctrls: $(&quot;#wizard li&quot;), //Structure for Steps
                        nextButtonTitle: 'Go',
                        nextButtonCss: 'btnNext',
                        callBack: btnNextClicked,
                        previousButtonTitle: 'Back',
                        previousButtonCss: 'btnBack',
                        validateWizardStep: validateStep,
                        validateWizardByTitle: validateByTitle,
                        initStep: 0
                    };
                    showWizardScreen(setting);
</pre>
<p>Same setting is used in which <strong>btnNextClicked</strong>, <strong>validateStep </strong>and <strong>validateByTitle </strong>are functions. See <a href="http://techbrij.com/863/create-jquery-wizard-simple-steps" target="_blank">this post</a> for more details about functions.</p>
<p>Hope, It helps. Enjoy playing with jQuery !!!</p>
<p>Related posts:<ol>
<li><a href='http://techbrij.com/497/bind-array-to-column-of-asp-net-gridview' rel='bookmark' title='Bind array to specific column of asp.net gridview'>Bind array to specific column of asp.net gridview</a></li>
<li><a href='http://techbrij.com/831/display-total-gridview-footer-row-linq-asp-net' rel='bookmark' title='Displaying Total in ASP.NET Gridview Footer Row Without using Template Field'>Displaying Total in ASP.NET Gridview Footer Row Without using Template Field</a></li>
<li><a href='http://techbrij.com/869/grouping-gridview-rows-asp-net' rel='bookmark' title='Grouping Data in ASP.NET Gridview Control'>Grouping Data in ASP.NET Gridview Control</a></li>
<li><a href='http://techbrij.com/926/anonymous-type-linq-gridview-sorting-asp-net' rel='bookmark' title='Anonymous Type LINQ Result and GridView Sorting in ASP.NET'>Anonymous Type LINQ Result and GridView Sorting in ASP.NET</a></li>
<li><a href='http://techbrij.com/772/show-modal-popup-edit-aspdotnet-gridview' rel='bookmark' title='Show ModalPopUp to Edit Asp.net Gridview Row Values Without using AjaxControlToolkit'>Show ModalPopUp to Edit Asp.net Gridview Row Values Without using AjaxControlToolkit</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://techbrij.com/901/convert-gridview-to-wizard-jquery-aspdotnet/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How To Use SQL IN Statement to Select Data Having All Specified Values</title>
		<link>http://techbrij.com/898/sql-where-in-statement-select-all-values</link>
		<comments>http://techbrij.com/898/sql-where-in-statement-select-all-values#comments</comments>
		<pubDate>Sun, 26 Feb 2012 11:29:49 +0000</pubDate>
		<dc:creator>Brij</dc:creator>
				<category><![CDATA[Dev Corner]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://techbrij.com/?p=898</guid>
		<description><![CDATA[Learn How to write SQL Where.. IN query to select data which has all values specified in IN condition. 
Related posts:<ol>
<li><a href='http://techbrij.com/948/sql-convert-money-data-type-decimal-dynamically' rel='bookmark' title='SQL Query To Check Money Data Type and Convert it to Decimal Dynamically'>SQL Query To Check Money Data Type and Convert it to Decimal Dynamically</a></li>
<li><a href='http://techbrij.com/895/audit-trail-microsoft-sql-server-quickly' rel='bookmark' title='Implement Audit Trail Quickly for Microsoft SQL Server'>Implement Audit Trail Quickly for Microsoft SQL Server</a></li>
<li><a href='http://techbrij.com/915/crud-select-insert-update-delete-web-app' rel='bookmark' title='3 Ways to implement CRUD (Select, Insert, Update, Delete) Operations'>3 Ways to implement CRUD (Select, Insert, Update, Delete) Operations</a></li>
<li><a href='http://techbrij.com/922/google-docs-forms-share-filter-data' rel='bookmark' title='Moderate Google Docs Forms Data and Share Filtered Data Only to Public'>Moderate Google Docs Forms Data and Share Filtered Data Only to Public</a></li>
<li><a href='http://techbrij.com/869/grouping-gridview-rows-asp-net' rel='bookmark' title='Grouping Data in ASP.NET Gridview Control'>Grouping Data in ASP.NET Gridview Control</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[
<p><a href="http://feedads.g.doubleclick.net/~a/_hDayIDi1AP_atyrThlcnEKjrP0/0/da"><img src="http://feedads.g.doubleclick.net/~a/_hDayIDi1AP_atyrThlcnEKjrP0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/_hDayIDi1AP_atyrThlcnEKjrP0/1/da"><img src="http://feedads.g.doubleclick.net/~a/_hDayIDi1AP_atyrThlcnEKjrP0/1/di" border="0" ismap="true"></img></a></p><p>Generally, We use SQL <strong>Where .. IN</strong> Statement to determine whether a specified value matches <strong>ANY </strong>value in a sub-query or a list. But sometimes we require to get data which have <strong>ALL </strong>specified values, not ANY value. In this post, we&#8217;ll see how to accomplish it. Let&#8217;s take an example, Consider following data in <strong>Orders </strong>table<span id="more-898"></span></p>
<table border="0">
<tr>
<th>OrderID</th>
<th>ProductID</th>
</tr>
<tr>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>1</td>
<td>2</td>
</tr>
<tr>
<td>1</td>
<td>3</td>
</tr>
<tr>
<td>2</td>
<td>1</td>
</tr>
<tr>
<td>2</td>
<td>3</td>
</tr>
<tr>
<td>3</td>
<td>2</td>
</tr>
<tr>
<td>3</td>
<td>3</td>
</tr>
<tr>
<td>4</td>
<td>3</td>
</tr>
<tr>
<td>5</td>
<td>2</td>
</tr>
<tr>
<td>5</td>
<td>4</td>
</tr>
</table>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p><strong>SQL Query:</strong></p>
<p>Select distinct OrderID<br />
From Orders<br />
Where ProductID in (2,3)<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
The above query selects OrderIDs which has any specified ProductID (2 or 3 or both)</p>
<p><strong>Output:</strong></p>
<p>1<br />
2<br />
3<br />
4<br />
5</p>
<p>Now, we want to select OrderIDs which have <strong>ALL </strong>specified values (2 and 3 both). See following SQL query:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
<strong>Select OrderID<br />
From Orders<br />
Where ProductID in (2,3)<br />
group by OrderID<br />
having count(*) = 2</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
<strong>Output:</strong><br />
1<br />
3</p>
<p>Which is expected. In above query, We are grouping by OrderID, counting and select if count is equal to total number of items in the specified values. If there are 5 items in IN condition then you have to set having count(*) = 5.</p>
<p>Hope, It saves your time. Let me know how you are doing to do this.</p>
<p>Related posts:<ol>
<li><a href='http://techbrij.com/948/sql-convert-money-data-type-decimal-dynamically' rel='bookmark' title='SQL Query To Check Money Data Type and Convert it to Decimal Dynamically'>SQL Query To Check Money Data Type and Convert it to Decimal Dynamically</a></li>
<li><a href='http://techbrij.com/895/audit-trail-microsoft-sql-server-quickly' rel='bookmark' title='Implement Audit Trail Quickly for Microsoft SQL Server'>Implement Audit Trail Quickly for Microsoft SQL Server</a></li>
<li><a href='http://techbrij.com/915/crud-select-insert-update-delete-web-app' rel='bookmark' title='3 Ways to implement CRUD (Select, Insert, Update, Delete) Operations'>3 Ways to implement CRUD (Select, Insert, Update, Delete) Operations</a></li>
<li><a href='http://techbrij.com/922/google-docs-forms-share-filter-data' rel='bookmark' title='Moderate Google Docs Forms Data and Share Filtered Data Only to Public'>Moderate Google Docs Forms Data and Share Filtered Data Only to Public</a></li>
<li><a href='http://techbrij.com/869/grouping-gridview-rows-asp-net' rel='bookmark' title='Grouping Data in ASP.NET Gridview Control'>Grouping Data in ASP.NET Gridview Control</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://techbrij.com/898/sql-where-in-statement-select-all-values/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

