<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Anil Bhatt's Weblog</title>
	<atom:link href="http://akbbhatt.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://akbbhatt.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Tue, 09 Nov 2010 09:50:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='akbbhatt.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Anil Bhatt's Weblog</title>
		<link>http://akbbhatt.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://akbbhatt.wordpress.com/osd.xml" title="Anil Bhatt&#039;s Weblog" />
	<atom:link rel='hub' href='http://akbbhatt.wordpress.com/?pushpress=hub'/>
		<item>
		<title></title>
		<link>http://akbbhatt.wordpress.com/2009/08/07/91/</link>
		<comments>http://akbbhatt.wordpress.com/2009/08/07/91/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 10:27:58 +0000</pubDate>
		<dc:creator>akbbhatt</dc:creator>
				<category><![CDATA[1]]></category>

		<guid isPermaLink="false">http://akbbhatt.wordpress.com/2009/08/07/91/</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=akbbhatt.wordpress.com&amp;blog=5096992&amp;post=91&amp;subd=akbbhatt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img style="visibility:hidden;width:0;height:0;" border="0" width="0" height="0" src="http://counters.gigya.com/wildfire/IMP/CXNID=2000002.0NXC/bHQ9MTI*OTY*MDgyODU2MSZwdD*xMjQ5NjQwODc1MjA3JnA9MTQ2NDgxJmQ9Jm49d29yZHByZXNzJmc9MSZvPTY*ZDQwMGZiMTI3YTQ1ODZiNDg4MTBhOTY3YWExYzM*Jm9mPTA=.gif" /><a href="http://s05.flagcounter.com/more/DLV"><img src="http://s05.flagcounter.com/count/DLV/bg=FFFFFF/txt=000000/border=CCCCCC/columns=2/maxflags=200/viewers=0/labels=0/" alt="free counters" border="0"></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/akbbhatt.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/akbbhatt.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/akbbhatt.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/akbbhatt.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/akbbhatt.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/akbbhatt.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/akbbhatt.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/akbbhatt.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/akbbhatt.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/akbbhatt.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/akbbhatt.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/akbbhatt.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/akbbhatt.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/akbbhatt.wordpress.com/91/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=akbbhatt.wordpress.com&amp;blog=5096992&amp;post=91&amp;subd=akbbhatt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://akbbhatt.wordpress.com/2009/08/07/91/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/52345925bc35743f8a8e08d590b1b21d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akbbhatt</media:title>
		</media:content>

		<media:content url="http://counters.gigya.com/wildfire/IMP/CXNID=2000002.0NXC/bHQ9MTI*OTY*MDgyODU2MSZwdD*xMjQ5NjQwODc1MjA3JnA9MTQ2NDgxJmQ9Jm49d29yZHByZXNzJmc9MSZvPTY*ZDQwMGZiMTI3YTQ1ODZiNDg4MTBhOTY3YWExYzM*Jm9mPTA=.gif" medium="image" />

		<media:content url="http://s05.flagcounter.com/count/DLV/bg=FFFFFF/txt=000000/border=CCCCCC/columns=2/maxflags=200/viewers=0/labels=0/" medium="image">
			<media:title type="html">free counters</media:title>
		</media:content>
	</item>
		<item>
		<title>set css class for controls using javascript from code behind</title>
		<link>http://akbbhatt.wordpress.com/2009/06/10/set-css-class-for-controls-using-javascript-from-code-behind/</link>
		<comments>http://akbbhatt.wordpress.com/2009/06/10/set-css-class-for-controls-using-javascript-from-code-behind/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 13:30:15 +0000</pubDate>
		<dc:creator>akbbhatt</dc:creator>
				<category><![CDATA[1]]></category>

		<guid isPermaLink="false">http://akbbhatt.wordpress.com/2009/06/10/set-css-class-for-controls-using-javascript-from-code-behind/</guid>
		<description><![CDATA[string scriptString = "document.getElementById('ctl00_tvMainNavigationn17')"; scriptString += ".setAttribute('className', 'NodeBold');"; scriptString += "document.getElementById('ctl00_tvMainNavigationn18').setAttribute('className', 'NodeBoldClass');"; scriptString += "document.getElementById('ctl00_tvMainNavigationn19').setAttribute('className', 'NodeBoldClass');"; Page.RegisterStartupScript("onload", scriptString);<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=akbbhatt.wordpress.com&amp;blog=5096992&amp;post=78&amp;subd=akbbhatt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><code>string scriptString = "document.getElementById('ctl00_tvMainNavigationn17')";<br />
scriptString += ".setAttribute('className', 'NodeBold');";<br />
scriptString += "document.getElementById('ctl00_tvMainNavigationn18').setAttribute('className', 'NodeBoldClass');";<br />
scriptString += "document.getElementById('ctl00_tvMainNavigationn19').setAttribute('className', 'NodeBoldClass');";<br />
Page.RegisterStartupScript("onload", scriptString);</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/akbbhatt.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/akbbhatt.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/akbbhatt.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/akbbhatt.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/akbbhatt.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/akbbhatt.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/akbbhatt.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/akbbhatt.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/akbbhatt.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/akbbhatt.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/akbbhatt.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/akbbhatt.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/akbbhatt.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/akbbhatt.wordpress.com/78/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=akbbhatt.wordpress.com&amp;blog=5096992&amp;post=78&amp;subd=akbbhatt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://akbbhatt.wordpress.com/2009/06/10/set-css-class-for-controls-using-javascript-from-code-behind/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/52345925bc35743f8a8e08d590b1b21d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akbbhatt</media:title>
		</media:content>
	</item>
		<item>
		<title>Call a master page Method() from content page using c#</title>
		<link>http://akbbhatt.wordpress.com/2009/05/26/call-a-master-page-method-from-content-page-using-c/</link>
		<comments>http://akbbhatt.wordpress.com/2009/05/26/call-a-master-page-method-from-content-page-using-c/#comments</comments>
		<pubDate>Tue, 26 May 2009 15:25:25 +0000</pubDate>
		<dc:creator>akbbhatt</dc:creator>
				<category><![CDATA[1]]></category>
		<category><![CDATA[call master page method]]></category>

		<guid isPermaLink="false">http://akbbhatt.wordpress.com/2009/05/26/call-a-master-page-method-from-content-page-using-c/</guid>
		<description><![CDATA[In the Master page code behind file define the method you want to call as Public. public partial class MasterPage : System.Web.UI.MasterPage { public void ShowLicenseErrorImage() { this.IMG_LicenseExceedWarn.Visible = this.lblLicenseMisuse.Visible = this.lblDetails.Visible = true; } public void HideLicenseErrorImage() { this.IMG_LicenseExceedWarn.Visible = this.lblLicenseMisuse.Visible = this.lblDetails.Visible = false; } } Now in the content page code befind [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=akbbhatt.wordpress.com&amp;blog=5096992&amp;post=76&amp;subd=akbbhatt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In the Master page code behind file define the method you want to call as Public.</p>
<p>public partial class MasterPage : System.Web.UI.MasterPage<br />
{</p>
<p>public void ShowLicenseErrorImage()<br />
{<br />
this.IMG_LicenseExceedWarn.Visible =<br />
this.lblLicenseMisuse.Visible =<br />
this.lblDetails.Visible = true;<br />
}</p>
<p>public void HideLicenseErrorImage()<br />
{<br />
this.IMG_LicenseExceedWarn.Visible =<br />
this.lblLicenseMisuse.Visible =<br />
this.lblDetails.Visible = false;<br />
}</p>
<p>}</p>
<p>Now in the content page code befind type the following.</p>
<p>MasterPage master = (MasterPage)this.Master;<br />
master.ShowLicenseErrorImage();</p>
<p>Where &#8220;MasterPage&#8221; is the class name of class in master page.</p>
<p>Thats it!!! <img src='http://s2.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/akbbhatt.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/akbbhatt.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/akbbhatt.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/akbbhatt.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/akbbhatt.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/akbbhatt.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/akbbhatt.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/akbbhatt.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/akbbhatt.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/akbbhatt.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/akbbhatt.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/akbbhatt.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/akbbhatt.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/akbbhatt.wordpress.com/76/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=akbbhatt.wordpress.com&amp;blog=5096992&amp;post=76&amp;subd=akbbhatt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://akbbhatt.wordpress.com/2009/05/26/call-a-master-page-method-from-content-page-using-c/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/52345925bc35743f8a8e08d590b1b21d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akbbhatt</media:title>
		</media:content>
	</item>
		<item>
		<title>Set culture to your application according to the client&#8217;s browser language</title>
		<link>http://akbbhatt.wordpress.com/2009/04/02/set-culture-to-your-application-according-to-the-clients-browser-language/</link>
		<comments>http://akbbhatt.wordpress.com/2009/04/02/set-culture-to-your-application-according-to-the-clients-browser-language/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 10:13:07 +0000</pubDate>
		<dc:creator>akbbhatt</dc:creator>
				<category><![CDATA[1]]></category>
		<category><![CDATA[add culture]]></category>
		<category><![CDATA[browser language]]></category>
		<category><![CDATA[client's culture settings]]></category>
		<category><![CDATA[globalization]]></category>
		<category><![CDATA[regional settings]]></category>

		<guid isPermaLink="false">http://akbbhatt.wordpress.com/2009/04/02/set-culture-to-your-application-according-to-the-clients-browser-language/</guid>
		<description><![CDATA[As a part of globalization of an application we will require to set culture depending on the which language client&#8217;s browser is using. And using these culture we should represent date, numbers, currency etc in specific format. For this we can use Request.UserLanguages. Following is a method which returns the code of language which the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=akbbhatt.wordpress.com&amp;blog=5096992&amp;post=70&amp;subd=akbbhatt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As a part of globalization of an application we will require to set culture depending on the which language client&#8217;s browser is using. And using these culture we should represent date, numbers, currency etc in specific format. For this we can use Request.UserLanguages. Following is a method which returns the code of language which the browser is using. <span id="more-70"></span></p>
<p>///<br />
/// Gets the current browser language used by the client.<br />
///<br />
/// Returns the culture name generated from the browser language<br />
public string GetBrowserLanguage()<br />
{<br />
string browserLanguage = string.Empty;<br />
HttpRequest Request = HttpContext.Current.Request;<br />
if (Request.UserLanguages == null)<br />
return string.Empty;<br />
try<br />
{<br />
browserLanguage = Request.UserLanguages[0];<br />
if (!string.IsNullOrEmpty(browserLanguage))<br />
{<br />
if (browserLanguage.Length &lt; 3)<br />
browserLanguage = browserLanguage + &#8220;-&#8221; + browserLanguage.ToUpper();<br />
CultureInfo culture = CultureInfo.CreateSpecificCulture(browserLanguage);<br />
return culture.Name;<br />
}<br />
return string.Empty;<br />
}<br />
catch (Exception ex)<br />
{<br />
Debug.Write(ex.ToString());<br />
return string.Empty;<br />
}</p>
<p>If we want to set culture for RDLC report items then pass this culture code/name to the report. And in report right click-&gt;properties, choose code tab. Here we can write simple VB code. You can write a cb function to format the number according the browser culture.</p>
<p>Public Function FormatNumberByCulture(ByVal size As Long, ByVal cultureName As String)<br />
If cultureName.Length &gt; 0 Then<br />
Return size.ToString(&#8220;N&#8221;, System.Globalization.CultureInfo.CreateSpecificCulture(cultureName))<br />
End If<br />
Return size.ToString()<br />
End Function<br />
Now, call this function from report. In report, right click in the textbox which will display the number. NOw choose expression and call the function in this expression like this,<br />
=Code.FormatNumberByCulture(Fields!Size.Value,Fields!CultureName.Value)<br />
Now the number will be formated with the culture name generated from client&#8217;s browser.</p>
<p>Thanks,<br />
Anil.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/akbbhatt.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/akbbhatt.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/akbbhatt.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/akbbhatt.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/akbbhatt.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/akbbhatt.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/akbbhatt.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/akbbhatt.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/akbbhatt.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/akbbhatt.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/akbbhatt.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/akbbhatt.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/akbbhatt.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/akbbhatt.wordpress.com/70/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=akbbhatt.wordpress.com&amp;blog=5096992&amp;post=70&amp;subd=akbbhatt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://akbbhatt.wordpress.com/2009/04/02/set-culture-to-your-application-according-to-the-clients-browser-language/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/52345925bc35743f8a8e08d590b1b21d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akbbhatt</media:title>
		</media:content>
	</item>
		<item>
		<title>Javascript: email address field validation</title>
		<link>http://akbbhatt.wordpress.com/2009/01/22/javascript-email-address-field-validation/</link>
		<comments>http://akbbhatt.wordpress.com/2009/01/22/javascript-email-address-field-validation/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 10:22:54 +0000</pubDate>
		<dc:creator>akbbhatt</dc:creator>
				<category><![CDATA[1]]></category>

		<guid isPermaLink="false">http://akbbhatt.wordpress.com/?p=67</guid>
		<description><![CDATA[Use the following code function EmailIdCheck(str) { var at=&#8221;@&#8221; var dot=&#8221;.&#8221; var lat=str.indexOf(at) var lstr=str.length var ldot=str.indexOf(dot) if (str.indexOf(at)==-1){ alert(&#8220;Please enter a valid email address&#8221;) return false } if (str.indexOf(at)==-1 &#124;&#124; str.indexOf(at)==0 &#124;&#124; str.indexOf(at)==lstr){ alert(&#8220;Please enter a valid email address&#8221;) return false } if (str.indexOf(dot)==-1 &#124;&#124; str.indexOf(dot)==0 &#124;&#124; str.indexOf(dot)==lstr){ alert(&#8220;Please enter a valid email address&#8221;) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=akbbhatt.wordpress.com&amp;blog=5096992&amp;post=67&amp;subd=akbbhatt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Use the following code<br />
<span id="more-67"></span><br />
function EmailIdCheck(str) {</p>
<p>		var at=&#8221;@&#8221;<br />
		var dot=&#8221;.&#8221;<br />
		var lat=str.indexOf(at)<br />
		var lstr=str.length<br />
		var ldot=str.indexOf(dot)<br />
		if (str.indexOf(at)==-1){<br />
		   alert(&#8220;Please enter a valid email address&#8221;)<br />
		   return false<br />
		}</p>
<p>		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){<br />
		    alert(&#8220;Please enter a valid email address&#8221;)<br />
		   return false<br />
		}</p>
<p>		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){<br />
		    alert(&#8220;Please enter a valid email address&#8221;)<br />
		    return false<br />
		}</p>
<p>		 if (str.indexOf(at,(lat+1))!=-1){<br />
		     alert(&#8220;Please enter a valid email address&#8221;)<br />
		    return false<br />
		 }</p>
<p>		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){<br />
		     alert(&#8220;Please enter a valid email address&#8221;)<br />
		    return false<br />
		 }</p>
<p>		 if (str.indexOf(dot,(lat+2))==-1){<br />
		     alert(&#8220;Please enter a valid email address&#8221;)<br />
		    return false<br />
		 }</p>
<p>		 if (str.indexOf(&#8221; &#8220;)!=-1){<br />
		     alert(&#8220;Please enter a valid email address&#8221;)<br />
		    return false<br />
		 }</p>
<p> 		 return true<br />
	}</p>
<p>	function ValidateForm() {<br />
	    var emailID = document.getElementById(&#8220;TextBox1&#8243;).value</p>
<p>	if ((emailID == null)||(emailID == &#8220;&#8221;)){<br />
		alert(&#8220;Please Enter your Email ID&#8221;)<br />
		emailID.focus()<br />
		return false<br />
	}<br />
	if (EmailIdCheck(emailID) == false) {<br />
		emailID=&#8221;"<br />
		document.getElementById(&#8220;TextBox1&#8243;).focus()<br />
		return false<br />
	}<br />
	return true<br />
 }</p>
<p>In HTML body tag call this function</p>
<p>Button ID=&#8221;Button1&#8243; runat=&#8221;server&#8221; Text=&#8221;Button&#8221; OnClientClick=&#8221;return ValidateForm()&#8221; </p>
<p>Thanks,<br />
Anil.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/akbbhatt.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/akbbhatt.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/akbbhatt.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/akbbhatt.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/akbbhatt.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/akbbhatt.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/akbbhatt.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/akbbhatt.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/akbbhatt.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/akbbhatt.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/akbbhatt.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/akbbhatt.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/akbbhatt.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/akbbhatt.wordpress.com/67/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=akbbhatt.wordpress.com&amp;blog=5096992&amp;post=67&amp;subd=akbbhatt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://akbbhatt.wordpress.com/2009/01/22/javascript-email-address-field-validation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/52345925bc35743f8a8e08d590b1b21d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akbbhatt</media:title>
		</media:content>
	</item>
		<item>
		<title>Javascript: Numerical Only</title>
		<link>http://akbbhatt.wordpress.com/2009/01/22/javascript-numerical-only/</link>
		<comments>http://akbbhatt.wordpress.com/2009/01/22/javascript-numerical-only/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 09:41:32 +0000</pubDate>
		<dc:creator>akbbhatt</dc:creator>
				<category><![CDATA[1]]></category>

		<guid isPermaLink="false">http://akbbhatt.wordpress.com/?p=60</guid>
		<description><![CDATA[Use this javascript function to check whether the textbox value is numerical or not function NumericalOnly() { var numericalOnly = new RegExp(&#8220;^[0-9]*$&#8221;) var textbox = document.getElementById(&#8220;TextBox1&#8243;).value; if (!numericalOnly.test(textbox)) { alert(&#8220;Please enter a valid number!&#8221;) } } Thanks, Anil.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=akbbhatt.wordpress.com&amp;blog=5096992&amp;post=60&amp;subd=akbbhatt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>    Use this javascript function to check whether the textbox value is numerical or not</p>
<p>function NumericalOnly() {<br />
        var numericalOnly = new RegExp(&#8220;^[0-9]*$&#8221;)<br />
        var textbox = document.getElementById(&#8220;TextBox1&#8243;).value;<br />
        if (!numericalOnly.test(textbox)) {<br />
            alert(&#8220;Please enter a valid number!&#8221;)<br />
        }<br />
    }</p>
<p>Thanks,<br />
Anil.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/akbbhatt.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/akbbhatt.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/akbbhatt.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/akbbhatt.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/akbbhatt.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/akbbhatt.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/akbbhatt.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/akbbhatt.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/akbbhatt.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/akbbhatt.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/akbbhatt.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/akbbhatt.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/akbbhatt.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/akbbhatt.wordpress.com/60/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=akbbhatt.wordpress.com&amp;blog=5096992&amp;post=60&amp;subd=akbbhatt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://akbbhatt.wordpress.com/2009/01/22/javascript-numerical-only/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/52345925bc35743f8a8e08d590b1b21d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akbbhatt</media:title>
		</media:content>
	</item>
		<item>
		<title>Javascript: Validate Date</title>
		<link>http://akbbhatt.wordpress.com/2009/01/22/javascript-validate-date/</link>
		<comments>http://akbbhatt.wordpress.com/2009/01/22/javascript-validate-date/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 09:00:08 +0000</pubDate>
		<dc:creator>akbbhatt</dc:creator>
				<category><![CDATA[1]]></category>
		<category><![CDATA[Validate Date]]></category>

		<guid isPermaLink="false">http://akbbhatt.wordpress.com/?p=54</guid>
		<description><![CDATA[Put this code in the script tag under head tag. var dtCh= &#8220;/&#8221;; var minYear=1900; var maxYear=2100; function isInteger(s){ var i; for (i = 0; i &#60; s.length; i++){ // Check that current character is number. var c = s.charAt(i); if (((c &#8220;9&#8243;))) return false; } // All characters are numbers. return true; } function [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=akbbhatt.wordpress.com&amp;blog=5096992&amp;post=54&amp;subd=akbbhatt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Put this code in the script tag under head tag.<br />
<span id="more-54"></span><br />
var dtCh= &#8220;/&#8221;;<br />
var minYear=1900;<br />
var maxYear=2100;</p>
<p>function isInteger(s){<br />
	var i;<br />
    for (i = 0; i &lt; s.length; i++){<br />
        // Check that current character is number.<br />
        var c = s.charAt(i);<br />
        if (((c  &#8220;9&#8243;))) return false;<br />
    }<br />
    // All characters are numbers.<br />
    return true;<br />
}</p>
<p>function stripCharsInBag(s, bag){<br />
	var i;<br />
    var returnString = &#8220;&#8221;;<br />
    // Search through string&#8217;s characters one by one.<br />
    // If character is not in bag, append to returnString.<br />
    for (i = 0; i &lt; s.length; i++){<br />
        var c = s.charAt(i);<br />
        if (bag.indexOf(c) == -1) returnString += c;<br />
    }<br />
    return returnString;<br />
}</p>
<p>function daysInFebruary (year){<br />
	// February has 29 days in any year evenly divisible by four,<br />
    // EXCEPT for centurial years which are not also divisible by 400.<br />
    return (((year % 4 == 0) &amp;&amp; ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );<br />
}<br />
function DaysArray(n) {<br />
	for (var i = 1; i 1) strDay=strDay.substring(1)<br />
	if (strMonth.charAt(0)==&#8221;0&#8243; &amp;&amp; strMonth.length&gt;1) strMonth=strMonth.substring(1)<br />
	for (var i = 1; i 1) strYr=strYr.substring(1)<br />
	}<br />
	month=parseInt(strMonth)<br />
	day=parseInt(strDay)<br />
	year=parseInt(strYr)<br />
	if (pos1==-1 || pos2==-1){<br />
		alert(&#8220;The date format should be : mm/dd/yyyy&#8221;)<br />
		return false<br />
	}<br />
	if (strMonth.length&lt;1 || month12){<br />
		alert(&#8220;Please enter a valid month&#8221;)<br />
		return false<br />
	}<br />
	if (strDay.length&lt;1 || day31 || (month==2 &amp;&amp; day&gt;daysInFebruary(year)) || day &gt; daysInMonth[month]){<br />
		alert(&#8220;Please enter a valid day&#8221;)<br />
		return false<br />
	}<br />
	if (strYear.length != 4 || year==0 || yearmaxYear){<br />
		alert(&#8220;Please enter a valid 4 digit year between &#8220;+minYear+&#8221; and &#8220;+maxYear)<br />
		return false<br />
	}<br />
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){<br />
		alert(&#8220;Please enter a valid date&#8221;)<br />
		return false<br />
	}<br />
return true<br />
}</p>
<p>function ValidateForm()<br />
{<br />
    //Give your textbox name here<br />
    var dt = document.getElementById(&#8220;TextBoxName&#8221;).value;<br />
	if (isDate(dt)==false){<br />
	    document.getElementById(&#8220;txtDate&#8221;).focus()<br />
		return false<br />
	}<br />
    return true<br />
 }</p>
<p>From the html body part call the javascript function ValidateForm()</p>
<p><strong>form name=&#8221;frmSample&#8221; method=&#8221;post&#8221; action=&#8221;" onSubmit=&#8221;return ValidateForm()&#8221;</strong></p>
<p>Thanks,<br />
Anil.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/akbbhatt.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/akbbhatt.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/akbbhatt.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/akbbhatt.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/akbbhatt.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/akbbhatt.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/akbbhatt.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/akbbhatt.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/akbbhatt.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/akbbhatt.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/akbbhatt.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/akbbhatt.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/akbbhatt.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/akbbhatt.wordpress.com/54/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=akbbhatt.wordpress.com&amp;blog=5096992&amp;post=54&amp;subd=akbbhatt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://akbbhatt.wordpress.com/2009/01/22/javascript-validate-date/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/52345925bc35743f8a8e08d590b1b21d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akbbhatt</media:title>
		</media:content>
	</item>
		<item>
		<title>Javascript: Remove WhiteSpace</title>
		<link>http://akbbhatt.wordpress.com/2009/01/22/javascript-remove-whitespace/</link>
		<comments>http://akbbhatt.wordpress.com/2009/01/22/javascript-remove-whitespace/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 07:50:30 +0000</pubDate>
		<dc:creator>akbbhatt</dc:creator>
				<category><![CDATA[1]]></category>

		<guid isPermaLink="false">http://akbbhatt.wordpress.com/?p=40</guid>
		<description><![CDATA[function RemoveWhiteSpace() { var str = document.getElementById(&#8216;TextBox1&#8242;).value; str = str.replace(/^\s*(.*?)\s*$/, &#8216;$1&#8242;) if (str == &#8220;&#8221;) { alert(&#8220;Textbox value is empty.Please enter a valid username&#8221;); return 0; } else { return 1; } } from HTML body call this javascript function like this. Button ID=&#8221;Button1&#8243; runat=&#8221;server&#8221; OnClientClick=&#8221;return RemoveWhiteSpace()==1&#8243; Text=&#8221;Button&#8221; Thanks, Anil.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=akbbhatt.wordpress.com&amp;blog=5096992&amp;post=40&amp;subd=akbbhatt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>      <span id="more-40"></span>  function RemoveWhiteSpace()<br />
        {<br />
            var str = document.getElementById(&#8216;TextBox1&#8242;).value;<br />
            str =  str.replace(/^\s*(.*?)\s*$/, &#8216;$1&#8242;)<br />
            if (str == &#8220;&#8221;) {<br />
                alert(&#8220;Textbox value is empty.Please enter a valid username&#8221;);<br />
                return 0;<br />
            }<br />
            else {<br />
                return 1;<br />
            }<br />
        }</p>
<p>from HTML body call this javascript function like this.</p>
<p>Button ID=&#8221;Button1&#8243; runat=&#8221;server&#8221;<strong> OnClientClick=&#8221;return RemoveWhiteSpace()==1&#8243;</strong> Text=&#8221;Button&#8221;</p>
<p>Thanks,<br />
Anil.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/akbbhatt.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/akbbhatt.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/akbbhatt.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/akbbhatt.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/akbbhatt.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/akbbhatt.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/akbbhatt.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/akbbhatt.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/akbbhatt.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/akbbhatt.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/akbbhatt.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/akbbhatt.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/akbbhatt.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/akbbhatt.wordpress.com/40/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=akbbhatt.wordpress.com&amp;blog=5096992&amp;post=40&amp;subd=akbbhatt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://akbbhatt.wordpress.com/2009/01/22/javascript-remove-whitespace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/52345925bc35743f8a8e08d590b1b21d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akbbhatt</media:title>
		</media:content>
	</item>
		<item>
		<title>Wallpaper Changer</title>
		<link>http://akbbhatt.wordpress.com/2009/01/14/wallpaper-changer/</link>
		<comments>http://akbbhatt.wordpress.com/2009/01/14/wallpaper-changer/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 09:25:23 +0000</pubDate>
		<dc:creator>akbbhatt</dc:creator>
				<category><![CDATA[1]]></category>
		<category><![CDATA[change background]]></category>
		<category><![CDATA[desktop background]]></category>
		<category><![CDATA[desktop background changer]]></category>
		<category><![CDATA[Wallpaper Changer]]></category>

		<guid isPermaLink="false">http://akbbhatt.wordpress.com/?p=31</guid>
		<description><![CDATA[You can use the following code to change the desktop wallpaper programmatically. If you want the whole project, then you can download it from this link- http://www.myotherdrive.com/dyn/pv/622.570005.14012009.91125.6a64fi/WallpaperChanger.rar?sort=0 public partial class Form1 : Form { private string path; public Form1() { Hide(); InitializeComponent(); } [DllImport("user32.dll", CharSet = CharSet.Auto)] private static extern Int32 SystemParametersInfo ( UInt32 action, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=akbbhatt.wordpress.com&amp;blog=5096992&amp;post=31&amp;subd=akbbhatt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>You can use the following code to change the desktop wallpaper programmatically. If you want the whole project, then you can download it from this link-<br />
<span id="more-31"></span><br />
<a href="http://www.myotherdrive.com/dyn/pv/622.570005.14012009.91125.6a64fi/WallpaperChanger.rar?sort=0" target="_blank">http://www.myotherdrive.com/dyn/pv/622.570005.14012009.91125.6a64fi/WallpaperChanger.rar?sort=0</a></p>
<p>public partial class Form1 : Form<br />
{<br />
private string path;<br />
public Form1()<br />
{<br />
Hide();<br />
InitializeComponent();</p>
<p>}</p>
<p>[DllImport("user32.dll", CharSet = CharSet.Auto)]<br />
private static extern Int32 SystemParametersInfo<br />
(<br />
UInt32 action, UInt32 uParam, String vParam, UInt32 winIni<br />
);</p>
<p>const int SPI_SETDESKWALLPAPER = 20;<br />
const int SPIF_UPDATEINIFILE = 0&#215;01;<br />
const int SPIF_SENDWININICHANGE = 0&#215;02;</p>
<p><!--more--><br />
/// &lt;summary&gt;<br />
/// Form load event<br />
/// &lt;/summary&gt;<br />
/// &lt;param name=&#8221;sender&#8221;&gt;&lt;/param&gt;<br />
/// &lt;param name=&#8221;e&#8221;&gt;&lt;/param&gt;<br />
private void Form1_Load(object sender, EventArgs e)<br />
{<br />
this.WindowState = FormWindowState.Minimized;<br />
this.Visible = false;<br />
SetRandomImage();<br />
timer1.Interval = 300 * 1000;<br />
timer1.Start();<br />
}</p>
<p>/// &lt;summary&gt;<br />
/// Method to pick a image randomly from MyPictures<br />
/// &lt;/summary&gt;<br />
private void SetRandomImage()<br />
{<br />
path = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);<br />
DirectoryInfo di = new DirectoryInfo(path);// + &#8220;\\&#8221; + &#8220;Auto Wallpaper&#8221;);<br />
FileInfo[] rgFiles = di.GetFiles(&#8220;*.jpg&#8221;);<br />
if (rgFiles.Length &lt; 1)<br />
{<br />
MessageBox.Show(&#8220;No image files in this directory&#8221;);<br />
Close();<br />
}<br />
Random rdImg = new Random();<br />
int imgId = rdImg.Next(rgFiles.Length);<br />
string strImgPath = ConvertImageToBmp(path + &#8220;\\&#8221; + rgFiles.GetValue(imgId));<br />
SetWallpaper(strImgPath);<br />
}</p>
<p>/// &lt;summary&gt;<br />
/// Convert any other image extension to bmp and save it in temp foldere<br />
/// &lt;/summary&gt;<br />
/// &lt;param name=&#8221;strPath&#8221;&gt;The path from which image is selected&lt;/param&gt;<br />
/// &lt;returns&gt;returns the new path of image in temp folder&lt;/returns&gt;<br />
private string ConvertImageToBmp(string strPath)<br />
{<br />
System.IO.Stream s = new System.Net.WebClient().OpenRead(strPath);<br />
System.Drawing.Image img = System.Drawing.Image.FromStream(s);<br />
string tempPath = Path.Combine(Path.GetTempPath(), &#8220;wallpaper.bmp&#8221;);<br />
img.Save(tempPath, System.Drawing.Imaging.ImageFormat.Bmp);<br />
return tempPath;<br />
}</p>
<p>/// &lt;summary&gt;<br />
/// Method to set the wallpaper<br />
/// &lt;/summary&gt;<br />
/// &lt;param name=&#8221;path&#8221;&gt;The image location&lt;/param&gt;<br />
public void SetWallpaper(String path)<br />
{<br />
try<br />
{<br />
Form1.SystemParametersInfo(SPI_SETDESKWALLPAPER,<br />
0,<br />
path,<br />
SPIF_UPDATEINIFILE | SPIF_SENDWININICHANGE);<br />
}</p>
<p>catch(Exception ex)<br />
{<br />
MessageBox.Show(ex.Message);<br />
}<br />
}</p>
<p>/// &lt;summary&gt;<br />
/// Timer Tick event<br />
/// &lt;/summary&gt;<br />
/// &lt;param name=&#8221;sender&#8221;&gt;&lt;/param&gt;<br />
/// &lt;param name=&#8221;e&#8221;&gt;&lt;/param&gt;<br />
private void timer1_Tick(object sender, EventArgs e)<br />
{<br />
SetRandomImage();<br />
}</p>
<p>/// &lt;summary&gt;<br />
/// Exit the application on selection of close from the system tray icon menu<br />
/// &lt;/summary&gt;<br />
/// &lt;param name=&#8221;sender&#8221;&gt;&lt;/param&gt;<br />
/// &lt;param name=&#8221;e&#8221;&gt;&lt;/param&gt;<br />
private void exitToolStripMenuItem_Click(object sender, EventArgs e)<br />
{<br />
timer1.Stop();<br />
Close();<br />
}</p>
<p>/// &lt;summary&gt;<br />
/// To display About The Product form from Tray bar icon<br />
/// &lt;/summary&gt;<br />
/// &lt;param name=&#8221;sender&#8221;&gt;&lt;/param&gt;<br />
/// &lt;param name=&#8221;e&#8221;&gt;&lt;/param&gt;<br />
private void aToolStripMenuItem_Click(object sender, EventArgs e)<br />
{<br />
MessageBox.Show(&#8220;Wallpaper Changer. Copyright protected.&#8221;);<br />
}</p>
<p>}</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/akbbhatt.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/akbbhatt.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/akbbhatt.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/akbbhatt.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/akbbhatt.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/akbbhatt.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/akbbhatt.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/akbbhatt.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/akbbhatt.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/akbbhatt.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/akbbhatt.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/akbbhatt.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/akbbhatt.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/akbbhatt.wordpress.com/31/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=akbbhatt.wordpress.com&amp;blog=5096992&amp;post=31&amp;subd=akbbhatt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://akbbhatt.wordpress.com/2009/01/14/wallpaper-changer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/52345925bc35743f8a8e08d590b1b21d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akbbhatt</media:title>
		</media:content>
	</item>
		<item>
		<title>Get list of folders inside a sharepoint document library</title>
		<link>http://akbbhatt.wordpress.com/2008/12/11/get-list-of-folders-inside-a-sharepoint-document-library/</link>
		<comments>http://akbbhatt.wordpress.com/2008/12/11/get-list-of-folders-inside-a-sharepoint-document-library/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 09:34:30 +0000</pubDate>
		<dc:creator>akbbhatt</dc:creator>
				<category><![CDATA[1]]></category>
		<category><![CDATA[folder list in sharepoint]]></category>
		<category><![CDATA[list documents method]]></category>
		<category><![CDATA[list+documents]]></category>

		<guid isPermaLink="false">http://akbbhatt.wordpress.com/2008/12/11/get-list-of-folders-inside-a-sharepoint-document-library/</guid>
		<description><![CDATA[After doing a long search in net, I found a method to get the folder lists inside a document library. It cannot be achieved using a windows sharepoint webservice instead we should use frontpage RPC methods. List documents is one such method that will return the list of folders and documents inside a document library. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=akbbhatt.wordpress.com&amp;blog=5096992&amp;post=18&amp;subd=akbbhatt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>After doing a long search in net, I found a method to get the folder lists inside a document library. It cannot be achieved using a windows sharepoint webservice instead we should use frontpage RPC methods. List documents is one such method that will return the list of folders and documents inside a document library. But the return value will be in the HTML format. So i filtered only the folder names from it. Below i am giving the code snippet. This might be useful for you folks.<span id="more-18"></span></p>
<p>///<br />
/// Gets the list of folders inside the given document library<br />
///<br />
/// Repository configuration parameter values.<br />
/// Document library from which to get the folders list<br />
/// returns the folders list<br />
private ArrayList GetSharePointFolderList(string strRepositoryParamsXml, string selectedDocumentLibrary,string folderPath)<br />
{<br />
ArrayList foldersList = new ArrayList();<br />
string strReplace = string.Empty;<br />
string orgDocLibName = selectedDocumentLibrary;<br />
string[] invalidChars = { &#8220;-&#8221;, &#8220;,&#8221;, &#8220;.&#8221;, &#8220;(&#8220;, &#8220;)&#8221; };<br />
if (selectedDocumentLibrary.Length &gt; 50)<br />
{<br />
selectedDocumentLibrary = selectedDocumentLibrary.Substring(0, 50);<br />
selectedDocumentLibrary = selectedDocumentLibrary.Trim();<br />
}<br />
foreach (string invalidChar in invalidChars)<br />
{<br />
selectedDocumentLibrary = selectedDocumentLibrary.Replace(invalidChar, strReplace);<br />
}<br />
SharePointConnection shConn = new SharePointConnection(strRepositoryParamsXml, &#8220;&#8221;);<br />
FrontPageRPCPublish fpRpcPublish = new FrontPageRPCPublish();<br />
fpRpcPublish.AuthenticationType = shConn.AuthenticationType;<br />
fpRpcPublish.Credentials = shConn.Credentials;<br />
string resultList = fpRpcPublish.GetFolderList(selectedDocumentLibrary, shConn.Server);<br />
foldersList = FormatRepositoryFolderList(resultList, orgDocLibName, folderPath);<br />
return foldersList;<br />
}</p>
<p>///<br />
/// Gets the list of folders inside the given document library<br />
///<br />
/// Document library from which to get the folders list<br />
/// sharepoint server url<br />
/// folder list in html format<br />
public string GetFolderList(string DocumentLibrary, string serverUrl)<br />
{<br />
string intUrl = DocumentLibrary;<br />
string postBody = String.Format(<br />
&#8220;method=list+documents:6.0.n.nnnn&amp;service_name=/&amp;listHiddenDocs=false&amp;listExplorerDocs=false&amp;listRecurse=true&amp;listFiles=false&amp;listFolders=true&amp;listLinkInfo=true&amp;listIncludeParent=true&amp;listDerived=false&amp;listBorders=false&amp;listChildWebs=false&amp;initialUrl={0}&#8221;,<br />
intUrl);<br />
string responseText = SendRequest(serverUrl + FrontPageRPCAuthorDLL, postBody);<br />
return responseText;<br />
}</p>
<p>///<br />
/// creates the array of folder list from the html list.<br />
///<br />
/// html list of folder names and meta info<br />
/// Document library from which to retrive the folder list<br />
/// folder list array<br />
private ArrayList FormatRepositoryFolderList(string resultList, string selectedDocumentLibrary, string folderPath)<br />
{<br />
int ind = resultList.IndexOf(&#8220;urldirs&#8221;);<br />
int startIndex = 0;<br />
int endIndex = 0;<br />
string docLib = string.Empty;<br />
ArrayList folders = new ArrayList();<br />
if (ind &gt; 0)<br />
{<br />
string resultFiltered = resultList.Substring(ind);</p>
<p>if (resultFiltered.Length &gt; 0)<br />
{<br />
do<br />
{<br />
startIndex = resultFiltered.IndexOf(&#8220;url=&#8221;, endIndex) + 4;<br />
endIndex = resultFiltered.IndexOf(&#8221; 50)<br />
{<br />
folder = folder.Replace(docLib, selectedDocumentLibrary);<br />
}<br />
if (!folder.Contains(&#8220;Forms&#8221;))<br />
{<br />
folder = folder.Replace(&#8220;/&#8221;, &#8220;\\&#8221;);<br />
folders.Add(folder);<br />
}<br />
} while (startIndex != resultFiltered.LastIndexOf(&#8220;url=&#8221;) + 4);</p>
<p>}<br />
}</p>
<p>return folders;<br />
}</p>
<p>you can do the samething using one sitedata.asmx web service method called EnumerateFolde(). But it wont return the child folders of a folder inside doc lib. You may have to loop and call the methods several times.</p>
<p><span style="color:#2b91af;font-size:x-small;"><span style="color:#2b91af;font-size:x-small;">SharePointConnection </span></span><span style="font-size:x-small;"> shConn = </span><span style="font-size:x-small;color:#0000ff;">new</span><span style="font-size:x-small;"> </span><span style="font-size:x-small;color:#2b91af;">SharePointConnection</span><span style="font-size:x-small;">(strRepositoryParamsXml, </span><span style="font-size:x-small;color:#a31515;">&#8220;&#8221;</span><span style="font-size:x-small;">);</span></p>
<p><span style="font-size:x-small;"><span style="font-size:x-small;">SiteDataWS.</span></span><span style="font-size:x-small;color:#2b91af;">SiteData</span><span style="font-size:x-small;"> srvSiteData = </span><span style="font-size:x-small;color:#0000ff;">new</span><span style="font-size:x-small;"> SiteDataWS.</span><span style="font-size:x-small;color:#2b91af;">SiteData</span> <span style="font-size:x-small;">();</span></p>
<div><span style="font-size:x-small;"><span style="font-size:x-small;">srvSiteData.Url = shConn.Server +</span></span><span style="font-size:x-small;color:#a31515;">&#8220;/_vti_bin/sitedata.asmx&#8221;</span> <span style="font-size:x-small;">;</span></div>
<div><span style="font-size:x-small;">srvSiteData.Credentials = shConn.Credentials;</span></div>
<div><span style="font-size:x-small;color:#2b91af;">_sFPUrl</span> <span style="font-size:x-small;">[] enArray;</span></div>
<p><span style="font-size:x-small;">SiteDataWS.<span style="font-size:x-small;">srvSiteData.EnumerateFolder(&#8220;</span></span><span style="font-size:x-small;color:#a31515;">Document Library&#8221;</span><span style="font-size:x-small;">, </span><span style="font-size:x-small;color:#0000ff;">out</span><span style="font-size:x-small;"> enArray);</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/akbbhatt.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/akbbhatt.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/akbbhatt.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/akbbhatt.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/akbbhatt.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/akbbhatt.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/akbbhatt.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/akbbhatt.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/akbbhatt.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/akbbhatt.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/akbbhatt.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/akbbhatt.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/akbbhatt.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/akbbhatt.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=akbbhatt.wordpress.com&amp;blog=5096992&amp;post=18&amp;subd=akbbhatt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://akbbhatt.wordpress.com/2008/12/11/get-list-of-folders-inside-a-sharepoint-document-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/52345925bc35743f8a8e08d590b1b21d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">akbbhatt</media:title>
		</media:content>
	</item>
	</channel>
</rss>
