<?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/"
	>

<channel>
	<title>Shawson&#039;s Code Blog &#187; VB.net</title>
	<atom:link href="http://codeblog.shawson.co.uk/category/net/vb-net/feed/" rel="self" type="application/rss+xml" />
	<link>http://codeblog.shawson.co.uk</link>
	<description>development notes for my failing memory</description>
	<lastBuildDate>Wed, 01 Feb 2012 11:00:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Uh Oh! Important: ASP.NET Security Vulnerability &#8211; ScottGu&#8217;s Blog</title>
		<link>http://codeblog.shawson.co.uk/uh-oh-important-asp-net-security-vulnerability-scottgus-blog/</link>
		<comments>http://codeblog.shawson.co.uk/uh-oh-important-asp-net-security-vulnerability-scottgus-blog/#comments</comments>
		<pubDate>Sat, 18 Sep 2010 17:33:44 +0000</pubDate>
		<dc:creator>shawson</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[C#.net]]></category>
		<category><![CDATA[VB.net]]></category>

		<guid isPermaLink="false">http://www.shawson.co.uk/codeblog/?p=793</guid>
		<description><![CDATA[Important: ASP.NET Security Vulnerability &#8211; ScottGu&#8217;s Blog. Related posts:The provided URI scheme &#8216;http&#8217; is invalid; expected &#8216;https World of VS: Make it easy to change the default browser in Visual Studio Blog My shiny new blog


Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/the-provided-uri-scheme-http-is-invalid-expected-https/' rel='bookmark' title='The provided URI scheme &#8216;http&#8217; is invalid; expected &#8216;https'>The provided URI scheme &#8216;http&#8217; is invalid; expected &#8216;https</a></li>
<li><a href='http://codeblog.shawson.co.uk/world-of-vs-make-it-easy-to-change-the-default-browser-in-visual-studio-blog/' rel='bookmark' title='World of VS: Make it easy to change the default browser in Visual Studio Blog'>World of VS: Make it easy to change the default browser in Visual Studio Blog</a></li>
<li><a href='http://codeblog.shawson.co.uk/my-shiny-new-blog/' rel='bookmark' title='My shiny new blog'>My shiny new blog</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p><a href="http://weblogs.asp.net/scottgu/archive/2010/09/18/important-asp-net-security-vulnerability.aspx">Important: ASP.NET Security Vulnerability &#8211; ScottGu&#8217;s Blog</a>.</p>


<p>Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/the-provided-uri-scheme-http-is-invalid-expected-https/' rel='bookmark' title='The provided URI scheme &#8216;http&#8217; is invalid; expected &#8216;https'>The provided URI scheme &#8216;http&#8217; is invalid; expected &#8216;https</a></li>
<li><a href='http://codeblog.shawson.co.uk/world-of-vs-make-it-easy-to-change-the-default-browser-in-visual-studio-blog/' rel='bookmark' title='World of VS: Make it easy to change the default browser in Visual Studio Blog'>World of VS: Make it easy to change the default browser in Visual Studio Blog</a></li>
<li><a href='http://codeblog.shawson.co.uk/my-shiny-new-blog/' rel='bookmark' title='My shiny new blog'>My shiny new blog</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://codeblog.shawson.co.uk/uh-oh-important-asp-net-security-vulnerability-scottgus-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running vb.net alongside c# in a web app</title>
		<link>http://codeblog.shawson.co.uk/running-vb-net-alongside-c-in-a-web-app/</link>
		<comments>http://codeblog.shawson.co.uk/running-vb-net-alongside-c-in-a-web-app/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 10:42:41 +0000</pubDate>
		<dc:creator>shawson</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[C#.net]]></category>
		<category><![CDATA[VB.net]]></category>

		<guid isPermaLink="false">http://www.shawson.co.uk/codeblog/?p=328</guid>
		<description><![CDATA[via The ASP.NET Capsule #18: Running C# &#38; VB.NET in the same web application &#8211; Jose R. Guay Paz. Great snippet to wack in the web.config file, which allows you to run c# and vb.net code (*spit* ) in the same web project; &#60;system.codedom&#62; &#60;compilers&#62; &#60;compiler language=&#34;c#;cs;csharp&#34; extension=&#34;.cs&#34; type=&#34;Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&#34; warningLevel=&#34;4&#34;&#62; &#60;providerOption [...]


Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/stop-the-web-config-being-inherited-by-child-applications-in-sub-folders/' rel='bookmark' title='Stop the &#8220;web.config&#8221; being inherited by child applications in sub folders'>Stop the &#8220;web.config&#8221; being inherited by child applications in sub folders</a></li>
<li><a href='http://codeblog.shawson.co.uk/referencing-custom-properties-on-a-master-page-from-the-child-page/' rel='bookmark' title='Referencing custom properties on a Master page from the Child page'>Referencing custom properties on a Master page from the Child page</a></li>
<li><a href='http://codeblog.shawson.co.uk/the-provided-uri-scheme-http-is-invalid-expected-https/' rel='bookmark' title='The provided URI scheme &#8216;http&#8217; is invalid; expected &#8216;https'>The provided URI scheme &#8216;http&#8217; is invalid; expected &#8216;https</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>via <a href="http://weblogs.asp.net/joseguay/archive/2009/08/03/the-asp-net-capsule-18-running-c-amp-vb-net-in-the-same-web-application.aspx">The ASP.NET Capsule #18: Running C# &amp; VB.NET in the same web application &#8211; Jose R. Guay Paz</a>.</p>
<p>Great snippet to wack in the web.config file, which allows you to run c# and vb.net code (*spit* <img src='http://codeblog.shawson.co.uk/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  ) in the same web project;</p>
<pre class="brush: xml">

&lt;system.codedom&gt;
&lt;compilers&gt;

&lt;compiler language=&quot;c#;cs;csharp&quot; extension=&quot;.cs&quot;  type=&quot;Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot; warningLevel=&quot;4&quot;&gt;
     &lt;providerOption name=&quot;CompilerVersion&quot; value=&quot;v3.5&quot; /&gt;
     &lt;providerOption name=&quot;WarnAsError&quot; value=&quot;false&quot; /&gt;
&lt;/compiler&gt;

&lt;compiler language=&quot;vb;vbs;visualbasic;vbscript&quot; extension=&quot;.vb&quot; type=&quot;Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot; warningLevel=&quot;4&quot;&gt;
     &lt;providerOption name=&quot;CompilerVersion&quot; value=&quot;v3.5&quot; /&gt;
     &lt;providerOption name=&quot;OptionInfer&quot; value=&quot;true&quot; /&gt;
     &lt;providerOption name=&quot;WarnAsError&quot; value=&quot;false&quot; /&gt;
&lt;/compiler&gt;

&lt;/compilers&gt;
&lt;/system.codedom&gt;
</pre>


<p>Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/stop-the-web-config-being-inherited-by-child-applications-in-sub-folders/' rel='bookmark' title='Stop the &#8220;web.config&#8221; being inherited by child applications in sub folders'>Stop the &#8220;web.config&#8221; being inherited by child applications in sub folders</a></li>
<li><a href='http://codeblog.shawson.co.uk/referencing-custom-properties-on-a-master-page-from-the-child-page/' rel='bookmark' title='Referencing custom properties on a Master page from the Child page'>Referencing custom properties on a Master page from the Child page</a></li>
<li><a href='http://codeblog.shawson.co.uk/the-provided-uri-scheme-http-is-invalid-expected-https/' rel='bookmark' title='The provided URI scheme &#8216;http&#8217; is invalid; expected &#8216;https'>The provided URI scheme &#8216;http&#8217; is invalid; expected &#8216;https</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://codeblog.shawson.co.uk/running-vb-net-alongside-c-in-a-web-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The provided URI scheme &#8216;http&#8217; is invalid; expected &#8216;https</title>
		<link>http://codeblog.shawson.co.uk/the-provided-uri-scheme-http-is-invalid-expected-https/</link>
		<comments>http://codeblog.shawson.co.uk/the-provided-uri-scheme-http-is-invalid-expected-https/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 16:28:26 +0000</pubDate>
		<dc:creator>shawson</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[C#.net]]></category>
		<category><![CDATA[VB.net]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://www.shawson.co.uk/codeblog/?p=207</guid>
		<description><![CDATA[Going from dev to live, where the dev system referenced dev version of web services, but the live system has to reference live versions which are HTTPS i recieved this error; The provided URI scheme &#8216;http&#8217; is invalid; expected &#8216;https This is resolved simply by updating the web.config file and setting the security tag&#8217;s mode [...]


Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/making-your-wcf-service-compatible-with-legacy-net-1-1-applications/' rel='bookmark' title='Making your WCF Service compatible with legacy .net 1.1 applications'>Making your WCF Service compatible with legacy .net 1.1 applications</a></li>
<li><a href='http://codeblog.shawson.co.uk/wcf-services-with-json-and-soap-endpoints/' rel='bookmark' title='WCF Services with both JSON and SOAP endpoints'>WCF Services with both JSON and SOAP endpoints</a></li>
<li><a href='http://codeblog.shawson.co.uk/uh-oh-important-asp-net-security-vulnerability-scottgus-blog/' rel='bookmark' title='Uh Oh! Important: ASP.NET Security Vulnerability &#8211; ScottGu&#8217;s Blog'>Uh Oh! Important: ASP.NET Security Vulnerability &#8211; ScottGu&#8217;s Blog</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>Going from dev to live, where the dev system referenced dev version of web services, but the live system has to reference live versions which are HTTPS i recieved this error;</p>
<blockquote><p>The provided URI scheme &#8216;http&#8217; is invalid; expected &#8216;https</p></blockquote>
<p>This is resolved simply by updating the web.config file and setting the security tag&#8217;s mode attribute from None to Transport;</p>
<pre class="brush: xml">&lt;bindings&gt;
&lt;wsHttpBinding&gt;
&lt;binding name=&quot;WSHttpBinding_IWSHttpService&quot; closeTimeout=&quot;00:01:00&quot;
openTimeout=&quot;00:01:00&quot; receiveTimeout=&quot;00:10:00&quot; sendTimeout=&quot;00:01:00&quot;
bypassProxyOnLocal=&quot;false&quot; transactionFlow=&quot;false&quot; hostNameComparisonMode=&quot;StrongWildcard&quot;
maxBufferPoolSize=&quot;524288&quot; maxReceivedMessageSize=&quot;65536&quot;
messageEncoding=&quot;Text&quot; textEncoding=&quot;utf-8&quot; useDefaultWebProxy=&quot;true&quot;
allowCookies=&quot;false&quot;&gt;
&lt;readerQuotas maxDepth=&quot;32&quot; maxStringContentLength=&quot;8192&quot; maxArrayLength=&quot;16384&quot;
maxBytesPerRead=&quot;4096&quot; maxNameTableCharCount=&quot;16384&quot; /&gt;
&lt;reliableSession ordered=&quot;true&quot; inactivityTimeout=&quot;00:10:00&quot;
enabled=&quot;false&quot; /&gt;
&lt;security mode=&quot;Transport&quot;&gt;
&lt;transport clientCredentialType=&quot;None&quot; proxyCredentialType=&quot;None&quot;
realm=&quot;&quot; /&gt;
&lt;message clientCredentialType=&quot;None&quot; negotiateServiceCredential=&quot;true&quot;
algorithmSuite=&quot;Default&quot; establishSecurityContext=&quot;true&quot; /&gt;
&lt;/security&gt;
&lt;/binding&gt;
&lt;/wsHttpBinding&gt;
&lt;/bindings&gt;</pre>
<p><a href="http://social.msdn.microsoft.com/forums/en-US/wcf/thread/e46e03f7-dc6d-40fd-a718-81784fc8b154">The provided URI scheme &#8216;http&#8217; is invalid; expected &#8216;https</a>.</p>


<p>Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/making-your-wcf-service-compatible-with-legacy-net-1-1-applications/' rel='bookmark' title='Making your WCF Service compatible with legacy .net 1.1 applications'>Making your WCF Service compatible with legacy .net 1.1 applications</a></li>
<li><a href='http://codeblog.shawson.co.uk/wcf-services-with-json-and-soap-endpoints/' rel='bookmark' title='WCF Services with both JSON and SOAP endpoints'>WCF Services with both JSON and SOAP endpoints</a></li>
<li><a href='http://codeblog.shawson.co.uk/uh-oh-important-asp-net-security-vulnerability-scottgus-blog/' rel='bookmark' title='Uh Oh! Important: ASP.NET Security Vulnerability &#8211; ScottGu&#8217;s Blog'>Uh Oh! Important: ASP.NET Security Vulnerability &#8211; ScottGu&#8217;s Blog</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://codeblog.shawson.co.uk/the-provided-uri-scheme-http-is-invalid-expected-https/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Globalization &#8220;Current Culture&#8221; settings in the web.config (ASP.NET)</title>
		<link>http://codeblog.shawson.co.uk/globalization-using-aspnet/</link>
		<comments>http://codeblog.shawson.co.uk/globalization-using-aspnet/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 16:26:30 +0000</pubDate>
		<dc:creator>shawson</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[C#.net]]></category>
		<category><![CDATA[VB.net]]></category>

		<guid isPermaLink="false">http://www.shawson.co.uk/codeblog/?p=205</guid>
		<description><![CDATA[Quick example of the current culture switch in the web.config of a dot net project. &#60;configuration&#62; &#60;system.web&#62; &#60;globalization fileEncoding=&#8221;utf-8&#8243; requestEncoding=&#8221;utf-8&#8243; responseEncoding=&#8221;utf-8&#8243; culture=&#8221;en-GB&#8221; uiCulture=&#8221;en-GB&#8221;/&#62; &#60;/system.web&#62; &#60;/configuration&#62; Globalization using ASP.NET. Related posts:Localisation &#8211; American Date&#8217;s and currencies in ASP.net Stop the &#8220;web.config&#8221; being inherited by child applications in sub folders Running vb.net alongside c# in a web [...]


Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/american-dates-and-currencies-in-aspnet/' rel='bookmark' title='Localisation &#8211; American Date&#8217;s and currencies in ASP.net'>Localisation &#8211; American Date&#8217;s and currencies in ASP.net</a></li>
<li><a href='http://codeblog.shawson.co.uk/stop-the-web-config-being-inherited-by-child-applications-in-sub-folders/' rel='bookmark' title='Stop the &#8220;web.config&#8221; being inherited by child applications in sub folders'>Stop the &#8220;web.config&#8221; being inherited by child applications in sub folders</a></li>
<li><a href='http://codeblog.shawson.co.uk/running-vb-net-alongside-c-in-a-web-app/' rel='bookmark' title='Running vb.net alongside c# in a web app'>Running vb.net alongside c# in a web app</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>Quick example of the current culture switch in the web.config of a dot net project.</p>
<p><span style="font-size: x-small;"><span style="font-size: x-small;"><span style="color: #0000ff; font-size: x-small;"><span style="font-family: Verdana,Arial,Helvetica,sans-serif;">&lt;</span></span><span style="font-family: Verdana,Arial,Helvetica,sans-serif; color: #800000; font-size: x-small;">configuration</span><span style="color: #0000ff; font-size: x-small;"><span style="font-family: Verdana,Arial,Helvetica,sans-serif;">&gt;<br />
</span><span style="font-family: Verdana,Arial,Helvetica,sans-serif;">&lt;</span></span><span style="font-family: Verdana,Arial,Helvetica,sans-serif; color: #800000; font-size: x-small;">system.web</span><span style="color: #0000ff; font-size: x-small;"><span style="font-family: Verdana,Arial,Helvetica,sans-serif;">&gt;<br />
</span><span style="font-family: Verdana,Arial,Helvetica,sans-serif;">&lt;</span></span><span style="color: #800000; font-size: x-small;"><span style="font-family: Verdana,Arial,Helvetica,sans-serif;">globalization </span></span><span style="color: #ff0000; font-size: x-small;"><span style="font-family: Verdana,Arial,Helvetica,sans-serif;">fileEncoding</span></span><span style="color: #0000ff; font-size: x-small;"><span style="font-family: Verdana,Arial,Helvetica,sans-serif;">=&#8221;utf-8&#8243; </span></span><span style="color: #ff0000; font-size: x-small;"><span style="font-family: Verdana,Arial,Helvetica,sans-serif;">requestEncoding</span></span><span style="color: #0000ff; font-size: x-small;"><span style="font-family: Verdana,Arial,Helvetica,sans-serif;">=&#8221;utf-8&#8243; </span></span><span style="color: #ff0000; font-size: x-small;"><span style="font-family: Verdana,Arial,Helvetica,sans-serif;">responseEncoding</span></span><span style="color: #0000ff; font-size: x-small;"><span style="font-family: Verdana,Arial,Helvetica,sans-serif;">=&#8221;utf-8&#8243; </span></span><span style="color: #ff0000; font-size: x-small;"><span style="font-family: Verdana,Arial,Helvetica,sans-serif;">culture</span></span><span style="color: #0000ff; font-size: x-small;"><span style="font-family: Verdana,Arial,Helvetica,sans-serif;">=&#8221;en-GB&#8221; </span></span><span style="color: #ff0000; font-size: x-small;"><span style="font-family: Verdana,Arial,Helvetica,sans-serif;">uiCulture</span></span><span style="color: #0000ff; font-size: x-small;"><span style="font-family: Verdana,Arial,Helvetica,sans-serif;">=&#8221;en-GB&#8221;</span><span style="font-family: Verdana,Arial,Helvetica,sans-serif;">/&gt;<br />
</span><span style="font-family: Verdana,Arial,Helvetica,sans-serif;">&lt;/</span></span><span style="font-family: Verdana,Arial,Helvetica,sans-serif; color: #800000; font-size: x-small;">system.web</span><span style="color: #0000ff; font-size: x-small;"><span style="font-family: Verdana,Arial,Helvetica,sans-serif;">&gt;<br />
</span><span style="font-family: Verdana,Arial,Helvetica,sans-serif;">&lt;/</span></span><span style="font-family: Verdana,Arial,Helvetica,sans-serif;"><span style="color: #800000; font-size: x-small;">configuration</span><span style="color: #0000ff; font-size: x-small;">&gt;</span></span></span></span></p>
<p><a href="http://www.c-sharpcorner.com/UploadFile/Santhi.M/GlobalizationusingASP.NET11262005072116AM/GlobalizationusingASP.NET.aspx">Globalization using ASP.NET</a>.</p>


<p>Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/american-dates-and-currencies-in-aspnet/' rel='bookmark' title='Localisation &#8211; American Date&#8217;s and currencies in ASP.net'>Localisation &#8211; American Date&#8217;s and currencies in ASP.net</a></li>
<li><a href='http://codeblog.shawson.co.uk/stop-the-web-config-being-inherited-by-child-applications-in-sub-folders/' rel='bookmark' title='Stop the &#8220;web.config&#8221; being inherited by child applications in sub folders'>Stop the &#8220;web.config&#8221; being inherited by child applications in sub folders</a></li>
<li><a href='http://codeblog.shawson.co.uk/running-vb-net-alongside-c-in-a-web-app/' rel='bookmark' title='Running vb.net alongside c# in a web app'>Running vb.net alongside c# in a web app</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://codeblog.shawson.co.uk/globalization-using-aspnet/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Maintaining ViewState on Password fields</title>
		<link>http://codeblog.shawson.co.uk/maintaining-viewstate-on-password-fields/</link>
		<comments>http://codeblog.shawson.co.uk/maintaining-viewstate-on-password-fields/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 14:38:00 +0000</pubDate>
		<dc:creator>shawson</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[VB.net]]></category>

		<guid isPermaLink="false">http://www.shawson.co.uk/codeblog/post.aspx?id=f2842108-6103-4132-99b5-22a16aef99bc</guid>
		<description><![CDATA[just found this little nugget over on DotNetSlackers.com - By default dot net will activly stop you from maintaining the value in password text boxes on post back- which can be a pain in the ass forcing your user to keep retyping their password (twice as you will almost certainly have a password confirm box!).  [...]


Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/using-findcontrol-to-find-a-repeater-nested-inside-a-repeater-with-headertemplate-or-footertemplate-defined/' rel='bookmark' title='Using FindControl to find a repeater nested inside a repeater with HeaderTemplate or FooterTemplate defined'>Using FindControl to find a repeater nested inside a repeater with HeaderTemplate or FooterTemplate defined</a></li>
<li><a href='http://codeblog.shawson.co.uk/sessionid-re-generated-on-each-page-hit/' rel='bookmark' title='SessionId re-generated on each page hit'>SessionId re-generated on each page hit</a></li>
<li><a href='http://codeblog.shawson.co.uk/asp-net-update-panels-and-jquery/' rel='bookmark' title='ASP.net update panel&#8217;s and jQuery'>ASP.net update panel&#8217;s and jQuery</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>just found this little nugget over on <a href="http://dotnetslackers.com/ASP_NET/re-16487_Setting_the_value_of_Password_Fields_in_ASP_NET_2_0_a_tip_and_rant_rolled_up_into_1.aspx">DotNetSlackers.com </a>- By default dot net will activly stop you from maintaining the value in password text boxes on post back- which can be a pain in the ass forcing your user to keep retyping their password (twice as you will almost certainly have a password confirm box!).  You can get round this using this beauty;</p>
<pre class="brush: vbnet">
Protected Sub txtMyPasswordField_PreRender( ByVal sender As Object, ByVal e As System.EventArgs) Handles txtMyPasswordField.PreRender
    txtMyPasswordField.Attributes(&quot;value&quot;) = txtMyPasswordField.Text
End Sub
</pre>


<p>Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/using-findcontrol-to-find-a-repeater-nested-inside-a-repeater-with-headertemplate-or-footertemplate-defined/' rel='bookmark' title='Using FindControl to find a repeater nested inside a repeater with HeaderTemplate or FooterTemplate defined'>Using FindControl to find a repeater nested inside a repeater with HeaderTemplate or FooterTemplate defined</a></li>
<li><a href='http://codeblog.shawson.co.uk/sessionid-re-generated-on-each-page-hit/' rel='bookmark' title='SessionId re-generated on each page hit'>SessionId re-generated on each page hit</a></li>
<li><a href='http://codeblog.shawson.co.uk/asp-net-update-panels-and-jquery/' rel='bookmark' title='ASP.net update panel&#8217;s and jQuery'>ASP.net update panel&#8217;s and jQuery</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://codeblog.shawson.co.uk/maintaining-viewstate-on-password-fields/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>2 tabs fresh!</title>
		<link>http://codeblog.shawson.co.uk/2-tabs-fresh/</link>
		<comments>http://codeblog.shawson.co.uk/2-tabs-fresh/#comments</comments>
		<pubDate>Wed, 07 Jan 2009 07:54:00 +0000</pubDate>
		<dc:creator>shawson</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[C#.net]]></category>
		<category><![CDATA[VB.net]]></category>

		<guid isPermaLink="false">http://www.shawson.co.uk/codeblog/post.aspx?id=4da82192-72db-42d6-bd6d-cf00f18ff010</guid>
		<description><![CDATA[In visual studio 2008 you&#39;ll notice a lot of operators such as foreach/ switch etc etc are listed as snippets in the intellisense menu, however when you hit tab to insert them it just autocompletes the keyword- if you hit tab twice it will insert the full snippet, giving you a dummy template usage for [...]


Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/thycotic-pattern-articles/' rel='bookmark' title='Thycotic Design Pattern Articles'>Thycotic Design Pattern Articles</a></li>
<li><a href='http://codeblog.shawson.co.uk/classic-asp-sql-injection-vulnerability-analyser/' rel='bookmark' title='Classic ASP SQL Injection vulnerability analyser'>Classic ASP SQL Injection vulnerability analyser</a></li>
<li><a href='http://codeblog.shawson.co.uk/windows-vista-visual-studio-20035-and-front-page-extensions/' rel='bookmark' title='Windows Vista, Visual Studio 2003/5 and Front Page Extensions!'>Windows Vista, Visual Studio 2003/5 and Front Page Extensions!</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>In visual studio 2008 you&#39;ll notice a lot of operators such as foreach/ switch etc etc are listed as snippets in the intellisense menu, however when you hit tab to insert them it just autocompletes the keyword- if you hit tab twice it will insert the full snippet, giving you a dummy template usage for that keyword!</p>


<p>Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/thycotic-pattern-articles/' rel='bookmark' title='Thycotic Design Pattern Articles'>Thycotic Design Pattern Articles</a></li>
<li><a href='http://codeblog.shawson.co.uk/classic-asp-sql-injection-vulnerability-analyser/' rel='bookmark' title='Classic ASP SQL Injection vulnerability analyser'>Classic ASP SQL Injection vulnerability analyser</a></li>
<li><a href='http://codeblog.shawson.co.uk/windows-vista-visual-studio-20035-and-front-page-extensions/' rel='bookmark' title='Windows Vista, Visual Studio 2003/5 and Front Page Extensions!'>Windows Vista, Visual Studio 2003/5 and Front Page Extensions!</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://codeblog.shawson.co.uk/2-tabs-fresh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VB to C# Code Converter</title>
		<link>http://codeblog.shawson.co.uk/vb-to-c-code-converter/</link>
		<comments>http://codeblog.shawson.co.uk/vb-to-c-code-converter/#comments</comments>
		<pubDate>Mon, 03 Nov 2008 10:52:00 +0000</pubDate>
		<dc:creator>shawson</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[C#.net]]></category>
		<category><![CDATA[VB.net]]></category>

		<guid isPermaLink="false">http://www.shawson.co.uk/codeblog/post.aspx?id=57f702fc-be64-48a6-81c1-786472775eae</guid>
		<description><![CDATA[Just found a cool tool online for converting vb code to c#, and vice-versa.&#160; It&#39;s not 100% perfect so make sure you have a look through what it turfs out, but it&#39;s handy for converting small code snippets of example functions you find online.&#160; It&#39;s up on the DeveloperFusion website here. Related posts:Google Code Highlighter [...]


Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/google-code-highlighter/' rel='bookmark' title='Google Code Highlighter'>Google Code Highlighter</a></li>
<li><a href='http://codeblog.shawson.co.uk/premailer-%e2%80%94-preflight-for-html-e-mail/' rel='bookmark' title='Premailer — preflight for HTML e-mail'>Premailer — preflight for HTML e-mail</a></li>
<li><a href='http://codeblog.shawson.co.uk/2-tabs-fresh/' rel='bookmark' title='2 tabs fresh!'>2 tabs fresh!</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>Just found a cool tool online for converting vb code to c#, and vice-versa.&nbsp; It&#39;s not 100% perfect so make sure you have a look through what it turfs out, but it&#39;s handy for converting small code snippets of example functions you find online.&nbsp; It&#39;s up on the DeveloperFusion website <a href="http://www.developerfusion.com/tools/convert/vb-to-csharp/" target="_blank" title="Developer Fusion Code Coverter">here</a>.</p>


<p>Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/google-code-highlighter/' rel='bookmark' title='Google Code Highlighter'>Google Code Highlighter</a></li>
<li><a href='http://codeblog.shawson.co.uk/premailer-%e2%80%94-preflight-for-html-e-mail/' rel='bookmark' title='Premailer — preflight for HTML e-mail'>Premailer — preflight for HTML e-mail</a></li>
<li><a href='http://codeblog.shawson.co.uk/2-tabs-fresh/' rel='bookmark' title='2 tabs fresh!'>2 tabs fresh!</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://codeblog.shawson.co.uk/vb-to-c-code-converter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Code Highlighter</title>
		<link>http://codeblog.shawson.co.uk/google-code-highlighter/</link>
		<comments>http://codeblog.shawson.co.uk/google-code-highlighter/#comments</comments>
		<pubDate>Tue, 28 Oct 2008 12:25:00 +0000</pubDate>
		<dc:creator>shawson</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[blogging]]></category>
		<category><![CDATA[C#.net]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[VB.net]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.shawson.co.uk/codeblog/post.aspx?id=1a0049fa-b77b-430a-9c31-88c9252c84e4</guid>
		<description><![CDATA[You may have noticed that the little snippets of code I&#8217;ve been dropping into these post&#8217;s suddenly got a bit swankier looking. This is down to a new javascript tool I found for use on blogs and the like, for highlighting code you post on your pages. Basically you download the zip file- unzip it [...]


Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/runaway-sharepoint-2003-indexing/' rel='bookmark' title='Runaway Sharepoint 2003 Indexing!'>Runaway Sharepoint 2003 Indexing!</a></li>
<li><a href='http://codeblog.shawson.co.uk/google-font-api/' rel='bookmark' title='Google Font API'>Google Font API</a></li>
<li><a href='http://codeblog.shawson.co.uk/asp-net-build-step-to-minify-and-obfuscate-your-sites-javascript-and-css/' rel='bookmark' title='Adding minification and obfuscation of your Javascript and CSS to your ASP.net build process using Yahoo YUI Compressor'>Adding minification and obfuscation of your Javascript and CSS to your ASP.net build process using Yahoo YUI Compressor</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>You may have noticed that the little snippets of code I&#8217;ve been dropping into these post&#8217;s suddenly got a bit swankier looking.  This is down to a new javascript tool I found for use on blogs and the like, for highlighting code you post on your pages.</p>
<p>Basically you download the zip file- unzip it and copy the javascripts and css files over, then add a few lines of code to the head of your page;</p>
<p><textarea name="code" class="html"></p>
<link type="text/css" rel="stylesheet" href="css/SyntaxHighlighter.css"></link>
<script language="javascript" src="js/shCore.js"></script><br />
<script language="javascript" src="js/shBrushCSharp.js"></script><br />
<script language="javascript" src="js/shBrushXml.js"></script><br />
<script language="javascript">
dp.SyntaxHighlighter.ClipboardSwf = '/flash/clipboard.swf';
dp.SyntaxHighlighter.HighlightAll('code');
</script><br />
</textarea></p>
<p>You then put your code in-between &gt;pre&lt; tags and set a name attribute to &#8220;code&#8221; and set the class to whatever syntax you have- it has support for a whole bunch of languages including c#, vb, php, javascript, css, sql and a whole bunch of others.  You can grab this plug-in from <a href="http://code.google.com/p/syntaxhighlighter/" title="Google syntax highlighter">here</a></p>
<p>The install was easy- but a couple of bits did catch me out- the code sample above was the example they give you in the install page.  So I blindly copied over this code to the head of my blog, and copied all the files from the zip file over to my sites js and css folders.  I found that html highlighting worked fine and so did c# but vb and sql weren&#8217;t happening&#8230; It eventually clicked that you need to add the references to the additional syntax types you need as the example only has a line for the CS and XML/HTML &#8220;brush&#8221; libraries.  So I popped those lines in and it worked fine. </p>
<p>The other problem that I had, and indeed still have until I get home to actually edit the code, is compatibility with <a href="http://tinymce.moxiecode.com/">TinyMCE</a> which is the editor used by default in BlogEngine.  I found a couple of articles which might help with this but won&#8217;t know till tonight;</p>
<ul>
<li><a href="http://weblogs.asp.net/nawaf/archive/2008/04/06/syntaxhighlighter-plugin-for-tinymce-wysiwyg-editor.aspx">TinyMCE Code highlighter Plugin to work with Google Syntaxt Highlighter</a></li>
<li><a href="http://blog.daemon.com.au/go/blog-post/getting-tinymce-to-play-nice-with-dp-syntaxhighlighter">TinyMCE configuration settings to help everything get along a little better</a></li>
</ul>
<p>As mentioned on the Wiki pages there is also the issue that adding a name value to a pre tag, isn&#8217;t valid xhtml.</p>


<p>Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/runaway-sharepoint-2003-indexing/' rel='bookmark' title='Runaway Sharepoint 2003 Indexing!'>Runaway Sharepoint 2003 Indexing!</a></li>
<li><a href='http://codeblog.shawson.co.uk/google-font-api/' rel='bookmark' title='Google Font API'>Google Font API</a></li>
<li><a href='http://codeblog.shawson.co.uk/asp-net-build-step-to-minify-and-obfuscate-your-sites-javascript-and-css/' rel='bookmark' title='Adding minification and obfuscation of your Javascript and CSS to your ASP.net build process using Yahoo YUI Compressor'>Adding minification and obfuscation of your Javascript and CSS to your ASP.net build process using Yahoo YUI Compressor</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://codeblog.shawson.co.uk/google-code-highlighter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using FindControl to find a repeater nested inside a repeater with HeaderTemplate or FooterTemplate defined</title>
		<link>http://codeblog.shawson.co.uk/using-findcontrol-to-find-a-repeater-nested-inside-a-repeater-with-headertemplate-or-footertemplate-defined/</link>
		<comments>http://codeblog.shawson.co.uk/using-findcontrol-to-find-a-repeater-nested-inside-a-repeater-with-headertemplate-or-footertemplate-defined/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 10:25:00 +0000</pubDate>
		<dc:creator>shawson</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[VB.net]]></category>

		<guid isPermaLink="false">http://www.shawson.co.uk/codeblog/post.aspx?id=9e6e0454-d0fd-423f-986e-06edf458b352</guid>
		<description><![CDATA[I just today cracked a problem which consumed my Friday afternoon and a big chunk of this morning.&#160; This was something i hadn&#8217;t come across in .net when using repeaters before.&#160; On the aspx side I had a repeater embedded within a repeater; &#60;asp:Repeater ID=&#34;rptAddedSeries&#34; runat=&#34;server&#34;&#62; &#60;headerTemplate&#62; &#60;div id=&#34;seriesHeader&#34;&#62; &#60;/headerTemplate&#62; &#60;itemTemplate&#62; &#60;h2&#62; &#60;%#Container.DataItem().Title%&#62; &#60;/h2&#62; &#60;asp:Repeater [...]


Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/how-to-display-hierarchical-data-by-using-nested-repeater-controls-and-visual-c-net/' rel='bookmark' title='How To Display Hierarchical Data Using Nested Repeater Controls and Visual C# .NET'>How To Display Hierarchical Data Using Nested Repeater Controls and Visual C# .NET</a></li>
<li><a href='http://codeblog.shawson.co.uk/maintaining-viewstate-on-password-fields/' rel='bookmark' title='Maintaining ViewState on Password fields'>Maintaining ViewState on Password fields</a></li>
<li><a href='http://codeblog.shawson.co.uk/consuming-rss-feeds-using-asp-net-controls/' rel='bookmark' title='Consuming RSS Feeds using ASP.net controls'>Consuming RSS Feeds using ASP.net controls</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>
I just today cracked a problem which consumed my Friday afternoon and a big chunk of this morning.&nbsp; This was something i hadn&#8217;t come across in .net when using repeaters before.&nbsp;
</p>
<p>
On the aspx side I had a repeater embedded within a repeater;
</p>
<pre class="brush: html">
  &lt;asp:Repeater ID=&quot;rptAddedSeries&quot; runat=&quot;server&quot;&gt;
    &lt;headerTemplate&gt;
      &lt;div id=&quot;seriesHeader&quot;&gt;
    &lt;/headerTemplate&gt;
    &lt;itemTemplate&gt;
      &lt;h2&gt;
        &lt;%#Container.DataItem().Title%&gt;
      &lt;/h2&gt;
      &lt;asp:Repeater ID=&quot;rptBooks&quot; runat=&quot;server&quot;&gt;
        &lt;headerTemplate&gt;&lt;ul&gt;&lt;/headerTemplate&gt;
        &lt;itemTemplate&gt;
          &lt;li&gt;
            &lt;%#Container.DataItem().BookID%&gt;
          &lt;/li&gt;
        &lt;/itemTemplate&gt;
        &lt;footerTemplate&gt;
          &lt;/ul&gt;
        &lt;/footerTemplate&gt;
      &lt;/asp:Repeater&gt;
    &lt;/itemTemplate&gt;
    &lt;footerTemplate&gt;
      &lt;/div&gt;
    &lt;/footerTemplate&gt;
  &lt;/asp:Repeater&gt;
</pre>
<p>
I simply wanted to populate the inner repeater and perform the databinding.&nbsp; The code i had worked fine- using FindControl to grab the inner repeater then setting the datasource and executeing DataBind().&nbsp; However, when i added the HeaderTemplate and FooterTemplate to the parent &#8220;rptAddedSeries&#8221; control, the FindControl suddenly stopp working and i started getting a NullReferenceException when trying to set my DataSource.
</p>
<pre class="brush: vbnet">
Protected Sub rptAddedSeries_ItemDataBound(ByVal sender As Object,  ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs)Handles rptAddedSeries.ItemDataBound
   Dim this_repeater_item As RepeaterItem = DirectCast(sender, Repeater).Controls.Item(_repeater_counter)
   Dim child_repeater As Repeater = DirectCast(this_repeater_item.FindControl(&quot;rptBooks&quot;), Repeater)
   child_repeater.DataSource = _highlight.Highlights_Seriess(_repeater_counter).Highlight_Series_Books
   child_repeater.DataBind()
   _repeater_counter += 1
End Sub
</pre>
<p>
After a bit of <a href="http://www.google.com/search?ie=UTF-8&amp;oe=UTF-8&amp;sourceid=navclient&amp;gfns=1&amp;q=cannot+findcontrol+on+repeater+with+a+headertemplate+defined" mce_href="http://www.google.com/search?ie=UTF-8&amp;oe=UTF-8&amp;sourceid=navclient&amp;gfns=1&amp;q=cannot+findcontrol+on+repeater+with+a+headertemplate+defined" target="_blank">googling</a> I found <a href="http://forums.asp.net/p/1255768/2707975.aspx" mce_href="http://forums.asp.net/p/1255768/2707975.aspx" target="_blank">a forum post on asp.net forums</a> by someone with a similar issue.&nbsp; The ItemDataBound event occurs against each part of the your repeater item- meaning if you have a HeaderTemplate and FooterTemplate as well as your standard ItemTemplate, the ItemDataBound will execute 3 times.&nbsp; So I added a condition at the start of the function to ensure that i was running my code only during the ItemTemplate data binding;
</p>
<pre class="brush: vbnet">
If e.Item.ItemType = ListItemType.Item Then
  ...
End If
</pre>
<p>
However i was still having issue&#8217;s with the FindControl failing.&nbsp; Reading down the same forum post i found a note mentioning that FindControl wouldn&#8217;t work directly against the RepeaterItem but there was nothing to say whatI should be running it against.&nbsp; Considering the it was the e (RepeaterItemEventArgs) object we tested to find the current ItemType, it stood to reason that the actual item might be contained within there so i modified the method and it worked perfectly;
</p>
<pre class="brush: vbnet">
Protected Sub rptAddedSeries_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles rptAddedSeries.ItemDataBound
  If e.Item.ItemType = ListItemType.Item Then
    &#039;Dim this_repeater_item As RepeaterItem = DirectCast(sender, Repeater).Controls.Item(_repeater_counter)
    &#039;Dim child_repeater As Repeater = DirectCast(this_repeater_item.FindControl(&quot;rptBooks&quot;), Repeater)
    &#039;Dim child_repeater As Repeater = DirectCast(this_repeater_item.TemplateControl.FindControl(&quot;rptBooks&quot;), Repeater)

    Dim child_repeater As Repeater = DirectCast(e.Item.FindControl(&quot;rptBooks&quot;), Repeater)
    child_repeater.DataSource = _highlight.Highlights_Seriess(_repeater_counter).Highlight_Series_Books
    child_repeater.DataBind()
    _repeater_counter += 1
  End If
End Sub
</pre>
<p>
Hope this save&#8217;s someone else a few hours of tearing their hair out!</p>


<p>Related posts:<ul><li><a href='http://codeblog.shawson.co.uk/how-to-display-hierarchical-data-by-using-nested-repeater-controls-and-visual-c-net/' rel='bookmark' title='How To Display Hierarchical Data Using Nested Repeater Controls and Visual C# .NET'>How To Display Hierarchical Data Using Nested Repeater Controls and Visual C# .NET</a></li>
<li><a href='http://codeblog.shawson.co.uk/maintaining-viewstate-on-password-fields/' rel='bookmark' title='Maintaining ViewState on Password fields'>Maintaining ViewState on Password fields</a></li>
<li><a href='http://codeblog.shawson.co.uk/consuming-rss-feeds-using-asp-net-controls/' rel='bookmark' title='Consuming RSS Feeds using ASP.net controls'>Consuming RSS Feeds using ASP.net controls</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://codeblog.shawson.co.uk/using-findcontrol-to-find-a-repeater-nested-inside-a-repeater-with-headertemplate-or-footertemplate-defined/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

