<?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>CollectedDotNet</title>
	<atom:link href="http://collecteddotnet.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://collecteddotnet.wordpress.com</link>
	<description></description>
	<lastBuildDate>Sat, 10 Dec 2011 14:12:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='collecteddotnet.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>CollectedDotNet</title>
		<link>http://collecteddotnet.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://collecteddotnet.wordpress.com/osd.xml" title="CollectedDotNet" />
	<atom:link rel='hub' href='http://collecteddotnet.wordpress.com/?pushpress=hub'/>
		<item>
		<title>IEnumerator or IEnumerator</title>
		<link>http://collecteddotnet.wordpress.com/2011/09/11/ienumerator-or-ienumerator/</link>
		<comments>http://collecteddotnet.wordpress.com/2011/09/11/ienumerator-or-ienumerator/#comments</comments>
		<pubDate>Sun, 11 Sep 2011 08:41:27 +0000</pubDate>
		<dc:creator>collecteddotnet</dc:creator>
				<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://collecteddotnet.wordpress.com/?p=279</guid>
		<description><![CDATA[IEnumerator or IEnumerator&#60;T&#62; : If you call the GetEnumerator method of IEnumerable or IEnumerable&#60;T&#62; interface, you get an iterator object as an IEnumerator reference. An IEnumerator has the MoveNext, Current, and Reset methods IEnumerator.Reset() &#8211; Sets the enumerator to its &#8230; <a href="http://collecteddotnet.wordpress.com/2011/09/11/ienumerator-or-ienumerator/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=collecteddotnet.wordpress.com&amp;blog=5139606&amp;post=279&amp;subd=collecteddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><font color="blue">IEnumerator or IEnumerator&lt;T&gt; : </font><br />
If you call the GetEnumerator method of IEnumerable or IEnumerable&lt;T&gt; interface, you get an iterator object as an IEnumerator reference.<br />
An IEnumerator has the MoveNext, Current, and Reset methods</p>
<p>IEnumerator.Reset() &#8211; Sets the enumerator to its initial position, which is before the first element in the collection.<br />
IEnumerator.Current &#8211; Gets the current element in the collection.<br />
IEnumerator.MoveNext() &#8211; Move the enumerator to the next element of the collection.</p>
<p>Enumerators can be used to read the data in the collection/list, but they cannot be used to modify the underlying collection.<br />
Each instance of an Enumerator is a a certain position and can give you that element,an enumerator remains valid as long as the collection remains unchanged.If changes are made to the collection, such as add, edit,delete of elements, the enumerator is invalidated and the next call to the MoveNext or Reset method throws an InvalidOperationException.</p>
<p>Example :<br />
<font color="blue"><br />
class Program1<br />
{<br />
public static IEnumerable&lt;int&gt; GetEvenNumbers(int[] numbers)<br />
{<br />
foreach (int item in numbers)<br />
{<br />
if (item % 2 == 0)<br />
yield return (item);<br />
}<br />
}</p>
<p>public static void Main()<br />
{<br />
// Static collection.<br />
int[] numbers = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };</p>
<p>// Return IEnumerable with help of Yield<br />
var evenNumbersCol = GetEvenNumbers(numbers);</p>
<p>// Get IEnumerator from IEnumerable<br />
IEnumerator&lt;int&gt; testNumerator = evenNumbersCol.GetEnumerator();</p>
<p>int sampleNumerator = testNumerator.Current;</p>
<p>Console.WriteLine(&#8220;Get first value for Numerator &#8221; + sampleNumerator);</p>
<p>// To advance/get the next value using MoveNext()<br />
if (testNumerator.MoveNext())<br />
{<br />
sampleNumerator = testNumerator.Current;<br />
Console.WriteLine(&#8220;Next Even Number = &#8221; + sampleNumerator);<br />
}<br />
// Reset() &#8211; Sets the enumerator to its initial position, which is before the first element in the collection.<br />
// testNumerator.Reset();</p>
<p>Console.WriteLine(&#8220;After Reset of Numerator &#8221; + testNumerator.Current);</p>
<p>Console.ReadLine();<br />
}<br />
}<br />
</font><br />
<strong>Output : -</strong><br />
<strong> Get first value for Numerator 0</strong><br />
<strong> Next Even Number = 2</strong><br />
<strong> After Reset of Numerator 2</strong></p>
<p>As per <a title="Reset" href="http://msdn.microsoft.com/en-us/library/system.collections.ienumerator.reset.aspx" target="_blank">MSDN </a><br /> The Reset method is provided for COM interoperability. It does not necessarily need to be implemented; instead, the implementer can simply throw a <font color="red"><strong>NotSupportedException</strong>.</font><br />
To verify this please uncomment the 3rd last statement testNumerator.Reset();</p>
<p>Ref &#8211; <a title="System.Collections.IEnumerator" href="http://msdn.microsoft.com/en-us/library/system.collections.ienumerator.aspx" target="_blank">System.Collections.IEnumerator</a><br />
<a title="IEnumerator" href="http://msdn.microsoft.com/en-us/library/78dfe2yb.aspx" target="_blank">IEnumerator</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/collecteddotnet.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/collecteddotnet.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/collecteddotnet.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/collecteddotnet.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/collecteddotnet.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/collecteddotnet.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/collecteddotnet.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/collecteddotnet.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/collecteddotnet.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/collecteddotnet.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/collecteddotnet.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/collecteddotnet.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/collecteddotnet.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/collecteddotnet.wordpress.com/279/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=collecteddotnet.wordpress.com&amp;blog=5139606&amp;post=279&amp;subd=collecteddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://collecteddotnet.wordpress.com/2011/09/11/ienumerator-or-ienumerator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e98bf21b8594825d640c0984bc452a46?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">collecteddotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>The Yield Statement</title>
		<link>http://collecteddotnet.wordpress.com/2011/09/07/the-yield-statement/</link>
		<comments>http://collecteddotnet.wordpress.com/2011/09/07/the-yield-statement/#comments</comments>
		<pubDate>Wed, 07 Sep 2011 04:35:41 +0000</pubDate>
		<dc:creator>collecteddotnet</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://collecteddotnet.wordpress.com/?p=257</guid>
		<description><![CDATA[Yield , one of the most powerfull, most ignored feature by developers.I was one of them until I used it. First ,yield is not an operator. yield return and yield break are statements. In C#, when we are returning an &#8230; <a href="http://collecteddotnet.wordpress.com/2011/09/07/the-yield-statement/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=collecteddotnet.wordpress.com&amp;blog=5139606&amp;post=257&amp;subd=collecteddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Yield , one of the most powerfull, most ignored feature by developers.I was one of them until I used it. <strong>First ,yield is not an operator. yield return and yield break are statements.</strong></p>
<p>In C#, when we are returning an IEnumerable collection from a method, we are allowed to use the yield keyword to transform method into an &#8220;iterator block&#8221;.</p>
<p>As per <a title="MSDN" href="http://msdn.microsoft.com/en-us/library/9k7k7cf0.aspx" target="_blank">MSDN</a></p>
<p><strong><em><span style="color:#2233ff;">The yield keyword signals to the compiler that the method in which it appears is an iterator block.  The compiler generates a class to implement the behavior that is expressed in the iterator block.  In the iterator block, the yield keyword is used together with the return keyword to provide a value to the enumerator object.  This is the value that is returned, for example, in each loop of a foreach statement.  The yield keyword is also used with break to signal the end of iteration.</span></em></strong></p>
<p>In other words<br />
The yield keyword is used in an iterator block to provide value of enumerator object or to signal the end of the iteration.</p>
<p>yield keyword can be used as:</p>
<p>1)yield return &lt;expression&gt;;<br />
2)yield break;</p>
<p>When used as the expression is evaluated and returned as a value to the enumerator object.Also the expression has to be implicitebly convertible to yield type of the iterator.</p>
<p>When used as break,Yield break control is unconditionally returned to the caller of the iterator in two cases.<br />
One as specified above is MoveNext method of iterator &amp;  Other can be dispose method of enumerator (iterator) object.<br />
<span style="color:#2233ff;"><br />
public class Program<br />
{<br />
public static IEnumerable GetEvenNumbers(int[] numbers)<br />
{<br />
foreach (int item in numbers)<br />
{<br />
if (item % 2 == 0)<br />
yield return (item);<br />
}<br />
}<br />
public static IEnumerableGetFirstEvenNumber(int[] numbers)<br />
{<br />
foreach (int item in numbers)<br />
{<br />
if (item % 2 == 0)<br />
{<br />
yield return (item);<br />
yield break;<br />
}<br />
}<br />
//This Loop , will not get called.<br />
foreach (int item in numbers)<br />
{<br />
if (item % 2 == 1)<br />
yield return item;}<br />
}</span></p>
<p><span style="color:#2233ff;"><br />
public static void Main()<br />
{<br />
int[] numbers = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }; </span><br />
<span style="color:#2233ff;"><br />
<strong>// Yield Return  &#8211; Example Call Start</strong><br />
var evenNumbersCol = GetEvenNumbers(numbers);<br />
foreach (int x in evenNumbersCol)<br />
{<br />
Console.WriteLine(x);<br />
}<br />
<strong>// Yield Return  &#8211; Example Call End </strong></span><br />
<span style="color:#2233ff;"><br />
<strong>// Yield Break &#8211; Example Call Start</strong><br />
var firstEvenNumber = GetFirstEvenNumber(numbers);<br />
foreach (int x in firstEvenNumber)<br />
{<br />
Console.WriteLine(&#8220;First Even Number = &#8221; + x.ToString());<br />
}<br />
<strong>// Yield Break &#8211; Example Call End</strong><br />
Console.ReadLine();<br />
}<br />
</span><br />
In the Program sample above , I mentioned the example call for both Yield Return &amp; Yield Break</p>
<p>The program will return Even numbers.<br />
The Collection evenNumbersCol/firstEvenNumber is empty before it is been accessed in foreach.The methods are getting called actuallly when any of iterator methods getting called or when looped through in other words when used to return items from a loop within a method ( return type IEnumerable) and retain the state of the method through multiple calls.This saves the memory by preventing fully populating large collection of items</p>
<p><strong>Yield Return</strong>:<br />
When used as the expression is evaluated and returned as a value to the enumerator object.&#8221;The expression has to be implicitebly convertible to yield type of the iterator.&#8221; means return type of yield must match to IEnumerable, in our above case int</p>
<p><strong>Yield Break</strong>:<br />
When used as break,Yield break control is unconditionally returned to the caller of the iterator in two cases. One as specified above is Move next method of iterator ( i.e. Looping through as we discussed above) &amp;  Other can be dispose method of enumerator (iterator) object.Also yield break can be seen as return statement which does not return value.<br />
If you are inside this loop want to abort the iteration and return as soon as first even number found , you can do this with help of the yield break. The yield break will return from the method directly instead of the current loop in other words second loop will never get executed here</p>
<p>As per <a title="http://msdn.microsoft.com/en-us/library/9k7k7cf0.aspx" href="http://msdn.microsoft.com/en-us/library/9k7k7cf0.aspx" target="_blank">MSDN </a>Yield have following restrictions</p>
<p>The yield statement can only appear inside an iterator block, which can be implemented as the body of a method, operator, or accessor. The body of such methods, operators, or accessors is controlled by the following <strong>restrictions</strong>:</p>
<p><strong><span style="color:#9933ff;"><br />
1) Unsafe blocks are not allowed.<br />
2) Parameters to the method, operator, or accessor cannot be ref or out.<br />
3) A yield return statement cannot be located anywhere inside a try-catch block.<br />
It can be located in a try block if the try block is followed by a finally block.<br />
4) A yield break statement may be located in a try block or a catch block but not a finally block.<br />
5) A yield statement cannot appear in an anonymous method.<br />
6) When used with expression, a yield return statement cannot appear in a catch block or in a try block that has one or more catch clauses. </span></strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/collecteddotnet.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/collecteddotnet.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/collecteddotnet.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/collecteddotnet.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/collecteddotnet.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/collecteddotnet.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/collecteddotnet.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/collecteddotnet.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/collecteddotnet.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/collecteddotnet.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/collecteddotnet.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/collecteddotnet.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/collecteddotnet.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/collecteddotnet.wordpress.com/257/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=collecteddotnet.wordpress.com&amp;blog=5139606&amp;post=257&amp;subd=collecteddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://collecteddotnet.wordpress.com/2011/09/07/the-yield-statement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e98bf21b8594825d640c0984bc452a46?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">collecteddotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>Jquery &#8211; Getting QueryString Parameters&#8217; Value</title>
		<link>http://collecteddotnet.wordpress.com/2011/04/28/jquery-getting-querystring-parameters-value/</link>
		<comments>http://collecteddotnet.wordpress.com/2011/04/28/jquery-getting-querystring-parameters-value/#comments</comments>
		<pubDate>Thu, 28 Apr 2011 02:31:20 +0000</pubDate>
		<dc:creator>collecteddotnet</dc:creator>
				<category><![CDATA[Jquery]]></category>

		<guid isPermaLink="false">http://collecteddotnet.wordpress.com/?p=248</guid>
		<description><![CDATA[Getting Values from Querystring parameter is quite easy using Jquery e.g if the below mentioned is url with querystring http://localhost/CreateQryString.aspx?Node1=9000%20&#038;Node2=3000 var url = window.location.href; var Node1= null; var Node2= null; if (url.indexOf(&#8216;?Node1=&#8217;) != -1) { Node1= $.query.get(‘Node1’);  Node2= $.query.get(&#8216;Node2&#8242;); } &#8230; <a href="http://collecteddotnet.wordpress.com/2011/04/28/jquery-getting-querystring-parameters-value/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=collecteddotnet.wordpress.com&amp;blog=5139606&amp;post=248&amp;subd=collecteddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Getting Values from Querystring parameter is quite easy using Jquery</p>
<p>e.g if the below mentioned is url with querystring</p>
<p>http://localhost/CreateQryString.aspx?Node1=9000%20&#038;Node2=3000</p>
<p><strong>var url = window.location.href;</strong><br />
var Node1= null;<br />
var Node2= null;</p>
<p>if (url.indexOf(&#8216;?Node1=&#8217;) != -1)<br />
{</p>
<p><strong>Node1= $.query.get(‘Node1’);</strong><br />
<strong> Node2= $.query.get(&#8216;Node2&#8242;);</strong></p>
<p>}</p>
<p>In the above code <strong>window.location.href</strong>  is Javascript property of DOM window object allows us to get or set the current URL. We can access the <strong>href</strong> property through <strong>location.href</strong> or <strong>window.location.href</strong></p>
<p><strong>For </strong><strong>$.query.get()  function </strong><strong> You need to add following Jquery script references </strong></p>
<p>&lt;script type=&#8221;text/javascript&#8221; src=&#8221;jquery.query-2.1.7.js&#8221;&gt;&lt;/script&gt;</p>
<p>&lt;script type=&#8221;text/javascript&#8221; src=&#8221;jquery.rc4.js&#8221;&gt;&lt;/script&gt;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/collecteddotnet.wordpress.com/248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/collecteddotnet.wordpress.com/248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/collecteddotnet.wordpress.com/248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/collecteddotnet.wordpress.com/248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/collecteddotnet.wordpress.com/248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/collecteddotnet.wordpress.com/248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/collecteddotnet.wordpress.com/248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/collecteddotnet.wordpress.com/248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/collecteddotnet.wordpress.com/248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/collecteddotnet.wordpress.com/248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/collecteddotnet.wordpress.com/248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/collecteddotnet.wordpress.com/248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/collecteddotnet.wordpress.com/248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/collecteddotnet.wordpress.com/248/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=collecteddotnet.wordpress.com&amp;blog=5139606&amp;post=248&amp;subd=collecteddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://collecteddotnet.wordpress.com/2011/04/28/jquery-getting-querystring-parameters-value/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e98bf21b8594825d640c0984bc452a46?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">collecteddotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>Jquery : Create Expandable text box/ DIV areas</title>
		<link>http://collecteddotnet.wordpress.com/2011/02/20/238/</link>
		<comments>http://collecteddotnet.wordpress.com/2011/02/20/238/#comments</comments>
		<pubDate>Sun, 20 Feb 2011 16:33:45 +0000</pubDate>
		<dc:creator>collecteddotnet</dc:creator>
				<category><![CDATA[Jquery]]></category>

		<guid isPermaLink="false">http://collecteddotnet.wordpress.com/?p=238</guid>
		<description><![CDATA[Recently I had one requirement, where I wanted to create the following functionality on an asp.net page.  If a block of text is too long I want to truncate the text at 300 characters and display a “more” link.  When &#8230; <a href="http://collecteddotnet.wordpress.com/2011/02/20/238/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=collecteddotnet.wordpress.com&amp;blog=5139606&amp;post=238&amp;subd=collecteddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recently I had one requirement, where I wanted to create the following functionality on an asp.net page.  If a block of text is too long I want to truncate the text at 300 characters and display a “more” link.  When the “more” link is clicked the original block of text should be displayed.</p>
<p>For Example my criteria was as followed</p>
<p><a href="http://collecteddotnet.files.wordpress.com/2011/02/1.jpg"><img class="size-full wp-image-239 aligncenter" title="Before more ...." src="http://collecteddotnet.files.wordpress.com/2011/02/1.jpg?w=500" alt=""   /></a></p>
<p>After clicking on more link/button:</p>
<p><a href="http://collecteddotnet.files.wordpress.com/2011/02/2.jpg"><img class="size-full wp-image-240 aligncenter" title="After the more is clicked ... " src="http://collecteddotnet.files.wordpress.com/2011/02/2.jpg?w=500" alt=""   /></a></p>
<p>I used JQuery Component for this, using 2 functions involved.</p>
<p>My code modules as follows</p>
<p>&lt;script src=&#8221;http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js&#8221;&gt;&lt;/script&gt;</p>
<p>&lt;script src=&#8221;http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js&#8221;&gt;&lt;/script&gt;</p>
<p>&lt;script type=&#8221;text/javascript&#8221;</p>
<p>src=&#8221;http://ajax.googleapis.com/02 ajax/libs/jquery/1.4.2/jquery.min.js&#8221;&gt;&lt;/script&gt;</p>
<p>&lt;script type=&#8221;text/javascript&#8221;&gt;</p>
<p>$(function() {</p>
<p>var finalText = $(&#8216;#divBlock&#8217;).text();</p>
<p>// Pass control of the text block for limiting the number of chars</p>
<p>LimidDivText(&#8216;#divBlock&#8217;,300);</p>
<p>// Expand on click of more link, pass both text block and link here</p>
<p>LinkExpand(&#8216;#divBlock&#8217;,'#lnkMore&#8217;,finalText);</p>
<p>function LinkExpand(divBlock,lnkControl,finalText) {</p>
<p>$(lnkControl).live(&#8220;click&#8221;, function() {</p>
<p>$(divBlock).slideDown(&#8220;fast&#8221;);</p>
<p>$(divBlock).html(finalText);</p>
<p>});</p>
<p>};</p>
<p>function LimidDivText(divBlock,maxLimit) {</p>
<p>var validLength = $(divBlock).text().length &#8211; maxLimit;</p>
<p>if(validLength &gt; 0)</p>
<p>{</p>
<p>$(divBlock).html($(divBlock).text().substring(0,maxLimit)).</p>
<p>append(&#8216; &lt;a id=&#8221;lnkMore&#8221; href=&#8221;#&#8221;&gt;more&lt;/a&gt;&#8217;);</p>
<p>}</p>
<p>};</p>
<p>});</p>
<p>&lt;/script&gt;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/collecteddotnet.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/collecteddotnet.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/collecteddotnet.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/collecteddotnet.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/collecteddotnet.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/collecteddotnet.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/collecteddotnet.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/collecteddotnet.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/collecteddotnet.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/collecteddotnet.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/collecteddotnet.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/collecteddotnet.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/collecteddotnet.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/collecteddotnet.wordpress.com/238/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=collecteddotnet.wordpress.com&amp;blog=5139606&amp;post=238&amp;subd=collecteddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://collecteddotnet.wordpress.com/2011/02/20/238/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e98bf21b8594825d640c0984bc452a46?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">collecteddotnet</media:title>
		</media:content>

		<media:content url="http://collecteddotnet.files.wordpress.com/2011/02/1.jpg" medium="image">
			<media:title type="html">Before more ....</media:title>
		</media:content>

		<media:content url="http://collecteddotnet.files.wordpress.com/2011/02/2.jpg" medium="image">
			<media:title type="html">After the more is clicked ... </media:title>
		</media:content>
	</item>
		<item>
		<title>Jquery : Getting RadioButtonlist value using Jquery</title>
		<link>http://collecteddotnet.wordpress.com/2010/07/06/jquery-getting-radiobuttonlist-value-using-jquery/</link>
		<comments>http://collecteddotnet.wordpress.com/2010/07/06/jquery-getting-radiobuttonlist-value-using-jquery/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 01:59:18 +0000</pubDate>
		<dc:creator>collecteddotnet</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Jquery]]></category>

		<guid isPermaLink="false">http://collecteddotnet.wordpress.com/?p=234</guid>
		<description><![CDATA[We can get value of checked RadioButtonlist item using Jquery as mentioned below. $(&#8216;input[type=radio][id*=radioButtonList]:checked&#8217;).val()<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=collecteddotnet.wordpress.com&amp;blog=5139606&amp;post=234&amp;subd=collecteddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We can get value of checked RadioButtonlist item using Jquery as mentioned below.</p>
<p><strong>$(&#8216;input[type=radio][id*=radioButtonList]:checked&#8217;).val()<br />
</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/collecteddotnet.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/collecteddotnet.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/collecteddotnet.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/collecteddotnet.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/collecteddotnet.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/collecteddotnet.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/collecteddotnet.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/collecteddotnet.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/collecteddotnet.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/collecteddotnet.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/collecteddotnet.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/collecteddotnet.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/collecteddotnet.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/collecteddotnet.wordpress.com/234/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=collecteddotnet.wordpress.com&amp;blog=5139606&amp;post=234&amp;subd=collecteddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://collecteddotnet.wordpress.com/2010/07/06/jquery-getting-radiobuttonlist-value-using-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e98bf21b8594825d640c0984bc452a46?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">collecteddotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>Jquery : Setting Dropdownlist value using Jquery</title>
		<link>http://collecteddotnet.wordpress.com/2010/07/06/jquery-setting-dropdownlist-value-using-jquery/</link>
		<comments>http://collecteddotnet.wordpress.com/2010/07/06/jquery-setting-dropdownlist-value-using-jquery/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 01:47:13 +0000</pubDate>
		<dc:creator>collecteddotnet</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Jquery]]></category>

		<guid isPermaLink="false">http://collecteddotnet.wordpress.com/?p=228</guid>
		<description><![CDATA[We can set Dropdownlist Value using Jquery as mentioned below. if we are having dropdownlist as follows &#60;asp:DropDownList runat=&#8221;server&#8221; ID=&#8221;ddlDropDownList&#8220;&#62; &#60;asp:ListItem Text=&#8221;&#60;&#8211; Select &#8211;&#62;&#8221; Value=&#8221;0&#8243;&#62;&#60;/asp:ListItem&#62; &#60;asp:ListItem Text=&#8221;TEST1&#8243; Value=&#8221;1&#8243;&#62;&#60;/asp:ListItem&#62; &#60;asp:ListItem Text=&#8221;TEST2&#8243; Value=&#8221;2&#8243;&#62;&#60;/asp:ListItem&#62; &#60;asp:ListItem Text=&#8221;TEST3&#8243; Value=&#8221;3&#8243;&#62;&#60;/asp:ListItem&#62; &#60;/asp:DropDownList&#62; THEN ,we can set selection &#8230; <a href="http://collecteddotnet.wordpress.com/2010/07/06/jquery-setting-dropdownlist-value-using-jquery/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=collecteddotnet.wordpress.com&amp;blog=5139606&amp;post=228&amp;subd=collecteddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We can set Dropdownlist Value using Jquery as mentioned below.</p>
<p>if we are having dropdownlist as follows</p>
<p>&lt;asp:DropDownList runat=&#8221;server&#8221; ID=&#8221;<strong>ddlDropDownList</strong>&#8220;&gt;<br />
&lt;asp:ListItem Text=&#8221;&lt;&#8211; Select &#8211;&gt;&#8221; Value=&#8221;0&#8243;&gt;&lt;/asp:ListItem&gt;<br />
&lt;asp:ListItem Text=&#8221;TEST1&#8243; Value=&#8221;1&#8243;&gt;&lt;/asp:ListItem&gt;<br />
&lt;asp:ListItem Text=&#8221;TEST2&#8243; Value=&#8221;2&#8243;&gt;&lt;/asp:ListItem&gt;<br />
&lt;asp:ListItem Text=&#8221;TEST3&#8243; Value=&#8221;3&#8243;&gt;&lt;/asp:ListItem&gt;<br />
&lt;/asp:DropDownList&gt;</p>
<p>THEN ,we can set selection of the dropdown list to &#8220;&lt;&#8211; Select &#8211;&gt;&#8221;  when we required or after processing done as below.</p>
<p><strong>$(&#8220;select[id$=ddlDropDownList]&#8220;).val(&#8220;0&#8243;); </strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/collecteddotnet.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/collecteddotnet.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/collecteddotnet.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/collecteddotnet.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/collecteddotnet.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/collecteddotnet.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/collecteddotnet.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/collecteddotnet.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/collecteddotnet.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/collecteddotnet.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/collecteddotnet.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/collecteddotnet.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/collecteddotnet.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/collecteddotnet.wordpress.com/228/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=collecteddotnet.wordpress.com&amp;blog=5139606&amp;post=228&amp;subd=collecteddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://collecteddotnet.wordpress.com/2010/07/06/jquery-setting-dropdownlist-value-using-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e98bf21b8594825d640c0984bc452a46?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">collecteddotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>Set Selected Value for DropdownList on Clientside using Javascript</title>
		<link>http://collecteddotnet.wordpress.com/2010/05/29/set-selected-value-for-dropdownlist-on-clientside-using-javascript/</link>
		<comments>http://collecteddotnet.wordpress.com/2010/05/29/set-selected-value-for-dropdownlist-on-clientside-using-javascript/#comments</comments>
		<pubDate>Sat, 29 May 2010 03:38:14 +0000</pubDate>
		<dc:creator>collecteddotnet</dc:creator>
				<category><![CDATA[Asp.Net]]></category>
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://collecteddotnet.wordpress.com/?p=223</guid>
		<description><![CDATA[Sometimes we need show the dropdownlist control with some selected value after some activity ( without server postback ) on the web page. we can do that on clientside with the help of javascript. function SetSelectedIndex(dropdownlist,sVal) { var a = &#8230; <a href="http://collecteddotnet.wordpress.com/2010/05/29/set-selected-value-for-dropdownlist-on-clientside-using-javascript/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=collecteddotnet.wordpress.com&amp;blog=5139606&amp;post=223&amp;subd=collecteddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sometimes we need show the dropdownlist control with some selected value after some activity ( without server postback ) on the web page.<br />
we can do that on clientside with the help of javascript.</p>
<p>function SetSelectedIndex(dropdownlist,sVal)<br />
{<br />
var a = document.getElementById(dropdownlist);</p>
<p>for(i=0;i&lt;a.length;i++)<br />
{<br />
if(a.options[i].value == sVal)<br />
{<br />
a.selectedIndex = i;<br />
}</p>
<p>}</p>
<p>}</p>
<p>Call the above function on your required event i.e. onclick,onblur etc&#8230; from code behind.<br />
<span style="color:#000000;"><br />
SetSelectedIndex(&#8216;&lt;%=ddldropdownlistName.ClientID %&gt;&#8217;,&#8221;ValueToBeSelected&#8221;)</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/collecteddotnet.wordpress.com/223/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/collecteddotnet.wordpress.com/223/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/collecteddotnet.wordpress.com/223/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/collecteddotnet.wordpress.com/223/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/collecteddotnet.wordpress.com/223/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/collecteddotnet.wordpress.com/223/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/collecteddotnet.wordpress.com/223/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/collecteddotnet.wordpress.com/223/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/collecteddotnet.wordpress.com/223/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/collecteddotnet.wordpress.com/223/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/collecteddotnet.wordpress.com/223/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/collecteddotnet.wordpress.com/223/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/collecteddotnet.wordpress.com/223/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/collecteddotnet.wordpress.com/223/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=collecteddotnet.wordpress.com&amp;blog=5139606&amp;post=223&amp;subd=collecteddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://collecteddotnet.wordpress.com/2010/05/29/set-selected-value-for-dropdownlist-on-clientside-using-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e98bf21b8594825d640c0984bc452a46?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">collecteddotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>The handle is invalid. (Exception from HRESULT: 0&#215;80070006 (E_HANDLE))</title>
		<link>http://collecteddotnet.wordpress.com/2010/04/20/the-handle-is-invalid-exception-from-hresult-0x80070006-e_handle/</link>
		<comments>http://collecteddotnet.wordpress.com/2010/04/20/the-handle-is-invalid-exception-from-hresult-0x80070006-e_handle/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 06:09:47 +0000</pubDate>
		<dc:creator>collecteddotnet</dc:creator>
				<category><![CDATA[Asp.Net]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Exception]]></category>

		<guid isPermaLink="false">http://collecteddotnet.wordpress.com/?p=220</guid>
		<description><![CDATA[Recently while working on asp.net application , I got following exception Server Error in &#8216;/&#8217; Application. &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; The handle is invalid. (Exception from HRESULT: 0&#215;80070006 (E_HANDLE)) Description: An unhandled exception occurred during the execution of the current web request. Please &#8230; <a href="http://collecteddotnet.wordpress.com/2010/04/20/the-handle-is-invalid-exception-from-hresult-0x80070006-e_handle/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=collecteddotnet.wordpress.com&amp;blog=5139606&amp;post=220&amp;subd=collecteddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Recently while working on asp.net application , I got following exception</strong></p>
<p><span style="color:#ff0000;"><strong>Server Error in &#8216;/&#8217; Application. </strong></span><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p><span style="color:#ff0000;">The handle is invalid. (Exception from HRESULT: 0&#215;80070006 (E_HANDLE))<br />
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.</p>
<p>Exception Details: System.Runtime.InteropServices.COMException: The handle is invalid. (Exception from HRESULT: 0&#215;80070006 (E_HANDLE))</p>
<p>Source Error:</p>
<p>An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</p>
<p>Stack Trace:</p>
<p>[COMException (0x80070006): The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE))]</p>
<p></span><span style="color:#000080;"><span style="color:#ff0000;">[FileLoadException: Could not load file or assembly 'SMDiagnostics, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE))]</p>
<p>System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +0<br />
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +60<br />
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +86</span><br />
</span></p>
<p><strong>After much much of the time , I came to conclusion that following steps can able to solve the problem fast , at least it done the same for me.</strong></p>
<p><span style="color:#0000ff;">First of all check &#8211; </span><br />
Check if the assembly reference added under &lt;assemblies&gt; of Web.config<br />
&lt;add assembly=&#8221;SMDiagnostics, Version=3.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089&#8243; /&gt;</p>
<p>Then</p>
<p>Verify if the file  <strong>SMDiagnostics.dll</strong> exists in the folder at location:<br />
<strong>C:\windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation</strong></p>
<p>Also Verify if the assembly is registered into the GAC :<br />
<strong>C:\Windows\Assembly</strong></p>
<p>If the file is there in GAC you can able to see                                                                                                                                   <strong>&#8216;SMDiagnostics, Version=3.0.0.0, Culture=neutral,  PublicKeyToken=b77a5c561934e089&#8242; </strong> in the list</p>
<p>If the answer for any of the two questions is no, then .Net framework WCF component may not be installed successfully on the machine. Please try reinstalling it.</p>
<p>If still you are not able to solve the exception,Check if your solution is referring to the any External Dll ,<br />
which is not getting loaded due to some reason and eventually raising the exception.</p>
<p>This was exactly the same case with me.</p>
<p>I was using one COM component funcationality which was placed in dll , which is placed under BIN folder and<br />
was using/accessing  the functions from COM in App_code  business code files. and path was mentioned in Web.config as Key like<br />
&lt;add key=&#8221;FuncPath&#8221; value=&#8221;C:\Inetpub\wwwroot\XYZ\APPLICATION\Bin\&#8221;&gt;&lt;/add&gt;<br />
and as the files in the BIN are not getting loaded , it was giving me the error.</p>
<p><span style="color:#000000;">After some following the issue for more than 3-4 hours of try and error  I found the reason that Under IIS , for Virtual Directory Properties Execution Permissions were marked as &#8220;Scripts and Executables&#8221; the dll is not being loaded and I was getting &#8220;System.Runtime.InteropServices.COMException&#8221;</span></p>
<p><span style="color:#0000ff;"><strong>After changing Execution Permissions to &#8220;Scripts Only&#8221; and applying it. it was started working fine.</strong></span></p>
<p>I dont know the any special difference other than</p>
<p><span style="color:#000000;">Scripts only Run only scripts,such as ASP applications  and<br />
Scripts and Executables Run both scripts, such as ASP applications, and executables</span></p>
<p><span style="color:#0000ff;">Although my problem is solved, I am still searching for difference&#8230; Anyone Please &#8230;&#8230;</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/collecteddotnet.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/collecteddotnet.wordpress.com/220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/collecteddotnet.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/collecteddotnet.wordpress.com/220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/collecteddotnet.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/collecteddotnet.wordpress.com/220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/collecteddotnet.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/collecteddotnet.wordpress.com/220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/collecteddotnet.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/collecteddotnet.wordpress.com/220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/collecteddotnet.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/collecteddotnet.wordpress.com/220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/collecteddotnet.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/collecteddotnet.wordpress.com/220/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=collecteddotnet.wordpress.com&amp;blog=5139606&amp;post=220&amp;subd=collecteddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://collecteddotnet.wordpress.com/2010/04/20/the-handle-is-invalid-exception-from-hresult-0x80070006-e_handle/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e98bf21b8594825d640c0984bc452a46?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">collecteddotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>DataBinding: ‘System.Data.DataRowView’ does not contain a property with the name due to &#8220;.&#8221; / Period in ColumnName</title>
		<link>http://collecteddotnet.wordpress.com/2010/03/04/databinding-%e2%80%98system-data-datarowview%e2%80%99-does-not-contain-a-property-with-the-name-due-to-period-in-columnname/</link>
		<comments>http://collecteddotnet.wordpress.com/2010/03/04/databinding-%e2%80%98system-data-datarowview%e2%80%99-does-not-contain-a-property-with-the-name-due-to-period-in-columnname/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 09:47:04 +0000</pubDate>
		<dc:creator>collecteddotnet</dc:creator>
				<category><![CDATA[Asp.Net]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Gridview]]></category>

		<guid isPermaLink="false">http://collecteddotnet.wordpress.com/?p=216</guid>
		<description><![CDATA[Recently I met up with error &#8220;DataBinding: ‘System.Data.DataRowView’ does not contain a property with the name&#8221;,  on page with dynamically generated Gridview on it.Error was coming at the runtime at timing of binding  the data. I first checked for the &#8230; <a href="http://collecteddotnet.wordpress.com/2010/03/04/databinding-%e2%80%98system-data-datarowview%e2%80%99-does-not-contain-a-property-with-the-name-due-to-period-in-columnname/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=collecteddotnet.wordpress.com&amp;blog=5139606&amp;post=216&amp;subd=collecteddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recently I met up with error <strong>&#8220;DataBinding: ‘System.Data.DataRowView’ does not contain a property with the name&#8221;</strong>,  on page with dynamically generated Gridview on it.Error was coming at the runtime at timing of binding  the data.</p>
<p>I first checked for the columns in the dataset before binding to Gridview , all the columns are properly generated. then I started looking for the code which is generating gridview on fly. I was using following event to bind the data dynamically</p>
<p>protected void ValueDataBinding(object sender, EventArgs e)<br />
{<br />
object bound_value_obj = null;<br />
Control ctrl = (Control)sender;<br />
IDataItemContainer data_item_container = (IDataItemContainer)ctrl.NamingContainer;</p>
<p><span style="color:#3366ff;"><strong> </strong><span style="color:#000000;">bound_value_obj =</span><strong> DataBinder.Eval(data_item_container.DataItem, ColumnName);</strong></span> <span style="color:#ff6600;"> ( Exception was thown from above line while binding to column)</span></p>
<p>}</p>
<p>after much of debugging I found that ColumnName is  &#8220;Others&#8230;&#8221; and error was coming due to &#8220;.&#8221; / Period in ColumnName , the reason behind is  DataBinder.Eval Method Uses reflection to parse and evaluate a data-binding expression against an object at run time , so &#8220;.&#8221; can be treated with different , I havnt tried but I am sure it will throw the exception for other special chars also i.e. ;  , : &#8221; &#8216;  etc.</p>
<p><span style="color:#ff0000;">This was solved by using </span></p>
<p>bound_value_obj = <span style="color:#3366ff;"><strong> DataBinder.GetPropertyValue(data_item_container.DataItem, </strong></span><span style="color:#3366ff;"><strong>ColumnName</strong></span><span style="color:#3366ff;"><strong>).ToString();</strong></span></p>
<p><span style="color:#3366ff;"><strong><br />
</strong></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/collecteddotnet.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/collecteddotnet.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/collecteddotnet.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/collecteddotnet.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/collecteddotnet.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/collecteddotnet.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/collecteddotnet.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/collecteddotnet.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/collecteddotnet.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/collecteddotnet.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/collecteddotnet.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/collecteddotnet.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/collecteddotnet.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/collecteddotnet.wordpress.com/216/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=collecteddotnet.wordpress.com&amp;blog=5139606&amp;post=216&amp;subd=collecteddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://collecteddotnet.wordpress.com/2010/03/04/databinding-%e2%80%98system-data-datarowview%e2%80%99-does-not-contain-a-property-with-the-name-due-to-period-in-columnname/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e98bf21b8594825d640c0984bc452a46?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">collecteddotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>Setting  css style programmatically in Asp.Net/C#</title>
		<link>http://collecteddotnet.wordpress.com/2010/03/03/setting-css-style-programmatically-in-asp-netc/</link>
		<comments>http://collecteddotnet.wordpress.com/2010/03/03/setting-css-style-programmatically-in-asp-netc/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 07:37:42 +0000</pubDate>
		<dc:creator>collecteddotnet</dc:creator>
				<category><![CDATA[Asp.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://collecteddotnet.wordpress.com/?p=211</guid>
		<description><![CDATA[Sometimes we have requirements such a way that we need to change the elements and accordingly style dynamically under  div. Suppose in one case  we need our div to be of width-size 800px and and can scroll if goes beyond. &#8230; <a href="http://collecteddotnet.wordpress.com/2010/03/03/setting-css-style-programmatically-in-asp-netc/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=collecteddotnet.wordpress.com&amp;blog=5139606&amp;post=211&amp;subd=collecteddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sometimes we have requirements such a way that we need to change the elements and accordingly style dynamically under  div.</p>
<p>Suppose in one case  we need our div to be of width-size 800px and and can scroll if goes beyond.</p>
<p>for that on the front-end side (aspx) create <span style="color:#3366ff;"><strong>&lt;div id=&#8221;dvDStyle&#8221; runat=&#8221;server&#8221;&gt;  &lt;/div&gt;</strong></span></p>
<p>then in code-behind  ( cs file) mention style using either of the way</p>
<p>1st one is mention it as Attribute for dvDStyle</p>
<p>2nd is mention style as separate property like Key,Value pair.</p>
<p><span style="color:#3366ff;"><strong>dvDStyle.Attributes.Add(&#8220;style&#8221;, &#8220;width:800px; overflow:scroll;&#8221;); </strong></span></p>
<p><span style="color:#3366ff;"><strong>or </strong></span></p>
<p><span style="color:#3366ff;"><strong>dvDStyle.Style["width"] = &#8220;800px&#8221;;<br />
dvDStyle.Style["overflow"] =&#8221;scroll&#8221;;</strong></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/collecteddotnet.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/collecteddotnet.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/collecteddotnet.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/collecteddotnet.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/collecteddotnet.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/collecteddotnet.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/collecteddotnet.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/collecteddotnet.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/collecteddotnet.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/collecteddotnet.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/collecteddotnet.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/collecteddotnet.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/collecteddotnet.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/collecteddotnet.wordpress.com/211/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=collecteddotnet.wordpress.com&amp;blog=5139606&amp;post=211&amp;subd=collecteddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://collecteddotnet.wordpress.com/2010/03/03/setting-css-style-programmatically-in-asp-netc/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e98bf21b8594825d640c0984bc452a46?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">collecteddotnet</media:title>
		</media:content>
	</item>
	</channel>
</rss>
