<?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>asp.net tricks</title>
	<atom:link href="http://umeshchand.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://umeshchand.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Wed, 26 Jan 2011 17:03:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='umeshchand.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>asp.net tricks</title>
		<link>http://umeshchand.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://umeshchand.wordpress.com/osd.xml" title="asp.net tricks" />
	<atom:link rel='hub' href='http://umeshchand.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Override form action attribute in asp.net</title>
		<link>http://umeshchand.wordpress.com/2011/01/26/override-form-action-attribute-in-asp-net/</link>
		<comments>http://umeshchand.wordpress.com/2011/01/26/override-form-action-attribute-in-asp-net/#comments</comments>
		<pubDate>Wed, 26 Jan 2011 17:03:41 +0000</pubDate>
		<dc:creator>cooolguymca</dc:creator>
		
		<guid isPermaLink="false">http://umeshchand.wordpress.com/?p=31</guid>
		<description><![CDATA[In asp.net we can&#8217;t change form&#8217;s action attribute in html markup by simply putting the page name . By default it takes default.aspx as form&#8217;s action. If you are using IIS 7 url rewriting module and want to solve canonical issue then IIS7 default behaviour creates problem such as when you type url like http://www.abc.com/ [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=umeshchand.wordpress.com&amp;blog=9324327&amp;post=31&amp;subd=umeshchand&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In asp.net we can&#8217;t change form&#8217;s action attribute in html markup by simply putting the page name . By default it takes default.aspx as form&#8217;s action. If you are using IIS 7 url rewriting module and want to solve canonical issue then IIS7 default behaviour creates problem such as when you type url like <strong><em>http://www.abc.com/</em></strong> and click home link in website then it displays url as <em><strong>http://www.abc.com/default.aspx</strong></em> and this will create problem for google to rank your website.</p>
<p>To solve this problem you have to override FORM action attribute.</p>
<p><em>reference from code project for code</em></p>
<p>Just create a class in the <em>app_code</em> folder, and copy and paste the following lines:</p>
<pre>using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Text.RegularExpressions;

public class cdsnetFormActionModifier : Stream
{
    private Stream _sink;
    private long _position;
    string _url;
    public cdsnetFormActionModifier(Stream sink, string url)
    {
        _sink = sink;
        _url = "$1" + url + "$3";
    }

    public override bool CanRead
    {
        get { return true; }
    }

    public override bool CanSeek
    {
        get { return true; }
    }

    public override bool CanWrite
    {
        get { return true; }
    }

    public override long Length
    {
        get { return 0; }
    }

    public override long Position
    {
        get { return _position; }
        set { _position = value; }
    }

    public override long Seek(long offset, System.IO.SeekOrigin direction)
    {
        return _sink.Seek(offset, direction);
    }

    public override void SetLength(long length)
    {
        _sink.SetLength(length);
    }

    public override void Close()
    {
        _sink.Close();
    }

    public override void Flush()
    {
        _sink.Flush();
    }

    public override int Read(byte[] buffer, int offset, int count)
    {
        return _sink.Read(buffer, offset, count);
    }

    public override void Write(byte[] buffer, int offset, int count)
    {
        string s = System.Text.UTF8Encoding.UTF8.GetString(buffer, offset, count);
        Regex reg = new Regex("(&lt;form.*action=\")([^\"]*)" +
                              "(\"[^&gt;]*&gt;)", RegexOptions.IgnoreCase);
        Match m = reg.Match(s);
        if (m.Success)
        {
            string form = reg.Replace(m.Value, _url);
            int iform = m.Index;
            int lform = m.Length;
            s = s.Substring(0, iform) + form + s.Substring(iform + lform);
        }
        byte[] yaz = System.Text.UTF8Encoding.UTF8.GetBytes(s);
        _sink.Write(yaz, 0, yaz.Length);
    }
}

after creating this class use its method to override in your pageload event of Default.aspx
<pre>protected void Page_Load(object sender, EventArgs e)
{
    this.Response.Filter =
      new cdsnetFormActionModifier(this.Response.Filter, "your_url");
}</pre>
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/umeshchand.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/umeshchand.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/umeshchand.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/umeshchand.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/umeshchand.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/umeshchand.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/umeshchand.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/umeshchand.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/umeshchand.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/umeshchand.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/umeshchand.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/umeshchand.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/umeshchand.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/umeshchand.wordpress.com/31/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=umeshchand.wordpress.com&amp;blog=9324327&amp;post=31&amp;subd=umeshchand&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://umeshchand.wordpress.com/2011/01/26/override-form-action-attribute-in-asp-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6e589b3cda5d633aece413e84f70d54b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">cooolguymca</media:title>
		</media:content>
	</item>
		<item>
		<title>Convert first letter of string capital</title>
		<link>http://umeshchand.wordpress.com/2010/03/09/convert-first-letter-of-string-capital/</link>
		<comments>http://umeshchand.wordpress.com/2010/03/09/convert-first-letter-of-string-capital/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 16:31:08 +0000</pubDate>
		<dc:creator>cooolguymca</dc:creator>
				<category><![CDATA[1]]></category>

		<guid isPermaLink="false">http://umeshchand.wordpress.com/?p=29</guid>
		<description><![CDATA[public string CapitalIntials(string name) { return new CultureInfo(&#8220;en&#8221;).TextInfo.ToTitleCase(name.ToLower()); }<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=umeshchand.wordpress.com&amp;blog=9324327&amp;post=29&amp;subd=umeshchand&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>public string CapitalIntials(string name)<br />
{<br />
return new CultureInfo(&#8220;en&#8221;).TextInfo.ToTitleCase(name.ToLower());<br />
}</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/umeshchand.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/umeshchand.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/umeshchand.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/umeshchand.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/umeshchand.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/umeshchand.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/umeshchand.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/umeshchand.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/umeshchand.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/umeshchand.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/umeshchand.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/umeshchand.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/umeshchand.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/umeshchand.wordpress.com/29/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=umeshchand.wordpress.com&amp;blog=9324327&amp;post=29&amp;subd=umeshchand&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://umeshchand.wordpress.com/2010/03/09/convert-first-letter-of-string-capital/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6e589b3cda5d633aece413e84f70d54b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">cooolguymca</media:title>
		</media:content>
	</item>
		<item>
		<title>Checking javascript enable or not</title>
		<link>http://umeshchand.wordpress.com/2010/02/19/checking-javascript-enable-or-not/</link>
		<comments>http://umeshchand.wordpress.com/2010/02/19/checking-javascript-enable-or-not/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 12:29:34 +0000</pubDate>
		<dc:creator>cooolguymca</dc:creator>
				<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://umeshchand.wordpress.com/2010/02/19/checking-javascript-enable-or-not/</guid>
		<description><![CDATA[Using this markup you can check whether user&#8217;s browser has javascript enabled or not &#60;noscript&#62; &#60;meta http-equiv=&#8221;Refresh&#8221; content=&#8221;0; url=noJavascriptPage.html&#8221;&#62; &#60;/noscript&#62; If user has not enabled javasript , you can redirect him to other page<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=umeshchand.wordpress.com&amp;blog=9324327&amp;post=28&amp;subd=umeshchand&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Using this markup you can check whether user&#8217;s browser has javascript enabled or not</p>
<p><strong>&lt;noscript&gt;</strong></p>
<p><strong>&lt;meta http-equiv=&#8221;Refresh&#8221; content=&#8221;0; url=noJavascriptPage.html&#8221;&gt;</strong></p>
<p><strong>&lt;/noscript&gt;</strong></p>
<p>If user has not enabled javasript , you can redirect him to other page</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/umeshchand.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/umeshchand.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/umeshchand.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/umeshchand.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/umeshchand.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/umeshchand.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/umeshchand.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/umeshchand.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/umeshchand.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/umeshchand.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/umeshchand.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/umeshchand.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/umeshchand.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/umeshchand.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=umeshchand.wordpress.com&amp;blog=9324327&amp;post=28&amp;subd=umeshchand&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://umeshchand.wordpress.com/2010/02/19/checking-javascript-enable-or-not/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6e589b3cda5d633aece413e84f70d54b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">cooolguymca</media:title>
		</media:content>
	</item>
		<item>
		<title>Avoid submitting data on page refresh using asp.net C#</title>
		<link>http://umeshchand.wordpress.com/2010/02/19/avoid-submit-data-on-page-refresh-using-asp-net-c/</link>
		<comments>http://umeshchand.wordpress.com/2010/02/19/avoid-submit-data-on-page-refresh-using-asp-net-c/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 12:01:49 +0000</pubDate>
		<dc:creator>cooolguymca</dc:creator>
				<category><![CDATA[Web Development with ASP.NET]]></category>

		<guid isPermaLink="false">http://umeshchand.wordpress.com/2010/02/19/avoid-submit-data-on-page-refresh-using-asp-net-c/</guid>
		<description><![CDATA[Its very common problem every web developer has to face that is re-submitting data on page refresh (F5). You will find lots of solution whiling googling but some of them are very lengthy and some are very confusing. I found very easy and effective way of handling this problem. Using session[] and viewstate[] On page load take one session variable [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=umeshchand.wordpress.com&amp;blog=9324327&amp;post=23&amp;subd=umeshchand&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Its very common problem every web developer has to face that is re-submitting data on page refresh (F5).</p>
<p>You will find lots of solution whiling googling but some of them are very lengthy and some are very confusing. I found very easy and effective way of handling this problem.</p>
<p style="text-align:center;"><strong> </strong></p>
<p><strong> </strong></p>
<p><strong>Using session[] and viewstate[]</strong></p>
<p style="text-align:left;">On page load take one session variable and store system current date time<strong> </strong></p>
<p style="text-align:left;"><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<div id="_mcePaste"><span style="font-weight:normal;"><strong>
<div id="_mcePaste">if (!IsPostBack)</div>
<div id="_mcePaste">{</div>
<div id="_mcePaste">Session["Refresh"] = Server.UrlDecode(System.DateTime.Now.ToString());</div>
<div id="_mcePaste">}</div>
<div></div>
<div><span style="font-weight:normal;">On Button click event check whether session and viewstate are same value or not, If same then do your login</span></div>
<div><span style="font-weight:normal;"><br /></span></div>
<div><span style="font-weight:normal;">
<div><strong> if (Session["Refresh"].ToString() == ViewState["Refresh"].ToString())</strong></div>
<div><strong> {</strong></div>
<div><strong><br /></strong></div>
<div><strong> [  Do your coding  here ]</strong></div>
<div><strong><br /></strong></div>
<div><strong> Session["Refresh"] = Server.UrlDecode(System.DateTime.Now.ToString());</strong></div>
<div><strong> }</strong></div>
<div><strong>else </strong></div>
<div><strong>{</strong></div>
<div><strong> response.write(&#8220;You have refreshed the page&#8221;)</strong></div>
<div><strong>}</strong></div>
<div><strong><br /></strong></div>
<div>Write one Page pre render event to assing session value in viewstate  like this</div>
<div></div>
<div>
<div><strong> protected void Page_PreRender(object sender, EventArgs e)</strong></div>
<div><strong> {</strong></div>
<div><strong> ViewState["Refresh"] = Session["Refresh"];</strong></div>
<div><strong> }</strong></div>
<div><strong><br /></strong></div>
</div>
<div>Thats all&#8230;.happy coding</div>
<p> </p>
<p></span></div>
<p> </strong>
<p><strong> </strong></p>
<p> </p>
<p></span></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/umeshchand.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/umeshchand.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/umeshchand.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/umeshchand.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/umeshchand.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/umeshchand.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/umeshchand.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/umeshchand.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/umeshchand.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/umeshchand.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/umeshchand.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/umeshchand.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/umeshchand.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/umeshchand.wordpress.com/23/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=umeshchand.wordpress.com&amp;blog=9324327&amp;post=23&amp;subd=umeshchand&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://umeshchand.wordpress.com/2010/02/19/avoid-submit-data-on-page-refresh-using-asp-net-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6e589b3cda5d633aece413e84f70d54b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">cooolguymca</media:title>
		</media:content>
	</item>
		<item>
		<title>Run any file as EXE using command prompt</title>
		<link>http://umeshchand.wordpress.com/2010/02/12/run-any-file-as-exe-using-command-prompt/</link>
		<comments>http://umeshchand.wordpress.com/2010/02/12/run-any-file-as-exe-using-command-prompt/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 09:51:33 +0000</pubDate>
		<dc:creator>cooolguymca</dc:creator>
				<category><![CDATA[Web Development with ASP.NET]]></category>

		<guid isPermaLink="false">http://umeshchand.wordpress.com/2010/02/12/run-any-file-as-exe-using-command-prompt/</guid>
		<description><![CDATA[F:\image.jpg=exefile<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=umeshchand.wordpress.com&amp;blog=9324327&amp;post=16&amp;subd=umeshchand&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>F:\image.jpg=exefile</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/umeshchand.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/umeshchand.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/umeshchand.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/umeshchand.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/umeshchand.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/umeshchand.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/umeshchand.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/umeshchand.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/umeshchand.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/umeshchand.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/umeshchand.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/umeshchand.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/umeshchand.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/umeshchand.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=umeshchand.wordpress.com&amp;blog=9324327&amp;post=16&amp;subd=umeshchand&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://umeshchand.wordpress.com/2010/02/12/run-any-file-as-exe-using-command-prompt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6e589b3cda5d633aece413e84f70d54b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">cooolguymca</media:title>
		</media:content>
	</item>
		<item>
		<title>disable contextmenu</title>
		<link>http://umeshchand.wordpress.com/2009/12/09/disable-contextmenu/</link>
		<comments>http://umeshchand.wordpress.com/2009/12/09/disable-contextmenu/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 06:56:49 +0000</pubDate>
		<dc:creator>cooolguymca</dc:creator>
				<category><![CDATA[Web Development with ASP.NET]]></category>

		<guid isPermaLink="false">http://umeshchand.wordpress.com/2009/12/09/disable-contextmenu/</guid>
		<description><![CDATA[For disabling right click on image use this attribute in body tag &#60;body oncontextmenu=&#8221;return false&#8221;&#62;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=umeshchand.wordpress.com&amp;blog=9324327&amp;post=12&amp;subd=umeshchand&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>For disabling right click on image use this attribute in body tag</strong></p>
<p><em>&lt;body oncontextmenu=&#8221;return false&#8221;&gt;</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/umeshchand.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/umeshchand.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/umeshchand.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/umeshchand.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/umeshchand.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/umeshchand.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/umeshchand.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/umeshchand.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/umeshchand.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/umeshchand.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/umeshchand.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/umeshchand.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/umeshchand.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/umeshchand.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=umeshchand.wordpress.com&amp;blog=9324327&amp;post=12&amp;subd=umeshchand&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://umeshchand.wordpress.com/2009/12/09/disable-contextmenu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6e589b3cda5d633aece413e84f70d54b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">cooolguymca</media:title>
		</media:content>
	</item>
		<item>
		<title>disable image toolbar</title>
		<link>http://umeshchand.wordpress.com/2009/12/09/disable-image-toolbar/</link>
		<comments>http://umeshchand.wordpress.com/2009/12/09/disable-image-toolbar/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 06:55:51 +0000</pubDate>
		<dc:creator>cooolguymca</dc:creator>
				<category><![CDATA[Web Development with ASP.NET]]></category>

		<guid isPermaLink="false">http://umeshchand.wordpress.com/2009/12/09/disable-image-toolbar/</guid>
		<description><![CDATA[Use this markup to disable image toolbar for all the images in the page &#60;meta http-equiv=&#8221;imagetoolbar&#8221; content=&#8221;no&#8221; /&#62; For individual image use this markup &#60;img src=&#8221;image.jpg&#8221; gallerying=&#8221;no&#8221; /&#62;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=umeshchand.wordpress.com&amp;blog=9324327&amp;post=11&amp;subd=umeshchand&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Use this markup to disable image toolbar for all the images in the page</p>
<p><strong>&lt;meta http-equiv=&#8221;imagetoolbar&#8221; content=&#8221;no&#8221; /&gt;</strong></p>
<p>For individual image use this markup</p>
<p><strong>&lt;img src=&#8221;image.jpg&#8221; gallerying=&#8221;no&#8221; /&gt;</strong></p>
<p><strong><br /></strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/umeshchand.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/umeshchand.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/umeshchand.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/umeshchand.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/umeshchand.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/umeshchand.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/umeshchand.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/umeshchand.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/umeshchand.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/umeshchand.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/umeshchand.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/umeshchand.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/umeshchand.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/umeshchand.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=umeshchand.wordpress.com&amp;blog=9324327&amp;post=11&amp;subd=umeshchand&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://umeshchand.wordpress.com/2009/12/09/disable-image-toolbar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6e589b3cda5d633aece413e84f70d54b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">cooolguymca</media:title>
		</media:content>
	</item>
		<item>
		<title>Disable copying on page</title>
		<link>http://umeshchand.wordpress.com/2009/12/09/disable-copying-on-page/</link>
		<comments>http://umeshchand.wordpress.com/2009/12/09/disable-copying-on-page/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 06:50:36 +0000</pubDate>
		<dc:creator>cooolguymca</dc:creator>
				<category><![CDATA[Web Development with ASP.NET]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://umeshchand.wordpress.com/2009/12/09/disable-copying-on-page/</guid>
		<description><![CDATA[Use this attributes to disable copying from your page &#60;body ondragstart=&#8221;return false&#8221; onselectstart=&#8221;return false&#8221;&#62;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=umeshchand.wordpress.com&amp;blog=9324327&amp;post=10&amp;subd=umeshchand&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Use this attributes to disable copying from your page</strong></p>
<p><em>&lt;body ondragstart=&#8221;return false&#8221; onselectstart=&#8221;return false&#8221;&gt;</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/umeshchand.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/umeshchand.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/umeshchand.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/umeshchand.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/umeshchand.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/umeshchand.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/umeshchand.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/umeshchand.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/umeshchand.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/umeshchand.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/umeshchand.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/umeshchand.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/umeshchand.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/umeshchand.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=umeshchand.wordpress.com&amp;blog=9324327&amp;post=10&amp;subd=umeshchand&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://umeshchand.wordpress.com/2009/12/09/disable-copying-on-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6e589b3cda5d633aece413e84f70d54b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">cooolguymca</media:title>
		</media:content>
	</item>
		<item>
		<title>Alternatives of update panel</title>
		<link>http://umeshchand.wordpress.com/2009/09/04/alternatives-of-update-panel/</link>
		<comments>http://umeshchand.wordpress.com/2009/09/04/alternatives-of-update-panel/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 12:36:22 +0000</pubDate>
		<dc:creator>cooolguymca</dc:creator>
				<category><![CDATA[asp.net with ajax]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[page method]]></category>
		<category><![CDATA[update panel]]></category>
		<category><![CDATA[web service]]></category>

		<guid isPermaLink="false">http://umeshchand.wordpress.com/2009/09/04/alternatives-of-update-panel/</guid>
		<description><![CDATA[Update Panel slow down the speed and increase the page size.So think 100 times before using Update Panel There are two alternatives of Update Panel 1) Page Method. 2) Web Service. Here I am giving you the example of filling dropdownlist by the two methods one by one Filling Dropdownlist by Page Method 1)Page Method [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=umeshchand.wordpress.com&amp;blog=9324327&amp;post=3&amp;subd=umeshchand&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Update Panel slow down the speed and increase the page size.So think 100 times before using Update Panel</p>
<p>There are two alternatives of Update Panel</p>
<p>1) Page Method.</p>
<p>2) Web Service.</p>
<p>Here I am giving you the example of filling dropdownlist by the two methods one by one</p>
<p>Filling Dropdownlist by Page Method<br />
1)Page Method<br />
<strong>Remember Page Methods will not work in master page<strong></p>
<p>Put these 3 Javascript functions and scriptmanager on Page Source</p>
<p><em>//Function 1st fro calling pagemethod</em><br />
function getDegree()<br />
{<br />
      var makelist = document.getElementById(&#8221;);<br />
      var key = makelist.options[makelist.selectedIndex].text;<br />
      PageMethods.BindCollegeDegree(key,OnComplete,OnError);<br />
}</p>
<p>//Function 2nd for binding dropdown by spliting the values<br />
function OnComplete(result)<br />
{<br />
       var models = document.getElementById(&#8221;);<br />
       for (var count=models.options.length-1;count &gt; -1; count&#8211;)<br />
       {<br />
              models.options[count] = null;<br />
       }<br />
       var items = result.split(&#8216;|&#8217;);<br />
       var idValue;<br />
       var textValue;<br />
       var optionItem;<br />
       for(i = 0; i &lt; items.length;i++)<br />
       {<br />
             textValue = items[i];<br />
             idValue = items[i];<br />
             optionItem = new Option( textValue, idValue, false, false);<br />
             models.options[i] = optionItem;<br />
       }</p>
<p>}</p>
<p>function OnError(error)</p>
<p>{</p>
<p>alert(&#8220;Error Occured&#8221;);</p>
<p>}</p>
<p>You have to use ScriptManager<br />
In Code Behind OnPage_Load put this line to call javascript function</p>
<p>{</p>
<p>drp1st.Attributes.Add(&#8220;onchange&#8221;, &#8220;return getDegree();&#8221;);</p>
<p>}</p>
<p>Write this Method in your code behind.Replace sql query with yours</p>
<p>//Binding Dropdown by using Page Methods</p>
<p>[System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()]</p>
<p>public static string BindCollegeDegree(string degree)</p>
<p>{</p>
<p>string data = &#8220;&#8221;;</p>
<p>SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);</p>
<p>SqlCommand cmd = new SqlCommand(&#8220;SELECT StreamName,StreamID FROM College where DegreeId=@degree&#8221;, con);</p>
<p>cmd.Parameters.Add(&#8220;@degree&#8221;, SqlDbType.NChar).Value = degree.Trim();</p>
<p>con.Open();</p>
<p>try</p>
<p>{</p>
<p>SqlDataReader r = cmd.ExecuteReader();</p>
<p>while (r.Read())</p>
<p>{</p>
<p>data = data + r["StreamName"].ToString().Trim() + &#8220;|&#8221;;</p>
<p>}</p>
<p>int len = data.Length;</p>
<p>return data.Substring(0, len &#8211; 1);</p>
<p>}</p>
<p>catch (SqlException ex) { return null; }</p>
<p>finally { con.Close(); }</p>
<p>}</p>
<p>2) Web Services<br />
To use web service add asmx file.<br />
Here I have added WebService.asmx<br />
when press f7 on this page, WebService.cs page created, write your business login here</p>
<p>WebService.cs<br />
using System;<br />
using System.Web;<br />
using System.Collections;<br />
using System.Web.Services;<br />
using System.Web.Services.Protocols;<br />
using System.Web.Script.Services;<br />
using System.Data.SqlClient;<br />
using System.Configuration;</p>
<p>///<br />
/// Summary description for WebService<br />
///<br />
[WebService(Namespace = "http://microsoft.com/webservices/")]<br />
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]<br />
[ScriptService]<br />
public class WebService : System.Web.Services.WebService<br />
{</p>
<p>    public WebService()<br />
    {</p>
<p>        //Uncomment the following line if using designed components<br />
        //InitializeComponent();<br />
    }</p>
<p>    [WebMethod]<br />
    public string BindingSearchDropDown(string key)<br />
    {<br />
        string data = &#8220;&#8221;;<br />
        SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);<br />
        if (key == &#8220;College&#8221;)<br />
        {<br />
            SqlCommand cmd = new SqlCommand(&#8220;SELECT [CourseName], CourseTypeId FROM [College_CourseTypeMaster]&#8220;, con);<br />
            con.Open();<br />
            SqlDataReader r = cmd.ExecuteReader();<br />
            while (r.Read())<br />
            {<br />
                data = data + r["CourseName"].ToString().Trim() + &#8220;|&#8221;;<br />
            }<br />
            return data = data.Substring(0, data.Length &#8211; 1);<br />
        }<br />
return (&#8220;&#8221;);<br />
}<br />
}</p>
<p>Put these functions in markup</p>
<p>function getModels()<br />
{<br />
   var makelist =document.getElementById(&#8220;One&#8221;);<br />
   var key = makelist.options[makelist.selectedIndex].value;<br />
   WebService.BindingSearchDropDown(key,OnGetModelsComplete);</p>
<p>}</p>
<p>function OnGetModelsComplete(result)<br />
{<br />
    PopulateModels(result);<br />
}<br />
function PopulateModels(result)<br />
{<br />
    var models = document.getElementById(&#8220;Two&#8221;);<br />
    for (var count=models.options.length-1;count &gt; -1; count&#8211;)<br />
    {<br />
       models.options[count] = null;<br />
    }<br />
    var items = result.split(&#8216;|&#8217;);<br />
    var idValue;<br />
    var textValue;<br />
    var optionItem;<br />
    for(i = 0; i &lt; items.length;i++)<br />
    {<br />
        textValue = items[i];<br />
        idValue = items[i];<br />
        optionItem = new Option( textValue,idValue,  false, false);<br />
        models.options[i] = optionItem;</p>
<p>    }<br />
} </p>
<p>Add ScriptManager on this page</p>
<p>Thats all!<br />
Any query or help please feel free to mail me on this Id<br />
cooolguymca at the rate gmail.com</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/umeshchand.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/umeshchand.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/umeshchand.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/umeshchand.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/umeshchand.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/umeshchand.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/umeshchand.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/umeshchand.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/umeshchand.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/umeshchand.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/umeshchand.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/umeshchand.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/umeshchand.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/umeshchand.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=umeshchand.wordpress.com&amp;blog=9324327&amp;post=3&amp;subd=umeshchand&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://umeshchand.wordpress.com/2009/09/04/alternatives-of-update-panel/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6e589b3cda5d633aece413e84f70d54b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">cooolguymca</media:title>
		</media:content>
	</item>
	</channel>
</rss>
