<?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>Blog for ASP.NET</title>
	<atom:link href="http://blogfordotnet.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogfordotnet.wordpress.com</link>
	<description>Common problems and pitfalls, best practices.</description>
	<lastBuildDate>Fri, 11 Mar 2011 11:47:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blogfordotnet.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Blog for ASP.NET</title>
		<link>http://blogfordotnet.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blogfordotnet.wordpress.com/osd.xml" title="Blog for ASP.NET" />
	<atom:link rel='hub' href='http://blogfordotnet.wordpress.com/?pushpress=hub'/>
		<item>
		<title>REGEX: Replace all characters A-Z and a-z in a variable.</title>
		<link>http://blogfordotnet.wordpress.com/2010/05/30/regex-replace-all-characters-a-z-and-a-z-in-a-variable/</link>
		<comments>http://blogfordotnet.wordpress.com/2010/05/30/regex-replace-all-characters-a-z-and-a-z-in-a-variable/#comments</comments>
		<pubDate>Sun, 30 May 2010 10:04:31 +0000</pubDate>
		<dc:creator>blogfordotnet</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogfordotnet.wordpress.com/?p=42</guid>
		<description><![CDATA[This is a regex expression you can use to filter a variable (let&#8217;s say a number), from all unwanted chars and sybols. Below is an example of how to use it with the Regex.Replace method: [A-Za-z;'%^!@#$%&#38;*()_+-] result = Regex.Replace(value,"[A-Za-z;'%^!@#$%&#38;*()_+-]", String.Empty)<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogfordotnet.wordpress.com&amp;blog=13702234&amp;post=42&amp;subd=blogfordotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="color:#000080;">This is a regex expression you can use to filter a variable (let&#8217;s say a number), from all unwanted chars and sybols. Below is an example of how to use it with the Regex.Replace method:</span></p>
<pre><span style="color:#000080;">[A-Za-z;'%^!@#$%&amp;*()_+-]</span>
<span style="color:#000080;">result = Regex.Replace(value,"[A-Za-z;'%^!@#$%&amp;*()_+-]", String.Empty)</span></pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/blogfordotnet.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/blogfordotnet.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/blogfordotnet.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/blogfordotnet.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/blogfordotnet.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/blogfordotnet.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/blogfordotnet.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/blogfordotnet.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/blogfordotnet.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/blogfordotnet.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/blogfordotnet.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/blogfordotnet.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/blogfordotnet.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/blogfordotnet.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogfordotnet.wordpress.com&amp;blog=13702234&amp;post=42&amp;subd=blogfordotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blogfordotnet.wordpress.com/2010/05/30/regex-replace-all-characters-a-z-and-a-z-in-a-variable/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3d6276a2c350c070b77809981fb91e64?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">blogfordotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>Add an event handler to a control programmatically.</title>
		<link>http://blogfordotnet.wordpress.com/2010/05/21/add-an-event-handler-to-a-control-programmatically/</link>
		<comments>http://blogfordotnet.wordpress.com/2010/05/21/add-an-event-handler-to-a-control-programmatically/#comments</comments>
		<pubDate>Fri, 21 May 2010 11:14:08 +0000</pubDate>
		<dc:creator>blogfordotnet</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogfordotnet.wordpress.com/?p=39</guid>
		<description><![CDATA[First we declare a Button named myButton: Dim myButton As Button = New Button() myButton.ID = "btnMyButton" myButton.Text = "Just Do It!" Here is how we add a handler to its click event: AddHandler myButton.Click, AddressOf myButton_Click And last thing &#8230; <a href="http://blogfordotnet.wordpress.com/2010/05/21/add-an-event-handler-to-a-control-programmatically/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogfordotnet.wordpress.com&amp;blog=13702234&amp;post=39&amp;subd=blogfordotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>First we declare a Button named myButton:</p>
<pre>Dim myButton As Button = New Button()
 myButton.ID = "btnMyButton"
 myButton.Text = "Just Do It!"
</pre>
<p>Here is how we add a handler to its click event:</p>
<pre> AddHandler myButton.Click, AddressOf myButton_Click
</pre>
<p>And last thing to do is write the actual method that handles the click event:</p>
<pre>Protected Sub myButton_Click(ByVal sender As Object, ByVal e As EventArgs)

 'Your code goes here.

 End Sub
</pre>
<p>Here is how you can create an event in C#. I will briefly describe how the event is being created, how we raise the event and how add an eventhandler to it.</p>
<pre><strong>// we declare the delegate for the event; this is just the signature of</strong>
<strong>// a method, that will handle the event.</strong>
public delegate void Del(object sender, EventArgs e);</pre>
<pre><strong>// then we declare the event object which holds the type of Del
//(the delegate we declared earlier)</strong><strong> </strong>
public event Del ev;</pre>
<pre><strong>// We now add an EventHandler to the event being raised.
</strong>ev += new Del(SomeMethodName);
<pre><strong><strong>// And this is the method that will handle our event</strong></strong>
void SomeMethodName(object sender, EventArgs e){
throw new NotImplementedException();}

<strong><strong>// We trigger the event like this:</strong></strong>
ev(sender, e);
</pre>
</pre>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/blogfordotnet.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/blogfordotnet.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/blogfordotnet.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/blogfordotnet.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/blogfordotnet.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/blogfordotnet.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/blogfordotnet.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/blogfordotnet.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/blogfordotnet.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/blogfordotnet.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/blogfordotnet.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/blogfordotnet.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/blogfordotnet.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/blogfordotnet.wordpress.com/39/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogfordotnet.wordpress.com&amp;blog=13702234&amp;post=39&amp;subd=blogfordotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blogfordotnet.wordpress.com/2010/05/21/add-an-event-handler-to-a-control-programmatically/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3d6276a2c350c070b77809981fb91e64?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">blogfordotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>Javascript: How To Set Cursor to Textbox End</title>
		<link>http://blogfordotnet.wordpress.com/2010/05/21/javascript-how-to-set-cursor-to-textbox-end/</link>
		<comments>http://blogfordotnet.wordpress.com/2010/05/21/javascript-how-to-set-cursor-to-textbox-end/#comments</comments>
		<pubDate>Fri, 21 May 2010 07:56:39 +0000</pubDate>
		<dc:creator>blogfordotnet</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogfordotnet.wordpress.com/?p=36</guid>
		<description><![CDATA[&#60; script language="javascript"&#62; function func() { var t2 = document.getElementById("t2"); t2.focus(); t2.value = t2.value; } &#60; /script&#62; The trick is to reset the value of the textbox like that: t2.value = t2.value; Don&#8217;t put a focus() method after that line, &#8230; <a href="http://blogfordotnet.wordpress.com/2010/05/21/javascript-how-to-set-cursor-to-textbox-end/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogfordotnet.wordpress.com&amp;blog=13702234&amp;post=36&amp;subd=blogfordotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<pre>&lt; script language="javascript"&gt;
function func()
{
    var t2 = document.getElementById("t2");
    t2.focus();
    t2.value = t2.value;
}
&lt; /script&gt;
</pre>
<p>The trick is to reset the value of the textbox like that:</p>
<pre>t2.value = t2.value;
</pre>
<p>Don&#8217;t put a focus() method after that line, as it won&#8217;t work. If you want to focus the control do it before you reset the value.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/blogfordotnet.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/blogfordotnet.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/blogfordotnet.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/blogfordotnet.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/blogfordotnet.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/blogfordotnet.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/blogfordotnet.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/blogfordotnet.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/blogfordotnet.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/blogfordotnet.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/blogfordotnet.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/blogfordotnet.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/blogfordotnet.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/blogfordotnet.wordpress.com/36/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogfordotnet.wordpress.com&amp;blog=13702234&amp;post=36&amp;subd=blogfordotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blogfordotnet.wordpress.com/2010/05/21/javascript-how-to-set-cursor-to-textbox-end/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3d6276a2c350c070b77809981fb91e64?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">blogfordotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>Set a MSSQL Database as read-only</title>
		<link>http://blogfordotnet.wordpress.com/2010/05/20/set-a-mssql-database-as-read-only/</link>
		<comments>http://blogfordotnet.wordpress.com/2010/05/20/set-a-mssql-database-as-read-only/#comments</comments>
		<pubDate>Thu, 20 May 2010 13:38:52 +0000</pubDate>
		<dc:creator>blogfordotnet</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogfordotnet.wordpress.com/?p=34</guid>
		<description><![CDATA[EXEC sp_dboption &#8220;HereGoesYourDBName&#8221;, &#8220;read only&#8221;, &#8220;True/False&#8221;;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogfordotnet.wordpress.com&amp;blog=13702234&amp;post=34&amp;subd=blogfordotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><span style="color:#ff0000;">EXEC </span></strong><span style="color:#0000ff;">sp_dboption</span> <span style="color:#339966;">&#8220;HereGoesYourDBName&#8221;</span>, <span style="color:#339966;">&#8220;read only&#8221;</span>, <span style="color:#339966;">&#8220;True/False&#8221;</span>;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/blogfordotnet.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/blogfordotnet.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/blogfordotnet.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/blogfordotnet.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/blogfordotnet.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/blogfordotnet.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/blogfordotnet.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/blogfordotnet.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/blogfordotnet.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/blogfordotnet.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/blogfordotnet.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/blogfordotnet.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/blogfordotnet.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/blogfordotnet.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogfordotnet.wordpress.com&amp;blog=13702234&amp;post=34&amp;subd=blogfordotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blogfordotnet.wordpress.com/2010/05/20/set-a-mssql-database-as-read-only/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3d6276a2c350c070b77809981fb91e64?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">blogfordotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>Disable script debbuging in Visual Stuio 2008 and IE8</title>
		<link>http://blogfordotnet.wordpress.com/2010/05/16/disable-script-debbuging-in-visual-stuio-2008-and-ie8/</link>
		<comments>http://blogfordotnet.wordpress.com/2010/05/16/disable-script-debbuging-in-visual-stuio-2008-and-ie8/#comments</comments>
		<pubDate>Sun, 16 May 2010 16:55:19 +0000</pubDate>
		<dc:creator>blogfordotnet</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogfordotnet.wordpress.com/?p=29</guid>
		<description><![CDATA[  You may have noticed the huge tree of constantly appearing script documents in Visual Studio 2008. Script debugging is a great feature of Visual Studio, but it can as well slow down dramatically project execution. There are several ways &#8230; <a href="http://blogfordotnet.wordpress.com/2010/05/16/disable-script-debbuging-in-visual-stuio-2008-and-ie8/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogfordotnet.wordpress.com&amp;blog=13702234&amp;post=29&amp;subd=blogfordotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p> </p>
<p>You may have noticed the huge tree of constantly appearing script documents in Visual Studio 2008. Script debugging is a great feature of Visual Studio, but it can as well slow down dramatically project execution. There are several ways you can turn that off.</p>
<p>The first method requires that you have Silverlight 2 Tools for Visual Studio 2008 SP1. You can get them here:</p>
<p><a href="http://www.microsoft.com/downloads/details.aspx?familyid=C22D6A7B-546F-4407-8EF6-D60C8EE221ED&amp;displaylang=en">http://www.microsoft.com/downloads/details.aspx?familyid=C22D6A7B-546F-4407-8EF6-D60C8EE221ED&amp;displaylang=en</a></p>
<p>In project properties go to Start Options and click &#8216;Silverlight&#8217; at the bottom of the screen. The debugger can&#8217;t simultaneously debug Silverlight and Scripts and this will shut down script debugging. This method would allow you to turn on and off debugging of scripts.</p>
<p>The other method:</p>
<p>* Start command prompt (start-&gt;run, cmd.exe). On a 64 bit Windows run (start-&gt;run, c:\windows\syswow64\cmd.exe)<br />
<span style="color:#0000ff;">* reg add HKLM\SOFTWARE\Microsoft\VisualStudio\9.0\AD7Metrics\Engine\{F200A7E7-DEA5-11D0-B854-00A0244A1DE2} /v ProgramProvider /d {4FF9DEF4-8922-4D02-9379-3FFA64D1D639} /f</span></p>
<p>If you use Visual Web Developer Express, change &#8216;VisualStudio&#8217; with &#8216;VWDExpress&#8217;:</p>
<p><span style="color:#0000ff;">* reg add HKLM\SOFTWARE\Microsoft\VWDExpress\9.0\AD7Metrics\Engine\{F200A7E7-DEA5-11D0-B854-00A0244A1DE2} /v ProgramProvider /d {4FF9DEF4-8922-4D02-9379-3FFA64D1D639} /f</span></p>
<p>If you would like to turn on script debugging again:</p>
<p><span style="color:#0000ff;">* reg add HKLM\SOFTWARE\Microsoft\VisualStudio\9.0\AD7Metrics\Engine\{F200A7E7-DEA5-11D0-B854-00A0244A1DE2} /v ProgramProvider /d {170EC3FC-4E80-40AB-A85A-55900C7C70DE} /f</span></p>
<p>Ако искате да изключите само генерирането на &#8216;anonymous code&#8217; нодове, вместо да изключите изцяло дебъгването на скриптове:<br />
(трябва да имате инсталиран Visual Studio 2008 SP1)</p>
<p>If you just want to disable the &#8216;anonymous code&#8217; nodes generation (you&#8217;ll need Visual Studio 2008 SP1):</p>
<p><span style="color:#0000ff;">* reg add HKCU\Software\Microsoft\VisualStudio\9.0\Debugger /v HideAnonymousScriptCodeNodes /t REG_DWORD /d 1 /f</span></p>
<div>
<div><a rel="tag" href="http://activeserverpagesdotnet.blogspot.com/search/label/%D0%B8%D0%B7%D0%BA%D0%BB%D1%8E%D1%87%D0%B2%D0%B0%D0%BD%D0%B5%20%D0%B4%D0%B5%D0%B1%D1%8A%D0%B3%20javascript%20script"></a></div>
<p> </p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/blogfordotnet.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/blogfordotnet.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/blogfordotnet.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/blogfordotnet.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/blogfordotnet.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/blogfordotnet.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/blogfordotnet.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/blogfordotnet.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/blogfordotnet.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/blogfordotnet.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/blogfordotnet.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/blogfordotnet.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/blogfordotnet.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/blogfordotnet.wordpress.com/29/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogfordotnet.wordpress.com&amp;blog=13702234&amp;post=29&amp;subd=blogfordotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blogfordotnet.wordpress.com/2010/05/16/disable-script-debbuging-in-visual-stuio-2008-and-ie8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3d6276a2c350c070b77809981fb91e64?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">blogfordotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>ASP inline tags explained</title>
		<link>http://blogfordotnet.wordpress.com/2010/05/16/asp-inline-tags-explained/</link>
		<comments>http://blogfordotnet.wordpress.com/2010/05/16/asp-inline-tags-explained/#comments</comments>
		<pubDate>Sun, 16 May 2010 16:41:57 +0000</pubDate>
		<dc:creator>blogfordotnet</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogfordotnet.wordpress.com/?p=27</guid>
		<description><![CDATA[There are a couple of inline tags and here they are quickly explained: &#60;% &#8230; %&#62; This is the basic asp tag, which is used to execute normal code in the aspx page: &#60;% if (User.IsInRole(&#8220;admin&#8221;)) { %&#62; You can &#8230; <a href="http://blogfordotnet.wordpress.com/2010/05/16/asp-inline-tags-explained/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogfordotnet.wordpress.com&amp;blog=13702234&amp;post=27&amp;subd=blogfordotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There are a couple of inline tags and here they are quickly explained:<br />
<span style="color:#993300;"><strong>&lt;% &#8230; %&gt; </strong><br />
<strong></strong></span></p>
<p>This is the basic asp tag, which is used to execute normal code in the aspx page:</p>
<p><span style="color:#993300;">&lt;% if (User.IsInRole(&#8220;admin&#8221;)) { %&gt;<br />
You can see this<br />
&lt;% } else { %&gt;<br />
You are no admin fool!<br />
&lt;%} %&gt;<br />
</span><br />
<a href="http://msdn2.microsoft.com/en-us/library/ms178135(vs.80).aspx">http://msdn2.microsoft.com/en-us/library/ms178135(vs.80).aspx</a></p>
<p><strong><span style="color:#993300;">&lt;%= &#8230; %&gt;</span></strong></p>
<p>This tag is used to get the value of a variable or display a property of a control (i.e. TextBox1.Text)</p>
<p><span style="color:#993300;">The Date is now &lt;%= DateTime.Now.ToShortDateString() %&gt;<br />
The value of string1 is &lt;%= string1 %&gt;</span></p>
<p><a href="http://msdn2.microsoft.com/en-us/library/6dwsdcf5(VS.71).aspx">http://msdn2.microsoft.com/en-us/library/6dwsdcf5(VS.71).aspx</a></p>
<p>*<em>Note: &lt;%= is equivalent to Response.Write()</em></p>
<p><span style="color:#993300;"><strong>&lt;%# .. %&gt; </strong><br />
</span></p>
<p>This is one is used for so called binding expressions (Bind and Eval). Like in a GridView template column, when you want to set the text property of a label to the value of the column in the datasource:</p>
<p>It&#8217;s used in GridView, Repeater, DetailsView и т.н.</p>
<p><span style="color:#993300;">&lt;asp:Repeater ID=&#8221;rptMeetings&#8221; DataSourceID=&#8221;meetings&#8221; runat=&#8221;server&#8221;&gt;<br />
&lt;ItemTemplate&gt;<br />
&lt;%# Eval(&#8220;MeetingName&#8221;) %&gt;<br />
&lt;/ItemTemplate&gt;<br />
&lt;/asp:Repeater&gt;<br />
</span></p>
<p><a href="http://msdn2.microsoft.com/en-us/library/ms178366.aspx">http://msdn2.microsoft.com/en-us/library/ms178366.aspx</a></p>
<p><strong><span style="color:#993300;">&lt;%$ &#8230; %&gt;</span><br />
</strong>Used for expressions, not code; often seen with DataSources:</p>
<p>&lt;asp:SqlDataSource ID=&#8221;party&#8221; runat=&#8221;server&#8221; ConnectionString=&#8221;&lt;%$ ConnectionStrings:letsParty %&gt;&#8221; SelectCommand=&#8221;SELECT * FROM [table]&#8221; /&gt;</p>
<p><a href="http://msdn2.microsoft.com/en-us/library/d5bd1tad.aspx">http://msdn2.microsoft.com/en-us/library/d5bd1tad.aspx</a></p>
<p><strong><span style="color:#993300;">&lt;%@ &#8230; %&gt;</span> </strong><br />
<strong></strong></p>
<p>This one is used for descriptions or directives, or simply said the things you see on top of each of your aspx pages.</p>
<p><span style="color:#993300;">&lt;%@ Page Language=&#8221;C#&#8221; MasterPageFile=&#8221;~/MasterPage.master&#8221; AutoEventWireup=&#8221;true&#8221; CodeFile=&#8221;Default.aspx.cs&#8221; Inherits=&#8221;_Default&#8221; Title=&#8221;Untitled Page&#8221; %&gt;<br />
&lt;%@ Register TagPrefix=&#8221;wp&#8221; Namespace=&#8221;CustomWebParts&#8221; %&gt;</span></p>
<p><a href="http://msdn2.microsoft.com/en-us/library/xz702w3e(VS.80).aspx">http://msdn2.microsoft.com/en-us/library/xz702w3e(VS.80).aspx</a></p>
<p><strong><span style="color:#993300;">&lt;%&#8211; &#8230; &#8211;%&gt;<br />
</span></strong></p>
<p>This is a server side comment.</p>
<p><span style="color:#993300;">&lt;asp:Label ID=&#8221;lblAwesome&#8221; runat=&#8221;server&#8221; /&gt;<br />
&lt;%&#8211; sometimes end users make me angry &#8211;%&gt;<br />
&lt;asp:LinkButton ID=&#8221;lbEdit&#8221; Text=&#8221;Edit&#8221; OnClick=&#8221;Edit_Click&#8221; runat=&#8221;server&#8221; /&gt;</span><br />
<a href="http://msdn2.microsoft.com/en-us/library/4acf8afk.aspx">http://msdn2.microsoft.com/en-us/library/4acf8afk.aspx</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/blogfordotnet.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/blogfordotnet.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/blogfordotnet.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/blogfordotnet.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/blogfordotnet.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/blogfordotnet.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/blogfordotnet.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/blogfordotnet.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/blogfordotnet.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/blogfordotnet.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/blogfordotnet.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/blogfordotnet.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/blogfordotnet.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/blogfordotnet.wordpress.com/27/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogfordotnet.wordpress.com&amp;blog=13702234&amp;post=27&amp;subd=blogfordotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blogfordotnet.wordpress.com/2010/05/16/asp-inline-tags-explained/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3d6276a2c350c070b77809981fb91e64?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">blogfordotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>A Simple C# Labyrinth/Maze Solving Application</title>
		<link>http://blogfordotnet.wordpress.com/2010/05/16/a-simple-c-labyrinthmaze-solving-application/</link>
		<comments>http://blogfordotnet.wordpress.com/2010/05/16/a-simple-c-labyrinthmaze-solving-application/#comments</comments>
		<pubDate>Sun, 16 May 2010 16:31:27 +0000</pubDate>
		<dc:creator>blogfordotnet</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogfordotnet.wordpress.com/?p=22</guid>
		<description><![CDATA[This is a simple application where by clicking you can create a maze using a GridView control. Cells have either true or false values. The ones with false ones represent the passable areas and the true-valued ones are so to &#8230; <a href="http://blogfordotnet.wordpress.com/2010/05/16/a-simple-c-labyrinthmaze-solving-application/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogfordotnet.wordpress.com&amp;blog=13702234&amp;post=22&amp;subd=blogfordotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[
<a href='http://blogfordotnet.wordpress.com/2010/05/16/a-simple-c-labyrinthmaze-solving-application/mazeapp_small/' title='MazeApp_small'><img data-attachment-id='23' data-orig-size='640,476' data-liked='0'width="150" height="111" src="http://blogfordotnet.files.wordpress.com/2010/05/mazeapp_small.gif?w=150&#038;h=111" class="attachment-thumbnail" alt="MazeApp_small" title="MazeApp_small" /></a>
<a href='http://blogfordotnet.wordpress.com/2010/05/16/a-simple-c-labyrinthmaze-solving-application/mazeapp_small-2/' title='MazeApp_small'><img data-attachment-id='24' data-orig-size='640,476' data-liked='0'width="150" height="111" src="http://blogfordotnet.files.wordpress.com/2010/05/mazeapp_small1.gif?w=150&#038;h=111" class="attachment-thumbnail" alt="MazeApp_small" title="MazeApp_small" /></a>

<p>This is a simple application where by clicking you can create a maze using a GridView control. Cells have either true or false values. The ones with false ones represent the passable areas and the true-valued ones are so to say the walls. Most importantly, of course, the maze gets solved. Background I have accidentally landed once on an article regarding maze solving algorithms. I decided to try and find a solution myself. Using the Code As I have explained earlier in the introduction, the maze is represented by a GridView control, false-valued cells being the passable areas. You create your own paths and crossroads by clicking each individual cell. The movement is represented by changing the style of the current cell and changing the x, y coordinates according to the passable areas. The rules that the &#8220;algorithm&#8221; follow are:</p>
<p> 1.It stores all the visited coordinates (KeyValuePair of integers)</p>
<p>2.It marks the crossroads (KeyValuePair of integers) it goes by and when a blockage is recognized, it goes back to the last crossroad and continues &#8220;moving&#8221; if possible.</p>
<p>3.It has one main method which is being called recursively to perform the movement. We also have 4 supporting methods called: LookLeft(), LookRight(), LookUp(), LookDown() which return boolean and perform a move by changing x, y int variables corresponding to the coordinates of cell and row indices and depending on the result, call each other in this GoMove() main method.</p>
<p>4.To recognize a blockage on the path taken, the program uses CanLookRight(), CanLookLeft(), etc. methods which also return boolean values. The only difference they have to the previously mentioned methods is that they don&#8217;t change the x,y variables and perform no actual &#8220;movement&#8221; on the GridView. This is the main GoMove method which uses the supporting LookLeft, etc. supporting methods and calls itself recursively to perform movement on the passable areas:</p>
<pre><span style="color:#008000;">// we run this method on a separate thread to avoid "hanging" in the form
</span>void GoMove0()
{
    CheckForIllegalCrossThreadCalls = false;
    if (x == 0 &amp;&amp; y == 0)
    {
        return;
    }

    if (hasPassed)
    {
        if (z &lt; crossroads.Count)
        {
<span style="color:#008000;">#region [ checks if it has stucked up ]
</span>            if (!CanLookUp()) // checks if it can go up
            {
                if (!CanLookRight()) // checks if it can go right
                {
                    if (!CanLookLeft()) // checks if it can go left
                    {
                        if (!LookDown()) // checks if it can go down;
<span style="color:#008000;">// if true goes all the way</span>
                        { <span style="color:#008000;">// sets the current coordinates to those of the
</span><span style="color:#008000;">// last visited crossroad and calls the method again.
</span>                            y = crossroads[z].Key;
                            x = crossroads[z].Value;
                            z++;

                            GoMove0();
                        }
                    }
                }
            }
<span style="color:#008000;">#endregion
#region [ checks if it has stucked down ]
</span>            if (!CanLookDown())
            {
                if (!CanLookRight())
                {
                    if (!CanLookLeft())
                    {
                        if (!LookUp())
                        {
                            y = crossroads[z].Key;
                            x = crossroads[z].Value;
                            z++;

                            GoMove0();
                        }
                    }
                }
            }
<span style="color:#008000;">#endregion
#region [ checks if it has stucked left ]</span>
            if (!CanLookLeft())
            {
                if (!CanLookUp())
                {
                    if (!CanLookDown())
                    {
                        if (!LookRight())
                        {
                            y = crossroads[z].Key;
                            x = crossroads[z].Value;
                            z++;

                            GoMove0();
                        }
                    }
                }
            }
<span style="color:#008000;">#endregion
#region [ checks if it has stucked right ]</span>
            if (!CanLookRight())
            {
                if (!CanLookUp())
                {
                    if (!CanLookDown())
                    {
                        if (!LookLeft())
                        {
                            y = crossroads[z].Key;
                            x = crossroads[z].Value;
                            z++;

                            GoMove0();
                        }
                    }
                }
            }
<span style="color:#008000;">#endregion</span>
        }
    }
    hasPassed = true;
    if (LookUp()) // goes all the way up
    {
        if (!LookLeft())
<span style="color:#008000;"> // it went all the way up tries left,
// if not goes right if possible</span>
        {
            LookRight();
        }

        GoMove0(); // recursive call to continue movement
        return;
    }
    if (LookDown())
    {
        if (!LookLeft())
        {
            LookRight();
        }
        GoMove0();
        return;
    }
    if (LookRight())
    {
        if (!LookDown())
        {
            LookUp();
        }
        GoMove0();
        return;
    }
    if (LookLeft())
    {
        if (!LookDown())
        {
            LookUp();
        }
        GoMove0();
        return;
    }
}

bool LookLeft()
{
bool hasMoved = false; 

try
{
<span style="color:#008000;">// checks if the following cell is a passable area
//(if the cell is false-valued)</span>
while (!checkIfVisited(x-1,y) &amp;&amp;
    Convert.ToBoolean(dataGridView1.Rows[y].Cells[x - 1].Value) == false)
{
<span style="color:#008000;">// if it hasn't visited the current coordinates, performs a 'move'
// and then sets the hasMoved flag to true;</span>
hasMoved = true;

visitedCoordinates.Add(new KeyValuePair&lt;int, int&gt;(x, y));
<span style="color:#008000;">// performs a 'move'
</span>x = x - 1;
listBox1.Items.Add("x = " + x.ToString() + "\t\ty = " + y.ToString());

<span style="color:#008000;">// sets a distinguished style for the visited cell</span>
dataGridView1.Rows[y].Cells[x].Style = style2;
<span style="color:#008000;">// set it's value to true</span>
dataGridView1.Rows[y].Cells[x].Value = true;
<span style="color:#008000;">// puts the thread to sleep to get that sleek move feel</span>
System.Threading.Thread.Sleep(Convert.ToInt16(textBoxSpeed.Text)); 

<span style="color:#008000;">#endregion
// checks for crosssroads on the way</span>
if ((bool)dataGridView1.Rows[y].Cells[x - 1].Value == false)
{
<span style="color:#008000;">// if a passing on the upper side cell has false value we then have
// a 'T' shaped crossroad and add its coordinates to the list</span>
if ((bool)dataGridView1.Rows[y + 1].Cells[x].Value == false)
{
dataGridView1.Rows[y + 1].Cells[x].Style = style3;
crossroads.Add(new KeyValuePair&lt;int, int&gt;(y + 1, x));
listBox2.Items.Add("x = " + x.ToString() + " y = " +
(y + 1).ToString());
}
<span style="color:#008000;">// if an underlying cell has false value we then have
// a 'T' shaped crossroad and add its coordinates to the list</span>
if ((bool)dataGridView1.Rows[y - 1].Cells[x].Value == false)
{
dataGridView1.Rows[y - 1].Cells[x].Style = style3;
crossroads.Add(new KeyValuePair&lt;int, int&gt;(y - 1, x));
listBox2.Items.Add("x = " + x.ToString() + " y = " +
(y - 1).ToString());
}
}
}
if (hasMoved)
{
return true;
}
else
return false;
}
catch
{
if (hasMoved)
{
return true;
}
else
return false;
}
}</pre>
<p>You can also save the mazes you create as <em>*.txt</em> files and then load them into the application. Here are 2 sample mazes I have created which you can load and test right away after downloading the VS 2008 solution. You can also adjust the speed (cell per millisecond) the maze is being solved.</p>
<p>Download the complete source here:</p>
<p><a href="http://www.myhomebills.info/mazesolver.rar">http://www.myhomebills.info/mazesolver.rar</a></p>
<p>Read my article at CodeProject here:</p>
<p><a href="http://www.codeproject.com/KB/grid/Labyrinth-Solver.aspx">http://www.codeproject.com/KB/grid/Labyrinth-Solver.aspx</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/blogfordotnet.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/blogfordotnet.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/blogfordotnet.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/blogfordotnet.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/blogfordotnet.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/blogfordotnet.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/blogfordotnet.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/blogfordotnet.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/blogfordotnet.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/blogfordotnet.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/blogfordotnet.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/blogfordotnet.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/blogfordotnet.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/blogfordotnet.wordpress.com/22/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogfordotnet.wordpress.com&amp;blog=13702234&amp;post=22&amp;subd=blogfordotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blogfordotnet.wordpress.com/2010/05/16/a-simple-c-labyrinthmaze-solving-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3d6276a2c350c070b77809981fb91e64?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">blogfordotnet</media:title>
		</media:content>

		<media:content url="http://blogfordotnet.files.wordpress.com/2010/05/mazeapp_small.gif?w=150" medium="image">
			<media:title type="html">MazeApp_small</media:title>
		</media:content>

		<media:content url="http://blogfordotnet.files.wordpress.com/2010/05/mazeapp_small1.gif?w=150" medium="image">
			<media:title type="html">MazeApp_small</media:title>
		</media:content>
	</item>
		<item>
		<title>Edit event not firing when we set the DataSource of a GridView programmatically</title>
		<link>http://blogfordotnet.wordpress.com/2010/05/16/edit-event-not-firing-when-we-set-the-datasource-of-a-gridview-programmatically/</link>
		<comments>http://blogfordotnet.wordpress.com/2010/05/16/edit-event-not-firing-when-we-set-the-datasource-of-a-gridview-programmatically/#comments</comments>
		<pubDate>Sun, 16 May 2010 10:18:51 +0000</pubDate>
		<dc:creator>blogfordotnet</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogfordotnet.wordpress.com/?p=20</guid>
		<description><![CDATA[If you set the DataSource of a GridView programmatically like this:  GridView1.DataSource = someDataTable GridView1.DataBind() And if we put, let&#8217;s say a template field insite a GridView and a LinkButton, which has its CommanName property set to &#8220;Edit&#8221;. So far &#8230; <a href="http://blogfordotnet.wordpress.com/2010/05/16/edit-event-not-firing-when-we-set-the-datasource-of-a-gridview-programmatically/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogfordotnet.wordpress.com&amp;blog=13702234&amp;post=20&amp;subd=blogfordotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you set the DataSource of a GridView programmatically like this: </p>
<pre><span style="color:#000080;">GridView1.DataSource = someDataTable</span>
<span style="color:#000080;">GridView1.DataBind()</span></pre>
<p>And if we put, let&#8217;s say a template field insite a GridView and a LinkButton, which has its CommanName property set to &#8220;Edit&#8221;. So far so good, but if you click on your edit LinkButton the GridView won&#8217;t go in EditMode. </p>
<p>You have to do two things: </p>
<p>put a RowEditing EventHandler: </p>
<pre><span style="color:#000080;">Protected Sub GridView1_RowEditing(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GridView1.RowEditing</span></pre>
<p>and put the following line it, which would set the EditIndex of our GridView and put it in EditMode: </p>
<pre><span style="color:#000080;">GridViewListItems.EditIndex = e.NewEditIndex</span></pre>
<p><span style="font-size:x-small;">And then rebind the GridView. </p>
<p>If you the want to exit EditMode just set <strong><span style="color:#000080;">GridViewListItems.EditIndex = -1</span></strong> </p>
<p></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/blogfordotnet.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/blogfordotnet.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/blogfordotnet.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/blogfordotnet.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/blogfordotnet.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/blogfordotnet.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/blogfordotnet.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/blogfordotnet.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/blogfordotnet.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/blogfordotnet.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/blogfordotnet.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/blogfordotnet.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/blogfordotnet.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/blogfordotnet.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogfordotnet.wordpress.com&amp;blog=13702234&amp;post=20&amp;subd=blogfordotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blogfordotnet.wordpress.com/2010/05/16/edit-event-not-firing-when-we-set-the-datasource-of-a-gridview-programmatically/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3d6276a2c350c070b77809981fb91e64?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">blogfordotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>is not a valid Win32 application. (Exception from HRESULT: 0x800700C1) Exception Details: System.BadImageFormatException: is not a valid Win32 application</title>
		<link>http://blogfordotnet.wordpress.com/2010/05/16/is-not-a-valid-win32-application-exception-from-hresult-0x800700c1-exception-details-system-badimageformatexception-is-not-a-valid-win32-application/</link>
		<comments>http://blogfordotnet.wordpress.com/2010/05/16/is-not-a-valid-win32-application-exception-from-hresult-0x800700c1-exception-details-system-badimageformatexception-is-not-a-valid-win32-application/#comments</comments>
		<pubDate>Sun, 16 May 2010 10:08:41 +0000</pubDate>
		<dc:creator>blogfordotnet</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogfordotnet.wordpress.com/?p=18</guid>
		<description><![CDATA[Have you come accross this error? If  you perhaps have a 64 bit machine and use IIS 7+ and/or have migrated an application from 1.1 to 2.0 then this should be your case: 1. In Windows 7 в IIS (7) &#8230; <a href="http://blogfordotnet.wordpress.com/2010/05/16/is-not-a-valid-win32-application-exception-from-hresult-0x800700c1-exception-details-system-badimageformatexception-is-not-a-valid-win32-application/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogfordotnet.wordpress.com&amp;blog=13702234&amp;post=18&amp;subd=blogfordotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Have you come accross this error? If  you perhaps have a 64 bit machine and use IIS 7+ and/or have migrated an application from 1.1 to 2.0 then this should be your case:</p>
<h2>1. In Windows 7 в IIS (7) open Application Pools.<br />
2. Locate the Application Pool-а which your application uses<br />
3. Click on Advanced Settings on the right.<br />
4. Set Enable 32-Bit Applications to true.</h2>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/blogfordotnet.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/blogfordotnet.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/blogfordotnet.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/blogfordotnet.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/blogfordotnet.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/blogfordotnet.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/blogfordotnet.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/blogfordotnet.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/blogfordotnet.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/blogfordotnet.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/blogfordotnet.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/blogfordotnet.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/blogfordotnet.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/blogfordotnet.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogfordotnet.wordpress.com&amp;blog=13702234&amp;post=18&amp;subd=blogfordotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blogfordotnet.wordpress.com/2010/05/16/is-not-a-valid-win32-application-exception-from-hresult-0x800700c1-exception-details-system-badimageformatexception-is-not-a-valid-win32-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3d6276a2c350c070b77809981fb91e64?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">blogfordotnet</media:title>
		</media:content>
	</item>
		<item>
		<title>Visual Studio crashes and hangs after Office 2010 installation</title>
		<link>http://blogfordotnet.wordpress.com/2010/05/16/visual-studio-crashes-and-hangs-after-office-2010-installation/</link>
		<comments>http://blogfordotnet.wordpress.com/2010/05/16/visual-studio-crashes-and-hangs-after-office-2010-installation/#comments</comments>
		<pubDate>Sun, 16 May 2010 10:04:37 +0000</pubDate>
		<dc:creator>blogfordotnet</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogfordotnet.wordpress.com/?p=16</guid>
		<description><![CDATA[Sometimes Visual Studio 2008 happens to crash, after you have installed ot upgraded to Office 2010. This happens when you try to view the design of an apsx page. This is due to some changes the installer makes to the &#8230; <a href="http://blogfordotnet.wordpress.com/2010/05/16/visual-studio-crashes-and-hangs-after-office-2010-installation/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogfordotnet.wordpress.com&amp;blog=13702234&amp;post=16&amp;subd=blogfordotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sometimes Visual Studio 2008 happens to crash, after you have installed ot upgraded to Office 2010. This happens when you try to view the design of an apsx page.</p>
<p>This is due to some changes the installer makes to the “Microsoft Visual Studio Web Authoring Component”, which is part of Office 2007. A simple solution is to repair its installation. Just go to:</p>
<pre><strong><span style="color:#993300;">Windows 64bit
</span>C:\Program Files (x86)\Common Files\microsoft shared\OFFICE12\Office Setup Controller\Setup.exe
<span style="color:#993300;">Windows 32bit</span>
C:\Program Files\Common Files\microsoft shared\OFFICE12\Office Setup Controller\Setup.exe</strong></pre>
<p>and do a repair.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/blogfordotnet.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/blogfordotnet.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/blogfordotnet.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/blogfordotnet.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/blogfordotnet.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/blogfordotnet.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/blogfordotnet.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/blogfordotnet.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/blogfordotnet.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/blogfordotnet.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/blogfordotnet.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/blogfordotnet.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/blogfordotnet.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/blogfordotnet.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blogfordotnet.wordpress.com&amp;blog=13702234&amp;post=16&amp;subd=blogfordotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blogfordotnet.wordpress.com/2010/05/16/visual-studio-crashes-and-hangs-after-office-2010-installation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3d6276a2c350c070b77809981fb91e64?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">blogfordotnet</media:title>
		</media:content>
	</item>
	</channel>
</rss>
