<?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>Dhaval's Weblog</title>
	<atom:link href="http://dhavalshah.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://dhavalshah.wordpress.com</link>
	<description>Just another weblog</description>
	<lastBuildDate>Wed, 02 Feb 2011 03:39:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='dhavalshah.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Dhaval's Weblog</title>
		<link>http://dhavalshah.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://dhavalshah.wordpress.com/osd.xml" title="Dhaval&#039;s Weblog" />
	<atom:link rel='hub' href='http://dhavalshah.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Joins in LINQ to SQL</title>
		<link>http://dhavalshah.wordpress.com/2010/03/15/joins-in-linq-to-sql/</link>
		<comments>http://dhavalshah.wordpress.com/2010/03/15/joins-in-linq-to-sql/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 10:08:57 +0000</pubDate>
		<dc:creator>dhavalshah</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Dot Net]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[Microsoft Dot.Net]]></category>
		<category><![CDATA[VB.Net]]></category>

		<guid isPermaLink="false">http://dhavalshah.wordpress.com/2010/03/15/joins-in-linq-to-sql/</guid>
		<description><![CDATA[The following post shows how to write different types of joins in LINQ to SQL. I am using the Northwind database and LINQ to SQL for these examples. 1: NorthwindDataContext dataContext = new NorthwindDataContext(); INNER JOIN : 1: var q1 = from c in dataContext.Customers 2: join o in dataContext.Orders on c.CustomerID equals o.CustomerID 3: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dhavalshah.wordpress.com&amp;blog=3135787&amp;post=113&amp;subd=dhavalshah&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p align="justify">The following post shows how to write different types of joins in LINQ to SQL. I am using the Northwind database and LINQ to SQL for these examples.</p>
<div style="border-bottom:silver 1px solid;text-align:left;border-left:silver 1px solid;line-height:12pt;background-color:#f4f4f4;width:97.5%;font-family:&#39;direction:ltr;max-height:200px;font-size:8pt;overflow:auto;border-top:silver 1px solid;cursor:text;border-right:silver 1px solid;margin:20px 0 10px;padding:4px;" id="codeSnippetWrapper">
<div style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0;" id="codeSnippet">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum1">   1:</span> NorthwindDataContext dataContext = <span style="color:#0000ff;">new</span> NorthwindDataContext();</pre>
<p><!--CRLF--></div>
</div>
<p align="justify"><strong>INNER JOIN :</strong></p>
<div style="border-bottom:silver 1px solid;text-align:left;border-left:silver 1px solid;line-height:12pt;background-color:#f4f4f4;width:97.5%;font-family:&#39;direction:ltr;max-height:200px;font-size:8pt;overflow:auto;border-top:silver 1px solid;cursor:text;border-right:silver 1px solid;margin:20px 0 10px;padding:4px;" id="codeSnippetWrapper">
<div style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0;" id="codeSnippet">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum1">   1:</span> var q1 = from c <span style="color:#0000ff;">in</span> dataContext.Customers</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum2">   2:</span>          join o <span style="color:#0000ff;">in</span> dataContext.Orders on c.CustomerID equals o.CustomerID</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum3">   3:</span>          select <span style="color:#0000ff;">new</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum4">   4:</span>          {</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum5">   5:</span>              c.CustomerID,</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum6">   6:</span>              c.ContactName,</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum7">   7:</span>              o.OrderID,</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum8">   8:</span>              o.OrderDate</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum9">   9:</span>          };</pre>
<p><!--CRLF--></div>
</div>
<p><strong>LEFT JOIN :</strong></p>
<div style="border-bottom:silver 1px solid;text-align:left;border-left:silver 1px solid;line-height:12pt;background-color:#f4f4f4;width:98.61%;font-family:&#39;direction:ltr;height:208px;max-height:200px;font-size:8pt;overflow:auto;border-top:silver 1px solid;cursor:text;border-right:silver 1px solid;margin:20px 0 10px;padding:4px;" id="codeSnippetWrapper">
<div style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0;" id="codeSnippet">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum1">   1:</span> var q2 = from c <span style="color:#0000ff;">in</span> dataContext.Customers</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum2">   2:</span>          join o <span style="color:#0000ff;">in</span> dataContext.Orders on c.CustomerID equals o.CustomerID into g</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum3">   3:</span>          from a <span style="color:#0000ff;">in</span> g.DefaultIfEmpty()</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum4">   4:</span>          select <span style="color:#0000ff;">new</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum5">   5:</span>          {</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum6">   6:</span>              c.CustomerID,</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum7">   7:</span>              c.ContactName,</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum8">   8:</span>              a.OrderID,</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum9">   9:</span>              a.OrderDate</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum10">  10:</span>          };</pre>
<p><!--CRLF--></div>
</div>
<p align="justify"><strong>INNER JOIN ON MULTIPLE :</strong></p>
<div style="border-bottom:silver 1px solid;text-align:left;border-left:silver 1px solid;line-height:12pt;background-color:#f4f4f4;width:99.04%;font-family:&#39;direction:ltr;height:210px;max-height:200px;font-size:8pt;overflow:auto;border-top:silver 1px solid;cursor:text;border-right:silver 1px solid;margin:20px 0 10px;padding:4px;" id="codeSnippetWrapper">
<div style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0;" id="codeSnippet">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum1">   1:</span> var q3 = from c <span style="color:#0000ff;">in</span> dataContext.Customers</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum2">   2:</span>          join o <span style="color:#0000ff;">in</span> dataContext.Orders on <span style="color:#0000ff;">new</span> { a = c.CustomerID, b = c.Country } equals <span style="color:#0000ff;">new</span> { a = o.CustomerID, b = <span style="color:#006080;">&quot;USA&quot;</span> }</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum3">   3:</span>          select <span style="color:#0000ff;">new</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum4">   4:</span>          {</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum5">   5:</span>              c.CustomerID,</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum6">   6:</span>              c.ContactName,</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum7">   7:</span>              o.OrderID,</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum8">   8:</span>              o.OrderDate</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum9">   9:</span>          };</pre>
<p><!--CRLF--></div>
</div>
<p><strong>INNER JOIN ON MULTIPLE WITH “OR” :</strong></p>
<div style="border-bottom:silver 1px solid;text-align:left;border-left:silver 1px solid;line-height:12pt;background-color:#f4f4f4;width:97.5%;font-family:&#39;direction:ltr;max-height:200px;font-size:8pt;overflow:auto;border-top:silver 1px solid;cursor:text;border-right:silver 1px solid;margin:20px 0 10px;padding:4px;" id="codeSnippetWrapper">
<div style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0;" id="codeSnippet">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum1">   1:</span> var q4 = from c <span style="color:#0000ff;">in</span> dataContext.Customers</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum2">   2:</span>          from o <span style="color:#0000ff;">in</span> dataContext.Orders.Where(a =&gt; a.CustomerID == c.CustomerID || c.Country == <span style="color:#006080;">&quot;INDIA&quot;</span>)</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum3">   3:</span>          select <span style="color:#0000ff;">new</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum4">   4:</span>          {</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum5">   5:</span>              c.CustomerID,</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum6">   6:</span>              c.ContactName,</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum7">   7:</span>              o.OrderID,</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum8">   8:</span>              o.OrderDate</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum9">   9:</span>          };</pre>
<p><!--CRLF--></div>
</div>
</p>
</p>
<p><strong>LEFT JOIN ON MULTIPLE WITH “OR” :</strong></p>
<div style="border-bottom:silver 1px solid;text-align:left;border-left:silver 1px solid;line-height:12pt;background-color:#f4f4f4;width:97.5%;font-family:&#39;direction:ltr;max-height:200px;font-size:8pt;overflow:auto;border-top:silver 1px solid;cursor:text;border-right:silver 1px solid;margin:20px 0 10px;padding:4px;" id="codeSnippetWrapper">
<div style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0;" id="codeSnippet">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum1">   1:</span> var q5 = from c <span style="color:#0000ff;">in</span> dataContext.Customers</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum2">   2:</span>          from o <span style="color:#0000ff;">in</span> dataContext.Orders.Where(a =&gt; a.CustomerID == c.CustomerID || c.Country == <span style="color:#006080;">&quot;USA&quot;</span>).DefaultIfEmpty()</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum3">   3:</span>          select <span style="color:#0000ff;">new</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum4">   4:</span>          {</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum5">   5:</span>              c.CustomerID,</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum6">   6:</span>              c.ContactName,</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum7">   7:</span>              o.OrderID,</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum8">   8:</span>              o.OrderDate</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum9">   9:</span>          };</pre>
<p><!--CRLF--></div>
</div>
<p>More Example base on this article will post shortly <img src='http://s0.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/dhavalshah.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dhavalshah.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dhavalshah.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dhavalshah.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dhavalshah.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dhavalshah.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dhavalshah.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dhavalshah.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dhavalshah.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dhavalshah.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dhavalshah.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dhavalshah.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dhavalshah.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dhavalshah.wordpress.com/113/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dhavalshah.wordpress.com&amp;blog=3135787&amp;post=113&amp;subd=dhavalshah&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dhavalshah.wordpress.com/2010/03/15/joins-in-linq-to-sql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7736088ced6689762b229a14dbb0a4cd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dhavalshah</media:title>
		</media:content>
	</item>
		<item>
		<title>What&#8217;s New in ASP.NET 4.0 &#8211; Better ViewState Control</title>
		<link>http://dhavalshah.wordpress.com/2010/03/15/whats-new-in-asp-net-4-0-better-viewstate-control/</link>
		<comments>http://dhavalshah.wordpress.com/2010/03/15/whats-new-in-asp-net-4-0-better-viewstate-control/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 07:28:22 +0000</pubDate>
		<dc:creator>dhavalshah</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[ASP.NET 4.0]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Dot Net]]></category>
		<category><![CDATA[Microsoft Dot.Net]]></category>
		<category><![CDATA[VB.Net]]></category>
		<category><![CDATA[.Net 4.0]]></category>

		<guid isPermaLink="false">http://dhavalshah.wordpress.com/2010/03/15/whats-new-in-asp-net-4-0-better-viewstate-control/</guid>
		<description><![CDATA[This article is Part II of the multi-part series covering new features on ASP.NET 4.0. In ASP.NET 2.0/3.5, you could disable ViewState for individual controls. However what you could not do is disable ViewState at a Page level and then enable it individually for controls on that page that require it. ASP.NET 4.0 changes that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dhavalshah.wordpress.com&amp;blog=3135787&amp;post=111&amp;subd=dhavalshah&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<ul>
<li>This article is Part II of the multi-part series covering new features on ASP.NET 4.0. </li>
<li>In ASP.NET 2.0/3.5, you could disable ViewState for individual controls. However what you could not do is disable ViewState at a Page level and then enable it individually for controls on that page that require it. ASP.NET 4.0 changes that and gives more control to developers. </li>
<li>Let’s see this with an example. We will first create a page in ASP.NET 3.5 and disable ViewState on the Parent level and then observe the behavior of ViewState in child controls. We will then use the same example in ASP.NET 4.0 using the ViewStateMode property and observe the changes. </li>
</ul>
<p><strong><font color="#404040" size="3">ViewState in ASP.NET 2.0/3.5</font></strong></p>
<ul>
<li>Create an ASP.NET application. Place two Label controls and one Button control on the page. Now disable view state on the Page by setting the ‘EnableViewState’ property to false. On the first Label control, set ‘EnableViewState’ property to true as shown below: </li>
</ul>
<div style="border-bottom:silver 1px solid;text-align:left;border-left:silver 1px solid;line-height:12pt;background-color:#f4f4f4;width:97.5%;font-family:&#39;direction:ltr;max-height:200px;font-size:8pt;overflow:auto;border-top:silver 1px solid;cursor:text;border-right:silver 1px solid;margin:20px 0 10px;padding:4px;" id="codeSnippetWrapper">
<div style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0;" id="codeSnippet">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum1">   1:</span> <span style="background-color:#ffff00;">&lt;%@ Page Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeFile=&quot;Default.aspx.cs&quot; EnableViewState=&quot;false&quot; Inherits=&quot;_Default&quot; %&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum2">   2:</span>  </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum3">   3:</span> <span style="color:#0000ff;">&lt;!</span><span style="color:#800000;">DOCTYPE</span> <span style="color:#ff0000;">html</span> <span style="color:#ff0000;">PUBLIC</span> <span style="color:#0000ff;">&quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;</span> <span style="color:#0000ff;">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;</span><span style="color:#0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum4">   4:</span>  </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum5">   5:</span> <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">html</span> <span style="color:#ff0000;">xmlns</span><span style="color:#0000ff;">=&quot;http://www.w3.org/1999/xhtml&quot;</span><span style="color:#0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum6">   6:</span> <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">head</span> <span style="color:#ff0000;">runat</span><span style="color:#0000ff;">=&quot;server&quot;</span><span style="color:#0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum7">   7:</span>     <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">title</span><span style="color:#0000ff;">&gt;</span>ViewState Demo in ASP.NET 3.5<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">title</span><span style="color:#0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum8">   8:</span> <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">head</span><span style="color:#0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum9">   9:</span> <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">body</span><span style="color:#0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum10">  10:</span>     <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">form</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">=&quot;form1&quot;</span> <span style="color:#ff0000;">runat</span><span style="color:#0000ff;">=&quot;server&quot;</span><span style="color:#0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum11">  11:</span>     <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">div</span><span style="color:#0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum12">  12:</span>         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">asp:Label</span> <span style="color:#ff0000;">ID</span><span style="color:#0000ff;">=&quot;Label1&quot;</span> <span style="color:#ff0000;">runat</span><span style="color:#0000ff;">=&quot;server&quot;</span> <span style="color:#ff0000;">Text</span><span style="color:#0000ff;">=&quot;First&quot;</span> <span style="color:#ff0000;">EnableViewState</span><span style="color:#0000ff;">=&quot;true&quot;</span><span style="color:#0000ff;">&gt;&lt;/</span><span style="color:#800000;">asp:Label</span><span style="color:#0000ff;">&gt;&lt;</span><span style="color:#800000;">br</span> <span style="color:#0000ff;">/&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum13">  13:</span>         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">asp:Label</span> <span style="color:#ff0000;">ID</span><span style="color:#0000ff;">=&quot;Label2&quot;</span> <span style="color:#ff0000;">runat</span><span style="color:#0000ff;">=&quot;server&quot;</span> <span style="color:#ff0000;">Text</span><span style="color:#0000ff;">=&quot;Second&quot;</span><span style="color:#0000ff;">&gt;&lt;/</span><span style="color:#800000;">asp:Label</span><span style="color:#0000ff;">&gt;&lt;</span><span style="color:#800000;">br</span> <span style="color:#0000ff;">/&gt;&lt;</span><span style="color:#800000;">br</span> <span style="color:#0000ff;">/&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum14">  14:</span>         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">asp:Button</span> <span style="color:#ff0000;">ID</span><span style="color:#0000ff;">=&quot;Button1&quot;</span> <span style="color:#ff0000;">runat</span><span style="color:#0000ff;">=&quot;server&quot;</span> <span style="color:#ff0000;">Text</span><span style="color:#0000ff;">=&quot;PostBack&quot;</span> <span style="color:#0000ff;">/&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum15">  15:</span>     <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">div</span><span style="color:#0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum16">  16:</span>     <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">form</span><span style="color:#0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum17">  17:</span> <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">body</span><span style="color:#0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum18">  18:</span> <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">html</span><span style="color:#0000ff;">&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<p>In the code behind file, write the following code which set’s the text of the Label controls:</p>
<div style="border-bottom:silver 1px solid;text-align:left;border-left:silver 1px solid;line-height:12pt;background-color:#f4f4f4;width:97.5%;font-family:&#39;direction:ltr;max-height:200px;font-size:8pt;overflow:auto;border-top:silver 1px solid;cursor:text;border-right:silver 1px solid;margin:20px 0 10px;padding:4px;" id="codeSnippetWrapper">
<div style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0;" id="codeSnippet">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum1">   1:</span> <span style="color:#0000ff;">if</span>(!IsPostBack)</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum2">   2:</span> {</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum3">   3:</span>     Label1.Text = <span style="color:#006080;">&quot;My First Example&quot;</span>;</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum4">   4:</span>     Label2.Text = <span style="color:#006080;">&quot;My Second Example&quot;</span>;</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum5">   5:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>Now what is ‘ideally’ expected out of this setup is that although ViewState is disabled for the entire page, yet Label1 should save ViewState and retain its new value ‘Label1 Changed’ after postback; since ViewState is explicitly enabled on it.</p>
<p>You will observe that on hitting the button (causing a postback), Label1 does not retain the value (Label1 Changed) explicitly set on it. Not as we expected!</p>
<p><b><font color="#404040" size="3"></font></b></p>
<p><b><font color="#404040" size="3">ViewState in ASP.NET 4.0</font></b></p>
<p>We will now create a similar web application in ASP.NET 4.0. The only difference is that here we will use the new ‘ViewStateMode’ property.</p>
<p>The <em>ViewStateMode</em> property accepts three values: Enabled<i>, </i>Disabled<i>, </i>andInherit<i>.</i></p>
<p>Enabled &#8211; enables view state for that control and any child controls that are set to ‘Inherit’ or that have nothing set.</p>
<p>Disabled &#8211; disables view state</p>
<p>Inherit &#8211; specifies that the control uses the <em>ViewStateMode</em> setting from the parent control.</p>
<p>The markup looks similar to the following:</p>
<div style="border-bottom:silver 1px solid;text-align:left;border-left:silver 1px solid;line-height:12pt;background-color:#f4f4f4;width:97.5%;font-family:&#39;direction:ltr;max-height:200px;font-size:8pt;overflow:auto;border-top:silver 1px solid;cursor:text;border-right:silver 1px solid;margin:20px 0 10px;padding:4px;" id="codeSnippetWrapper">
<div style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0;" id="codeSnippet">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum1">   1:</span> <span style="background-color:#ffff00;">&lt;%@ Page Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeFile=&quot;Default.aspx.cs&quot; ViewStateMode=&quot;Disabled&quot; Inherits=&quot;_Default&quot; %&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum2">   2:</span>  </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum3">   3:</span> <span style="color:#0000ff;">&lt;!</span><span style="color:#800000;">DOCTYPE</span> <span style="color:#ff0000;">html</span> <span style="color:#ff0000;">PUBLIC</span> <span style="color:#0000ff;">&quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;</span> <span style="color:#0000ff;">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;</span><span style="color:#0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum4">   4:</span>  </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum5">   5:</span> <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">html</span> <span style="color:#ff0000;">xmlns</span><span style="color:#0000ff;">=&quot;http://www.w3.org/1999/xhtml&quot;</span><span style="color:#0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum6">   6:</span> <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">head</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">=&quot;Head1&quot;</span> <span style="color:#ff0000;">runat</span><span style="color:#0000ff;">=&quot;server&quot;</span><span style="color:#0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum7">   7:</span>     <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">title</span><span style="color:#0000ff;">&gt;</span>View State Demo in ASP.NET 4.0<span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">title</span><span style="color:#0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum8">   8:</span> <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">head</span><span style="color:#0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum9">   9:</span> <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">body</span><span style="color:#0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum10">  10:</span>     <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">form</span> <span style="color:#ff0000;">id</span><span style="color:#0000ff;">=&quot;form1&quot;</span> <span style="color:#ff0000;">runat</span><span style="color:#0000ff;">=&quot;server&quot;</span><span style="color:#0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum11">  11:</span>     <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">div</span><span style="color:#0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum12">  12:</span>         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">asp:Label</span> <span style="color:#ff0000;">ID</span><span style="color:#0000ff;">=&quot;Label1&quot;</span> <span style="color:#ff0000;">runat</span><span style="color:#0000ff;">=&quot;server&quot;</span> <span style="color:#ff0000;">Text</span><span style="color:#0000ff;">=&quot;First&quot;</span> <span style="color:#ff0000;">ViewStateMode</span><span style="color:#0000ff;">=&quot;Enabled&quot;</span><span style="color:#0000ff;">&gt;&lt;/</span><span style="color:#800000;">asp:Label</span><span style="color:#0000ff;">&gt;&lt;</span><span style="color:#800000;">br</span> <span style="color:#0000ff;">/&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum13">  13:</span>         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">asp:Label</span> <span style="color:#ff0000;">ID</span><span style="color:#0000ff;">=&quot;Label2&quot;</span> <span style="color:#ff0000;">runat</span><span style="color:#0000ff;">=&quot;server&quot;</span> <span style="color:#ff0000;">Text</span><span style="color:#0000ff;">=&quot;Second&quot;</span><span style="color:#0000ff;">&gt;&lt;/</span><span style="color:#800000;">asp:Label</span><span style="color:#0000ff;">&gt;</span> <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">br</span> <span style="color:#0000ff;">/&gt;&lt;</span><span style="color:#800000;">br</span> <span style="color:#0000ff;">/&gt;</span>      </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum14">  14:</span>         <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">asp:Button</span> <span style="color:#ff0000;">ID</span><span style="color:#0000ff;">=&quot;Button1&quot;</span> <span style="color:#ff0000;">runat</span><span style="color:#0000ff;">=&quot;server&quot;</span> <span style="color:#ff0000;">Text</span><span style="color:#0000ff;">=&quot;PostBack&quot;</span> <span style="color:#0000ff;">/&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum15">  15:</span>     <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">div</span><span style="color:#0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum16">  16:</span>     <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">form</span><span style="color:#0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum17">  17:</span> <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">body</span><span style="color:#0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum18">  18:</span> <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">html</span><span style="color:#0000ff;">&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<p>Observe that ViewStateMode on the Page is set to <i>Disabled</i>. The child Label1 control has ViewStateMode set to <em>Enabled</em>, so Label1 ‘ideally’ should save view state. Since the ViewStateMode property is not set on Label2 , so the Label2 control inherits this property value from its parent (Page) and therefore saves no view state.</p>
<p><b>Note</b>: The default value of ViewStateMode is <em>Enabled</em> for Pageobject. The default value of ViewStateMode is <em>Inherit</em> for controls.</p>
<p>Run the application and hit the button. What do you expect now?</p>
<p>When the page first loads, both the Label controls display the text as set in the codebehind file.</p>
<p>However, after hitting the button and causing a postback, Label1 does retain its value as we had expected!</p>
<p>&#160;</p>
<p><strong><font color="#404040" size="3"></font></strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dhavalshah.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dhavalshah.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dhavalshah.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dhavalshah.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dhavalshah.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dhavalshah.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dhavalshah.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dhavalshah.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dhavalshah.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dhavalshah.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dhavalshah.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dhavalshah.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dhavalshah.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dhavalshah.wordpress.com/111/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dhavalshah.wordpress.com&amp;blog=3135787&amp;post=111&amp;subd=dhavalshah&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dhavalshah.wordpress.com/2010/03/15/whats-new-in-asp-net-4-0-better-viewstate-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7736088ced6689762b229a14dbb0a4cd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dhavalshah</media:title>
		</media:content>
	</item>
		<item>
		<title>What&#8217;s New in ASP.NET 4.0</title>
		<link>http://dhavalshah.wordpress.com/2010/03/13/whats-new-in-asp-net-4-0/</link>
		<comments>http://dhavalshah.wordpress.com/2010/03/13/whats-new-in-asp-net-4-0/#comments</comments>
		<pubDate>Sat, 13 Mar 2010 05:13:02 +0000</pubDate>
		<dc:creator>dhavalshah</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[ASP.NET 4.0]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Dot Net]]></category>
		<category><![CDATA[Microsoft Dot.Net]]></category>
		<category><![CDATA[VB.Net]]></category>

		<guid isPermaLink="false">http://dhavalshah.wordpress.com/2010/03/13/whats-new-in-asp-net-4-0/</guid>
		<description><![CDATA[With the ASP.NET 4.0 release round the corner, I thought of starting an article series that covers the new features introduced in ASP.NET 4.0, one at a time. This article is Part I of this multi-part series. In this article we will learn 2 new properties added to Pages Class. Metkeywords. MetaDescription. The MetaDescription is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dhavalshah.wordpress.com&amp;blog=3135787&amp;post=106&amp;subd=dhavalshah&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p align="justify">With the <strong>ASP.NET 4.0</strong> release round the corner, I thought of starting an article series that covers the new features introduced in ASP.NET 4.0, one at a time. This article is Part I of this multi-part series.</p>
<p align="justify">In this article we will learn 2 new properties added to Pages Class.</p>
<ol>
<li>
<div align="justify">Metkeywords.</div>
</li>
<li>
<div align="justify">MetaDescription.</div>
</li>
</ol>
<p align="justify">The MetaDescription is important from an SEO perspective. The META Description Tag is an integral part which identifies a page and irrespective of the contrary belief, I think search engines take this meta tag seriously.</p>
<p align="justify">Now in ASP.NET 2.0/3.5, you could use the HTMLMeta class to define HTML &lt;meta&gt; elements for your page as shown below:</p>
<div style="border-bottom:silver 1px solid;text-align:left;border-left:silver 1px solid;line-height:12pt;background-color:#f4f4f4;width:97.5%;font-family:&#39;direction:ltr;max-height:200px;font-size:8pt;overflow:auto;border-top:silver 1px solid;cursor:text;border-right:silver 1px solid;margin:20px 0 10px;padding:4px;" id="codeSnippetWrapper">
<div style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0;" id="codeSnippet">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum1">   1:</span> HtmlMeta meta1 = <span style="color:#0000ff;">new</span> HtmlMeta();</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum2">   2:</span> meta1.Name = <span style="color:#006080;">&quot;keywords name here&quot;</span>;</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum3">   3:</span> meta1.Content = <span style="color:#006080;">&quot;some keywords desctiption here&quot;</span>;</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum4">   4:</span>  </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum5">   5:</span> HtmlMeta meta2 = <span style="color:#0000ff;">new</span> HtmlMeta();</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum6">   6:</span> meta2.Name = <span style="color:#006080;">&quot;keywords name here&quot;</span>;</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum7">   7:</span> meta2.Content = <span style="color:#006080;">&quot;some keywords desctiption here&quot;</span>;</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum8">   8:</span>  </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum9">   9:</span> Page.Header.Controls.Add(meta1);</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum10">  10:</span> Page.Header.Controls.Add(meta2);</pre>
<p><!--CRLF--></div>
</div>
<p>Too much code!</p>
<p>However in ASP.NET 4.0, you now have two new properties added to the Page class – MetaKeywords and MetaDescription.</p>
<div style="border-bottom:silver 1px solid;text-align:left;border-left:silver 1px solid;line-height:12pt;background-color:#f4f4f4;width:97.69%;font-family:&#39;direction:ltr;height:98px;max-height:200px;font-size:8pt;overflow:auto;border-top:silver 1px solid;cursor:text;border-right:silver 1px solid;margin:20px 0 10px;padding:4px;" id="codeSnippetWrapper">
<div style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0;" id="codeSnippet">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum1">   1:</span> <span style="background-color:#ffff00;">&lt;%@ Page Title=&quot;New Features in ASP.NET 4&quot; Language=&quot;C#&quot; MasterPageFile=&quot;~/Site.master&quot; AutoEventWireup=&quot;true&quot; CodeFile=&quot;Default.aspx.cs&quot; Inherits=&quot;_Default&quot;</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum2">   2:</span> MetaKeywords=&quot;ASP.NET 4, SEO&quot; MetaDescription=&quot;This page contains information about ASP.NET 4 and SEO enhancements&quot; %&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<p>In order to retain the older meta tag contents and also use the new ones, just concatenate the two programmatically as shown below:</p>
<div style="border-bottom:silver 1px solid;text-align:left;border-left:silver 1px solid;line-height:12pt;background-color:#f4f4f4;width:97.69%;font-family:&#39;direction:ltr;height:159px;max-height:200px;font-size:8pt;overflow:auto;border-top:silver 1px solid;cursor:text;border-right:silver 1px solid;margin:20px 0 10px;padding:4px;" id="codeSnippetWrapper">
<div style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0;" id="codeSnippet">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum1">   1:</span> <span style="color:#0000ff;">protected</span> <span style="color:#0000ff;">void</span> Page_Load(<span style="color:#0000ff;">object</span> sender, EventArgs e)</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum2">   2:</span> {</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum3">   3:</span>         Page.MetaDescription = Page.MetaDescription + <span style="color:#006080;">&quot; This page contains information about ASP.NET 4 and SEO enhancements&quot;</span>;</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum4">   4:</span>         Page.MetaKeywords = Page.MetaKeywords + <span style="color:#006080;">&quot; ASP.NET 4, SEO&quot;</span>;</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum5">   5:</span> }</pre>
<p><!--CRLF--></div>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dhavalshah.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dhavalshah.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dhavalshah.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dhavalshah.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dhavalshah.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dhavalshah.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dhavalshah.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dhavalshah.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dhavalshah.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dhavalshah.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dhavalshah.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dhavalshah.wordpress.com/106/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dhavalshah.wordpress.com/106/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dhavalshah.wordpress.com/106/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dhavalshah.wordpress.com&amp;blog=3135787&amp;post=106&amp;subd=dhavalshah&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dhavalshah.wordpress.com/2010/03/13/whats-new-in-asp-net-4-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7736088ced6689762b229a14dbb0a4cd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dhavalshah</media:title>
		</media:content>
	</item>
		<item>
		<title>Cookies and jQuery</title>
		<link>http://dhavalshah.wordpress.com/2010/03/13/cookies-and-jquery/</link>
		<comments>http://dhavalshah.wordpress.com/2010/03/13/cookies-and-jquery/#comments</comments>
		<pubDate>Sat, 13 Mar 2010 04:55:00 +0000</pubDate>
		<dc:creator>dhavalshah</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Dot Net]]></category>
		<category><![CDATA[Java Script]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Cookies]]></category>
		<category><![CDATA[jQuery with Cookies]]></category>

		<guid isPermaLink="false">http://dhavalshah.wordpress.com/2010/03/13/cookies-and-jquery/</guid>
		<description><![CDATA[To use cookies with jQuery, you will need the special Cookie plugin. Setting cookies : Setting cookies with the Cookie plug-in is quite intuitive: 1: $(document).ready(function(){ 2:&#160; 3: // Setting a kittens cookie, it will be lost on browser restart: 4: $.cookie(&#34;kittens&#34;,&#34;Seven Kittens&#34;); 5:&#160; 6: // Setting demoCookie (as seen in the demonstration): 7: $.cookie(&#34;demoCookie&#34;,text,{expires: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dhavalshah.wordpress.com&amp;blog=3135787&amp;post=101&amp;subd=dhavalshah&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>To use cookies with jQuery, you will need the special <a href="http://plugins.jquery.com/project/Cookie">Cookie plugin</a>.</p>
<p><strong>Setting cookies :</strong></p>
<p>Setting cookies with the Cookie plug-in is quite intuitive:</p>
<div style="border-bottom:silver 1px solid;text-align:left;border-left:silver 1px solid;line-height:12pt;background-color:#f4f4f4;width:97.5%;font-family:&#39;direction:ltr;max-height:200px;font-size:8pt;overflow:auto;border-top:silver 1px solid;cursor:text;border-right:silver 1px solid;margin:20px 0 10px;padding:4px;" id="codeSnippetWrapper">
<div style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0;" id="codeSnippet">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum1">   1:</span> $(document).ready(<span style="color:#0000ff;">function</span>(){</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum2">   2:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum3">   3:</span>     <span style="color:#008000;">// Setting a kittens cookie, it will be lost on browser restart:</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum4">   4:</span>     $.cookie(<span style="color:#006080;">&quot;kittens&quot;</span>,<span style="color:#006080;">&quot;Seven Kittens&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum5">   5:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum6">   6:</span>     <span style="color:#008000;">// Setting demoCookie (as seen in the demonstration):</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum7">   7:</span>     $.cookie(<span style="color:#006080;">&quot;demoCookie&quot;</span>,text,{expires: 7, path: <span style="color:#006080;">'/'</span>, domain: <span style="color:#006080;">'demo.tutorialzine.com'</span>});</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum8">   8:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum9">   9:</span>     <span style="color:#008000;">// &quot;text&quot; is a variable holding the string to be saved</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum10">  10:</span> });</pre>
<p><!--CRLF--></div>
</div>
<p><strong>Reading cookies :</strong></p>
<p>Reading a cookie is even simpler. Just call the <strong>$.cookie()</strong> function with a single cookie-name parameter, and the value of the cookie will be returned:</p>
<div style="border-bottom:silver 1px solid;text-align:left;border-left:silver 1px solid;line-height:12pt;background-color:#f4f4f4;width:97.5%;font-family:&#39;direction:ltr;max-height:200px;font-size:8pt;overflow:auto;border-top:silver 1px solid;cursor:text;border-right:silver 1px solid;margin:20px 0 10px;padding:4px;" id="codeSnippetWrapper">
<div style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0;" id="codeSnippet">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum1">   1:</span> $(document).ready(<span style="color:#0000ff;">function</span>(){</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum2">   2:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum3">   3:</span>     <span style="color:#008000;">// Getting the kittens cookie:</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum4">   4:</span>     <span style="color:#0000ff;">var</span> str = $.cookie(<span style="color:#006080;">&quot;kittens&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum5">   5:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum6">   6:</span>     <span style="color:#008000;">// str now contains &quot;Seven Kittens&quot;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum7">   7:</span> });</pre>
<p><!--CRLF--></div>
</div>
<p><strong>Deleting cookies :</strong></p>
<p>To delete a cookie, again use the <strong>$.cookie()</strong> function, but pass <strong>null</strong> as its second parameter.</p>
<div style="border-bottom:silver 1px solid;text-align:left;border-left:silver 1px solid;line-height:12pt;background-color:#f4f4f4;width:97.5%;font-family:&#39;direction:ltr;max-height:200px;font-size:8pt;overflow:auto;border-top:silver 1px solid;cursor:text;border-right:silver 1px solid;margin:20px 0 10px;padding:4px;" id="codeSnippetWrapper">
<div style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0;" id="codeSnippet">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum1">   1:</span> $(document).ready(<span style="color:#0000ff;">function</span>(){</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum2">   2:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum3">   3:</span>     <span style="color:#008000;">// Deleting the kittens cookie:</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum4">   4:</span>     <span style="color:#0000ff;">var</span> str = $.cookie(<span style="color:#006080;">&quot;kittens&quot;</span>,<span style="color:#0000ff;">null</span>);</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum5">   5:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum6">   6:</span>     <span style="color:#008000;">// No more kittens</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum7">   7:</span> });</pre>
<p><!--CRLF--></div>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dhavalshah.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dhavalshah.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dhavalshah.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dhavalshah.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dhavalshah.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dhavalshah.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dhavalshah.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dhavalshah.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dhavalshah.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dhavalshah.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dhavalshah.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dhavalshah.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dhavalshah.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dhavalshah.wordpress.com/101/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dhavalshah.wordpress.com&amp;blog=3135787&amp;post=101&amp;subd=dhavalshah&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dhavalshah.wordpress.com/2010/03/13/cookies-and-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7736088ced6689762b229a14dbb0a4cd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dhavalshah</media:title>
		</media:content>
	</item>
		<item>
		<title>PageMethods In ASP.NET AJAX</title>
		<link>http://dhavalshah.wordpress.com/2010/03/12/pagemethods-in-asp-net-ajax/</link>
		<comments>http://dhavalshah.wordpress.com/2010/03/12/pagemethods-in-asp-net-ajax/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 12:19:13 +0000</pubDate>
		<dc:creator>dhavalshah</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Dot Net]]></category>

		<guid isPermaLink="false">http://dhavalshah.wordpress.com/2010/03/12/pagemethods-in-asp-net-ajax/</guid>
		<description><![CDATA[Page Methods is a new mechanism in ASP.Net application where the server code cab be bound to Asp.Net pages.&#160; It is an easy way to communicate asynchronously with the server using Asp.Net Ajax technologies. It’s an alternate way to call the page which is reliable and low risk.&#160; In a nutshell, it is used to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dhavalshah.wordpress.com&amp;blog=3135787&amp;post=100&amp;subd=dhavalshah&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p align="justify">Page Methods is a new mechanism in ASP.Net application where the server code cab be bound to Asp.Net pages.&#160; It is an easy way to communicate asynchronously with the server using Asp.Net Ajax technologies. It’s an alternate way to call the page which is reliable and low risk.&#160; In a nutshell, it is used to expose the web methods to the client script. </p>
<p align="justify">&#160;</p>
<p align="justify"><a><strong><font size="3">Sample Application Demonstrating Page Methods</font></strong></a></p>
<ul>
<li>
<p>To enable Page methods we need to drag a ScriptManager control to the page and mark the EnablePageMethods to True.</p>
</li>
</ul>
<div style="border-bottom:silver 1px solid;text-align:left;border-left:silver 1px solid;line-height:12pt;background-color:#f4f4f4;width:97.5%;font-family:&#39;direction:ltr;max-height:200px;font-size:8pt;overflow:auto;border-top:silver 1px solid;cursor:text;border-right:silver 1px solid;margin:20px 0 10px;padding:4px;" id="codeSnippetWrapper">
<div style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0;" id="codeSnippet">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum1">   1:</span> <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">asp:ScriptManager</span> <span style="color:#ff0000;">ID</span><span style="color:#0000ff;">=&quot;ScriptManager1&quot;</span> <span style="color:#ff0000;">runat</span><span style="color:#0000ff;">=&quot;server&quot;</span>   </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum2">   2:</span>       <span style="color:#ff0000;">EnablePageMethods</span><span style="color:#0000ff;">=&quot;True&quot;</span><span style="color:#0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum3">   3:</span> <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">asp:ScriptManager</span><span style="color:#0000ff;">&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<ul>
<li>Go the Code behind file of the page and add a static method and mark them as WebMethod. Lets Say the method name is GetPageMethod which returns a status value. </li>
</ul>
<div style="border-bottom:silver 1px solid;text-align:left;border-left:silver 1px solid;line-height:12pt;background-color:#f4f4f4;width:97.5%;font-family:&#39;direction:ltr;max-height:200px;font-size:8pt;overflow:auto;border-top:silver 1px solid;cursor:text;border-right:silver 1px solid;margin:20px 0 10px;padding:4px;" id="codeSnippetWrapper">
<div style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0;" id="codeSnippet">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum1">   1:</span> [System.Web.Services.WebMethod]        </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum2">   2:</span> <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">static</span> <span style="color:#0000ff;">string</span> GetPageMethod()</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum3">   3:</span> {</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum4">   4:</span>       <span style="color:#0000ff;">return</span> <span style="color:#006080;">&quot;Welcome PageMethods&quot;</span>;</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum5">   5:</span> }</pre>
<p><!--CRLF--></div>
</div>
<ul>
<li>Now that the method is exposed add a button control and call a client script which accesses the Webmethods of the page. </li>
</ul>
<div style="border-bottom:silver 1px solid;text-align:left;border-left:silver 1px solid;line-height:12pt;background-color:#f4f4f4;width:97.5%;font-family:&#39;direction:ltr;max-height:200px;font-size:8pt;overflow:auto;border-top:silver 1px solid;cursor:text;border-right:silver 1px solid;margin:20px 0 10px;padding:4px;" id="codeSnippetWrapper">
<div style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0;" id="codeSnippet">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum1">   1:</span> <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">asp:Button</span> <span style="color:#ff0000;">ID</span><span style="color:#0000ff;">=&quot;Button1&quot;</span> <span style="color:#ff0000;">runat</span><span style="color:#0000ff;">=&quot;server&quot;</span> <span style="color:#ff0000;">Text</span><span style="color:#0000ff;">=&quot;Call Page Methods&quot;</span>  </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum2">   2:</span>       <span style="color:#ff0000;">OnClientClick</span><span style="color:#0000ff;">=&quot;return fun()&quot;</span><span style="color:#0000ff;">/&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<ul>
<li>In javascript function we can use PageMethods object to call the WebMethod of the page. </li>
</ul>
<ul>
<div style="border-bottom:silver 1px solid;text-align:left;border-left:silver 1px solid;line-height:12pt;background-color:#f4f4f4;width:97.5%;font-family:&#39;direction:ltr;max-height:200px;font-size:8pt;overflow:auto;border-top:silver 1px solid;cursor:text;border-right:silver 1px solid;margin:20px 0 10px;padding:4px;" id="codeSnippetWrapper">
<div style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0;" id="codeSnippet">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum1">   1:</span> function fun()</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum2">   2:</span> {    </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum3">   3:</span>      PageMethods.updateProduct(GetPageMethod,OnSucceeded,OnError);    </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum4">   4:</span> }</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum5">   5:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum6">   6:</span> function OnSucceeded(result, userContext, methodName) </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum7">   7:</span> {</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum8">   8:</span>     <span style="color:#0000ff;">if</span> (methodName == <span style="color:#006080;">&quot;GetPageMethod&quot;</span>)</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum9">   9:</span>     {</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum10">  10:</span>&#160;&#160; alert(result);</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum11">  11:</span>     }</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum12">  12:</span> }</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum13">  13:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum14">  14:</span> function OnError(result,userContext,methodName)</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum15">  15:</span> {</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum16">  16:</span>     <span style="color:#0000ff;">if</span>(methodName == <span style="color:#006080;">&quot;GetPageMethod&quot;</span>)</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum17">  17:</span>     {</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum18">  18:</span>         IsError = 1;</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum19">  19:</span>     }</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum20">  20:</span> }</pre>
<p><!--CRLF--></div>
</p></div>
</ul>
<p>&#160;</p>
<ul>
<li>Now run the application and check the result which shows the alert box with value “Welcome PageMethods”. The sample application calls the webmethods of the page using client script without full page cycle. </li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dhavalshah.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dhavalshah.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dhavalshah.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dhavalshah.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dhavalshah.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dhavalshah.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dhavalshah.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dhavalshah.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dhavalshah.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dhavalshah.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dhavalshah.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dhavalshah.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dhavalshah.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dhavalshah.wordpress.com/100/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dhavalshah.wordpress.com&amp;blog=3135787&amp;post=100&amp;subd=dhavalshah&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dhavalshah.wordpress.com/2010/03/12/pagemethods-in-asp-net-ajax/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7736088ced6689762b229a14dbb0a4cd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dhavalshah</media:title>
		</media:content>
	</item>
		<item>
		<title>Value Type Vs Reference Type</title>
		<link>http://dhavalshah.wordpress.com/2010/03/12/value-type-vs-reference-type/</link>
		<comments>http://dhavalshah.wordpress.com/2010/03/12/value-type-vs-reference-type/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 07:32:38 +0000</pubDate>
		<dc:creator>dhavalshah</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Dot Net]]></category>
		<category><![CDATA[VB.Net]]></category>

		<guid isPermaLink="false">http://dhavalshah.wordpress.com/2010/03/12/value-type-vs-reference-type/</guid>
		<description><![CDATA[Value Type : When a value-type instance is created, a single space in memory is allocated to store the value. Primitive types such as integer, float, Boolean and char are also value types. Structure are value types. Memory Allocation : Value type local variable stored in Stack. C# parameters are (by default) passed by value. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dhavalshah.wordpress.com&amp;blog=3135787&amp;post=96&amp;subd=dhavalshah&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Value Type :</strong></p>
<ol>
<li>When a value-type instance is created, a <strong>single space</strong> in memory is allocated to store the value<strong>.</strong> </li>
<li>Primitive types such as <b>integer</b>, <b>float</b>, <b>Boolean</b> and <b>char</b> are also value types<strong>.</strong> </li>
<li>Structure are <strong>value types</strong>. </li>
<li><strong>Memory Allocation</strong> : Value type local variable stored in <strong><em>Stack</em></strong>. </li>
<li><strong>C# </strong>parameters are (by default) passed by value. </li>
</ol>
<p><strong>Reference Type :</strong></p>
<ol>
<li>With reference types, however, an object is created in memory, and then handled through a separate reference &#8211; rather like a pointer<strong>.</strong> </li>
<li>Class is <strong>Reference types.</strong> </li>
<li><strong>Memory Allocation</strong> : The reference portion of reference type local variable store in <em><strong>Stack</strong></em> and content of reference type object store in <strong><em>Heap</em></strong>. </li>
</ol>
<p><strong>Examples :</strong></p>
<div style="border-bottom:silver 1px solid;text-align:left;border-left:silver 1px solid;line-height:12pt;background-color:#f4f4f4;width:97.5%;font-family:&#39;direction:ltr;max-height:200px;font-size:8pt;overflow:auto;border-top:silver 1px solid;cursor:text;border-right:silver 1px solid;margin:20px 0 10px;padding:4px;" id="codeSnippetWrapper">
<div style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0;" id="codeSnippet">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum1">   1:</span> <span style="color:#008000;">// Suppose Point is a struct, and Form is a class</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum2">   2:</span> Point p1 = <span style="color:#0000ff;">new</span> Point();         <span style="color:#008000;">// Point is a *struct*</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum3">   3:</span> Form f1 = <span style="color:#0000ff;">new</span> Form();           <span style="color:#008000;">// Form is a *class*</span></pre>
<p><!--CRLF--></div>
</div>
<p>&#160;</p>
<ul>
<li>In the first case , one space of memory is allocated of p1 whereas in the second case, two spaces are allocated: one for a <b>Form</b> object and another for its reference (<b>f1</b>). </li>
</ul>
<div style="border-bottom:silver 1px solid;text-align:left;border-left:silver 1px solid;line-height:12pt;background-color:#f4f4f4;width:97.5%;font-family:&#39;direction:ltr;max-height:200px;font-size:8pt;overflow:auto;border-top:silver 1px solid;cursor:text;border-right:silver 1px solid;margin:20px 0 10px;padding:4px;" id="codeSnippetWrapper">
<div style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;padding:0;" id="codeSnippet">
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum1">   1:</span> Size s = <span style="color:#0000ff;">new</span> Size (100, 100);          <span style="color:#008000;">// struct = value type</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum2">   2:</span> Font f = <span style="color:#0000ff;">new</span> Font (“Arial”,10);        <span style="color:#008000;">// class = reference type</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum3">   3:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum4">   4:</span> <span style="color:#008000;">// Form is Reference Type Variable</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum5">   5:</span> Form myForm = <span style="color:#0000ff;">new</span> Form();</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum6">   6:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum7">   7:</span> <span style="color:#008000;">// To set the form's size and font, we can assign the objects s </span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum8">   8:</span> <span style="color:#008000;">//and f to the form via its properties:</span></pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:white;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum9">   9:</span> myForm.Size = s;</pre>
<p><!--CRLF--></p>
<pre style="text-align:left;line-height:12pt;background-color:#f4f4f4;width:100%;font-family:&#39;direction:ltr;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#606060;" id="lnum10">  10:</span> myForm.Font = f;</pre>
<p><!--CRLF--></div>
</div>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Here&#8217;s what it now looks like in memory: </p>
<p><a href="http://dhavalshah.files.wordpress.com/2010/03/image006.gif"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image006" border="0" alt="image006" src="http://dhavalshah.files.wordpress.com/2010/03/image006_thumb.gif?w=522&#038;h=318" width="522" height="318" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dhavalshah.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dhavalshah.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dhavalshah.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dhavalshah.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dhavalshah.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dhavalshah.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dhavalshah.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dhavalshah.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dhavalshah.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dhavalshah.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dhavalshah.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dhavalshah.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dhavalshah.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dhavalshah.wordpress.com/96/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dhavalshah.wordpress.com&amp;blog=3135787&amp;post=96&amp;subd=dhavalshah&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dhavalshah.wordpress.com/2010/03/12/value-type-vs-reference-type/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7736088ced6689762b229a14dbb0a4cd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dhavalshah</media:title>
		</media:content>

		<media:content url="http://dhavalshah.files.wordpress.com/2010/03/image006_thumb.gif" medium="image">
			<media:title type="html">image006</media:title>
		</media:content>
	</item>
		<item>
		<title>Page life Cycle</title>
		<link>http://dhavalshah.wordpress.com/2010/03/09/page-life-cycle/</link>
		<comments>http://dhavalshah.wordpress.com/2010/03/09/page-life-cycle/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 11:52:31 +0000</pubDate>
		<dc:creator>dhavalshah</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Dot Net]]></category>
		<category><![CDATA[VB.Net]]></category>

		<guid isPermaLink="false">http://dhavalshah.wordpress.com/2010/03/09/page-life-cycle/</guid>
		<description><![CDATA[PreInit: All the Pre and Post events are introduced as part of .NET Framework 2.0. As the name suggests, this event is fired before the Init method is fired. Most common functionalities implemented in this method include: Check the IsPostBack property Set the master page dynamically Set the theme property of the page dynamically Read [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dhavalshah.wordpress.com&amp;blog=3135787&amp;post=95&amp;subd=dhavalshah&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><b>PreInit</b>: All the Pre and Post events are introduced as part of .NET Framework 2.0. As the name suggests, this event is fired before the <code>Init </code>method is fired. Most common functionalities implemented in this method include:</p>
<ol>
<li>Check the <code>IsPostBack </code>property </li>
<li>Set the master page dynamically </li>
<li>Set the theme property of the page dynamically </li>
<li>Read or Set the profile property values </li>
<li>Re-create the dynamic controls</li>
</ol>
<p><b>Init</b>: This event is raised after all controls in the page are initialized and any skin settings have been applied. This event is used to read or initialize control properties. It can be used to register events for some controls for which the events are not specified in the aspx page.    <br />Ex: <code>OnClick </code>event of the Button can be registered in the <code>Init </code>rather than specifying in the <code>OnClick </code>property of the Button in the aspx page.</p>
<p><b>InitComplete</b>: Use this event for processing tasks that require all initialization to be complete.</p>
<p><b>PreLoad</b>: Use this event if you need to perform processing on your page or control before the <code>Load </code>event. After the <code>Page </code>raises this event, it loads view state for itself and all controls, and then processes any postback data included with the <code>Request </code>instance.</p>
<p><b>Load</b>: The <code>Page </code>calls the <code>OnLoad </code>event method on the <code>Page</code>, then recursively does the same for each child control, which does the same for each of its child controls until the page and all controls are loaded. Use the<code>OnLoad </code>event method to set properties in controls and establish database connections.</p>
<p><b>Control events</b>: Use these events to handle specific control events, such as a <code>Button </code>control&#8217;s <code>Click</code> event or a <code>TextBox </code>control&#8217;s <code>TextChanged </code>event.</p>
<p><b>LoadComplete</b>: Use this event for tasks that require that all other controls on the page be loaded.</p>
<p><b>PreRender</b>: This is the last event raised before the HTML code is generated for the page. The <code>PreRender </code>event also occurs for each control on the page. Use the event to make final changes to the contents of the page or its controls.</p>
<p><b>SaveStateComplete</b>: Before this event occurs, <code>ViewState </code>has been saved for the page and for all controls. Any changes to the page or controls at this point will be ignored.    <br />Use this event to perform tasks that require view state to be saved, but that do not make any changes to controls.</p>
<p><b>Render</b>: This is the stage where the HTML code for the page is rendered. The <code>Page </code>object calls the <code>Render</code>method of each control at this stage. All ASP.NET Web server controls have a <code>Render </code>method that writes out the control&#8217;s markup that is sent to the browser.</p>
<p><b>UnLoad</b>: This event occurs for each control and then for the page. In controls, use this event to do final cleanup for specific controls, such as closing control-specific database connections.    <br />For the page itself, use this event to do final cleanup work, such as closing open files and database connections, or finishing up logging or other request-specific tasks.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dhavalshah.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dhavalshah.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dhavalshah.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dhavalshah.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dhavalshah.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dhavalshah.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dhavalshah.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dhavalshah.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dhavalshah.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dhavalshah.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dhavalshah.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dhavalshah.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dhavalshah.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dhavalshah.wordpress.com/95/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dhavalshah.wordpress.com&amp;blog=3135787&amp;post=95&amp;subd=dhavalshah&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dhavalshah.wordpress.com/2010/03/09/page-life-cycle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7736088ced6689762b229a14dbb0a4cd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dhavalshah</media:title>
		</media:content>
	</item>
		<item>
		<title>Evaluation of .NET Framework</title>
		<link>http://dhavalshah.wordpress.com/2010/03/08/evaluation-of-net-framework/</link>
		<comments>http://dhavalshah.wordpress.com/2010/03/08/evaluation-of-net-framework/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 06:59:49 +0000</pubDate>
		<dc:creator>dhavalshah</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Dot Net]]></category>
		<category><![CDATA[VB.Net]]></category>

		<guid isPermaLink="false">http://dhavalshah.wordpress.com/2010/03/08/evaluation-of-net-framework/</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dhavalshah.wordpress.com&amp;blog=3135787&amp;post=94&amp;subd=dhavalshah&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://dhavalshah.files.wordpress.com/2010/03/513pxdotnet-svg_.png"><img style="border-bottom:0;border-left:0;display:inline;margin-left:0;border-top:0;margin-right:0;border-right:0;" title="513px-DotNet.svg" border="0" alt="513px-DotNet.svg" align="left" src="http://dhavalshah.files.wordpress.com/2010/03/513pxdotnet-svg_thumb.png?w=579&#038;h=662" width="579" height="662" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dhavalshah.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dhavalshah.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dhavalshah.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dhavalshah.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dhavalshah.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dhavalshah.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dhavalshah.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dhavalshah.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dhavalshah.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dhavalshah.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dhavalshah.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dhavalshah.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dhavalshah.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dhavalshah.wordpress.com/94/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dhavalshah.wordpress.com&amp;blog=3135787&amp;post=94&amp;subd=dhavalshah&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dhavalshah.wordpress.com/2010/03/08/evaluation-of-net-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7736088ced6689762b229a14dbb0a4cd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dhavalshah</media:title>
		</media:content>

		<media:content url="http://dhavalshah.files.wordpress.com/2010/03/513pxdotnet-svg_thumb.png" medium="image">
			<media:title type="html">513px-DotNet.svg</media:title>
		</media:content>
	</item>
		<item>
		<title>View Vs. Stored Procedure</title>
		<link>http://dhavalshah.wordpress.com/2010/03/06/view-vs-stored-procedure/</link>
		<comments>http://dhavalshah.wordpress.com/2010/03/06/view-vs-stored-procedure/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 06:29:59 +0000</pubDate>
		<dc:creator>dhavalshah</dc:creator>
				<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://dhavalshah.wordpress.com/2010/03/06/view-vs-stored-procedure/</guid>
		<description><![CDATA[Differences : View does not accepts parameters while SP takes parameters. View contain only one single query while SP contain several statements like conditional , loop etc. Can not perform modification in any table (DDL Statement) while SP can do this. View is nothing but an imaginary table. It contains data at run time only [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dhavalshah.wordpress.com&amp;blog=3135787&amp;post=91&amp;subd=dhavalshah&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Differences :</strong></p>
<ol>
<li>View <strong>does not accepts parameters</strong> while SP takes parameters.</li>
<li>View contain only one single query while SP contain several statements like conditional , loop etc.</li>
<li>Can not perform modification in any table (DDL Statement) while SP can do this.</li>
<li>View is nothing but an imaginary table. It contains data at run time only not created in the database where as stored procedure can be used to store business logic.It is created at database level.Main difference is stored procedure exits in database where as view does not exits in database.</li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dhavalshah.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dhavalshah.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dhavalshah.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dhavalshah.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dhavalshah.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dhavalshah.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dhavalshah.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dhavalshah.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dhavalshah.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dhavalshah.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dhavalshah.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dhavalshah.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dhavalshah.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dhavalshah.wordpress.com/91/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dhavalshah.wordpress.com&amp;blog=3135787&amp;post=91&amp;subd=dhavalshah&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dhavalshah.wordpress.com/2010/03/06/view-vs-stored-procedure/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7736088ced6689762b229a14dbb0a4cd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dhavalshah</media:title>
		</media:content>
	</item>
		<item>
		<title>Trigger Vs. Stored Procedure</title>
		<link>http://dhavalshah.wordpress.com/2010/03/06/trigger-vs-stored-procedure/</link>
		<comments>http://dhavalshah.wordpress.com/2010/03/06/trigger-vs-stored-procedure/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 06:11:52 +0000</pubDate>
		<dc:creator>dhavalshah</dc:creator>
				<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://dhavalshah.wordpress.com/2010/03/06/trigger-vs-stored-procedure/</guid>
		<description><![CDATA[Differences: Actually trigger in action which is performed automatically before or after a event occur and stored procedure is a procedure which is executed when the it is called. Stored procedure is module. SP can pass the parameters which is not a case with Triggers. While creating a Trigger triggering event and action has to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dhavalshah.wordpress.com&amp;blog=3135787&amp;post=90&amp;subd=dhavalshah&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Differences:</strong></p>
<ol>
<li>Actually trigger in action which is performed automatically before or after a event occur and stored procedure is a procedure which is executed when the it is called. Stored procedure is module.</li>
<li>SP can pass the parameters which is not a case with Triggers.</li>
<li>While creating a Trigger triggering event and action has to be specified which isn’t a case with SP.</li>
<li>A Trigger can call the specific SP in it but the reverse is not true.</li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dhavalshah.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dhavalshah.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dhavalshah.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dhavalshah.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dhavalshah.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dhavalshah.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dhavalshah.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dhavalshah.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dhavalshah.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dhavalshah.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dhavalshah.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dhavalshah.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dhavalshah.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dhavalshah.wordpress.com/90/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dhavalshah.wordpress.com&amp;blog=3135787&amp;post=90&amp;subd=dhavalshah&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dhavalshah.wordpress.com/2010/03/06/trigger-vs-stored-procedure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7736088ced6689762b229a14dbb0a4cd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dhavalshah</media:title>
		</media:content>
	</item>
	</channel>
</rss>
