<?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; C#.net</title>
	<atom:link href="http://www.shawson.co.uk/codeblog/category/c-sharp-net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.shawson.co.uk/codeblog</link>
	<description>development notes for my failing memory</description>
	<lastBuildDate>Mon, 26 Jul 2010 19:08:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Properties getting &#8220;k__BackingField&#8221; appended to their name in the WSDL file</title>
		<link>http://www.shawson.co.uk/codeblog/properties-getting-k__backingfield-appended-to-their-name-in-the-wsdl-file/</link>
		<comments>http://www.shawson.co.uk/codeblog/properties-getting-k__backingfield-appended-to-their-name-in-the-wsdl-file/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 16:58:08 +0000</pubDate>
		<dc:creator>shawson</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[C#.net]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://www.shawson.co.uk/codeblog/?p=419</guid>
		<description><![CDATA[I was finding k__backingField was being appended to all my object properties when exposed via my a WCF service, in the WSDL.  The solution it turns out was simple- just had to make my class a [DataContract] and mark the properties as [DataMember].
via WCF Data Contracts and “k__BackingField” Property Naming &#8211; Nathan Bridgewater.


Related posts:Getting started [...]


Related posts:<ul><li><a href='http://www.shawson.co.uk/codeblog/getting-started-with-wcf-and-rest-web-services/' rel='bookmark' title='Permanent Link: Getting started with WCF and REST web services'>Getting started with WCF and REST web services</a></li>
<li><a href='http://www.shawson.co.uk/codeblog/web-services-debugging-with-fiddler-2/' rel='bookmark' title='Permanent Link: Web Services Debugging with Fiddler 2'>Web Services Debugging with Fiddler 2</a></li>
<li><a href='http://www.shawson.co.uk/codeblog/where-did-my-immidiate-window-go/' rel='bookmark' title='Permanent Link: Where did my Immidiate window go!?'>Where did my Immidiate window go!?</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>I was finding k__backingField was being appended to all my object properties when exposed via my a WCF service, in the WSDL.  The solution it turns out was simple- just had to make my class a [DataContract] and mark the properties as [DataMember].</p>
<p>via <a href="http://www.integratedwebsystems.com/2009/05/wcf-data-contracts-and-k__backingfield-property-naming/">WCF Data Contracts and “k__BackingField” Property Naming &#8211; Nathan Bridgewater</a>.</p>


<p>Related posts:<ul><li><a href='http://www.shawson.co.uk/codeblog/getting-started-with-wcf-and-rest-web-services/' rel='bookmark' title='Permanent Link: Getting started with WCF and REST web services'>Getting started with WCF and REST web services</a></li>
<li><a href='http://www.shawson.co.uk/codeblog/web-services-debugging-with-fiddler-2/' rel='bookmark' title='Permanent Link: Web Services Debugging with Fiddler 2'>Web Services Debugging with Fiddler 2</a></li>
<li><a href='http://www.shawson.co.uk/codeblog/where-did-my-immidiate-window-go/' rel='bookmark' title='Permanent Link: Where did my Immidiate window go!?'>Where did my Immidiate window go!?</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.shawson.co.uk/codeblog/properties-getting-k__backingfield-appended-to-their-name-in-the-wsdl-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making your WCF Service compatible with legacy .net 1.1 applications</title>
		<link>http://www.shawson.co.uk/codeblog/making-your-wcf-service-compatible-with-legacy-net-1-1-applications/</link>
		<comments>http://www.shawson.co.uk/codeblog/making-your-wcf-service-compatible-with-legacy-net-1-1-applications/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 14:01:42 +0000</pubDate>
		<dc:creator>shawson</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[C#.net]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://www.shawson.co.uk/codeblog/?p=414</guid>
		<description><![CDATA[I&#8217;m building an error tracking service which all our future web project will report to, so we can track and tag all our various systems problems from one place- this is currently done with email which is a bit of a nightmare!
According to Microsoft, traditional ASMX web services are now considered &#8220;Legacy technology&#8221; (!) so [...]


Related posts:<ul><li><a href='http://www.shawson.co.uk/codeblog/getting-started-with-wcf-and-rest-web-services/' rel='bookmark' title='Permanent Link: Getting started with WCF and REST web services'>Getting started with WCF and REST web services</a></li>
<li><a href='http://www.shawson.co.uk/codeblog/the-provided-uri-scheme-http-is-invalid-expected-https/' rel='bookmark' title='Permanent Link: 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://www.shawson.co.uk/codeblog/web-services-debugging-with-fiddler-2/' rel='bookmark' title='Permanent Link: Web Services Debugging with Fiddler 2'>Web Services Debugging with Fiddler 2</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m building an error tracking service which all our future web project will report to, so we can track and tag all our various systems problems from one place- this is currently done with email which is a bit of a nightmare!</p>
<p>According to Microsoft, traditional ASMX web services are now considered &#8220;Legacy technology&#8221; (!) so I thought I would buite the bullet and build the new services using WCF.</p>
<p>This was fairly painless until I tried to consume the web service in some old .net 1.1 web apps- when trying to add the web reference I received this error message;</p>
<blockquote><p>Web ReferenceslocalhostReference.map(1): Custom tool warning: DiscoCodeGenerator unable to initialize code generator.  No code generated.</p></blockquote>
<p>I found a great article over on the MSDN &#8211; and all it takes is a small change to the web.config, fiddling with, <a href="http://www.shawson.co.uk/codeblog/the-provided-uri-scheme-http-is-invalid-expected-https/">my old friend</a>, the httpBindings.</p>
<p>I had to swap out the default bindings put in by .net;</p>
<pre class="brush: xml">
        &lt;endpoint address=&quot;&quot; binding=&quot;wsHttpBinding&quot; contract=&quot;HachetteErrorTracker.IErrorLog&quot;&gt;
					&lt;identity&gt;
						&lt;dns value=&quot;localhost&quot;/&gt;
					&lt;/identity&gt;
				&lt;/endpoint&gt;
</pre>
<p>For this one;</p>
<pre class="brush: xml">
&lt;endpoint
           address=&quot;&quot;
           binding=&quot;basicHttpBinding&quot; bindingNamespace=&quot;http://errortracker.localhost/&quot;
           contract=&quot;HachetteErrorTracker.IErrorLog&quot;
        /&gt;
</pre>
<p><a href="http://msdn.microsoft.com/en-us/library/ms731134.aspx">How to: Configure WCF Service to Interoperate with ASP.NET Web Service Clients</a>.</p>


<p>Related posts:<ul><li><a href='http://www.shawson.co.uk/codeblog/getting-started-with-wcf-and-rest-web-services/' rel='bookmark' title='Permanent Link: Getting started with WCF and REST web services'>Getting started with WCF and REST web services</a></li>
<li><a href='http://www.shawson.co.uk/codeblog/the-provided-uri-scheme-http-is-invalid-expected-https/' rel='bookmark' title='Permanent Link: 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://www.shawson.co.uk/codeblog/web-services-debugging-with-fiddler-2/' rel='bookmark' title='Permanent Link: Web Services Debugging with Fiddler 2'>Web Services Debugging with Fiddler 2</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.shawson.co.uk/codeblog/making-your-wcf-service-compatible-with-legacy-net-1-1-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deep Copy Array/ Collection/ etc using serialization</title>
		<link>http://www.shawson.co.uk/codeblog/deep-copy-array-collection-etc/</link>
		<comments>http://www.shawson.co.uk/codeblog/deep-copy-array-collection-etc/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 10:28:41 +0000</pubDate>
		<dc:creator>shawson</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[C#.net]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[collection]]></category>
		<category><![CDATA[deep copy]]></category>
		<category><![CDATA[serialise]]></category>

		<guid isPermaLink="false">http://www.shawson.co.uk/codeblog/?p=358</guid>
		<description><![CDATA[A useful snippet of code I used in a web services project a while ago which i just stumbled back across recently- allows you to make a deep copy of an array, where you would normally get a shallow copy, stopping you from manipulating it independently from the source.  This gives you a completely [...]


Related posts:<ul><li><a href='http://www.shawson.co.uk/codeblog/a-complete-list-of-net-serializers-in-3-5/' rel='bookmark' title='Permanent Link: A complete list of .NET Serializers in 3.5'>A complete list of .NET Serializers in 3.5</a></li>
<li><a href='http://www.shawson.co.uk/codeblog/making-your-wcf-service-compatible-with-legacy-net-1-1-applications/' rel='bookmark' title='Permanent Link: 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://www.shawson.co.uk/codeblog/aspnet-role-membership-providers-under-iis7-doesnt-work/' rel='bookmark' title='Permanent Link: ASP.Net Role &#038; Membership Providers (Under IIS7) &#8211; DOESN&#8217;T Work!'>ASP.Net Role &#038; Membership Providers (Under IIS7) &#8211; DOESN&#8217;T Work!</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>A useful snippet of code I used in a web services project a while ago which i just stumbled back across recently- allows you to make a deep copy of an array, where you would normally get a shallow copy, stopping you from manipulating it independently from the source.  This gives you a completely fresh and separate copy.  The original is serialised to a memory, then a new instance created from the serialised representation (so obviously if it&#8217;s an array of custom objects, those objects will need to be marked serializable)</p>
<pre class="brush: csharp">
OrderItem[] order_items_clone;
using( MemoryStream ms = new MemoryStream())
{
	System.Runtime.Serialization.Formatters.Binary.BinaryFormatter formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
	formatter.Serialize(ms,order_items);
	ms.Seek(0 , SeekOrigin.Begin);
	order_items_clone = (OrderItem[])formatter.Deserialize(ms);
}
</pre>


<p>Related posts:<ul><li><a href='http://www.shawson.co.uk/codeblog/a-complete-list-of-net-serializers-in-3-5/' rel='bookmark' title='Permanent Link: A complete list of .NET Serializers in 3.5'>A complete list of .NET Serializers in 3.5</a></li>
<li><a href='http://www.shawson.co.uk/codeblog/making-your-wcf-service-compatible-with-legacy-net-1-1-applications/' rel='bookmark' title='Permanent Link: 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://www.shawson.co.uk/codeblog/aspnet-role-membership-providers-under-iis7-doesnt-work/' rel='bookmark' title='Permanent Link: ASP.Net Role &#038; Membership Providers (Under IIS7) &#8211; DOESN&#8217;T Work!'>ASP.Net Role &#038; Membership Providers (Under IIS7) &#8211; DOESN&#8217;T Work!</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.shawson.co.uk/codeblog/deep-copy-array-collection-etc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Synchonous Yield messing up my foreach loop!</title>
		<link>http://www.shawson.co.uk/codeblog/asynchonous-yield-messing-up-my-foreach-loop/</link>
		<comments>http://www.shawson.co.uk/codeblog/asynchonous-yield-messing-up-my-foreach-loop/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 13:10:41 +0000</pubDate>
		<dc:creator>shawson</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[C#.net]]></category>
		<category><![CDATA[Synchonous]]></category>
		<category><![CDATA[timeout]]></category>
		<category><![CDATA[yield]]></category>

		<guid isPermaLink="false">http://www.shawson.co.uk/codeblog/?p=348</guid>
		<description><![CDATA[I recently got stung while debugging a colleagues code, by my lack of understanding of the Yield keyword!  We had a foreach loop which looks like this;

foreach (PurchaseOrderLine aLine in PurchaseOrderLine.LoadExtractLines(extractTime, systemId)) {
  //do some processing stuff...
  PurchaseOrder.MarkAsExported(lastId, extractTime);
}

The LoadExtractLines returns an IEnumerable and uses yield to return each line- the stored [...]


Related posts:<ul><li><a href='http://www.shawson.co.uk/codeblog/2-tabs-fresh/' rel='bookmark' title='Permanent Link: 2 tabs fresh!'>2 tabs fresh!</a></li>
<li><a href='http://www.shawson.co.uk/codeblog/syndicating-to-rss-using-the-build-in-net-syndicationfeed-classes/' rel='bookmark' title='Permanent Link: Syndicating to RSS using the built in .net SyndicationFeed classes'>Syndicating to RSS using the built in .net SyndicationFeed classes</a></li>
<li><a href='http://www.shawson.co.uk/codeblog/aspnet-role-membership-providers-under-iis7-doesnt-work/' rel='bookmark' title='Permanent Link: ASP.Net Role &#038; Membership Providers (Under IIS7) &#8211; DOESN&#8217;T Work!'>ASP.Net Role &#038; Membership Providers (Under IIS7) &#8211; DOESN&#8217;T Work!</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>I recently got stung while debugging a colleagues code, by my lack of understanding of the Yield keyword!  We had a foreach loop which looks like this;</p>
<pre class="brush: csharp">
foreach (PurchaseOrderLine aLine in PurchaseOrderLine.LoadExtractLines(extractTime, systemId)) {
  //do some processing stuff...
  PurchaseOrder.MarkAsExported(lastId, extractTime);
}
</pre>
<p>The LoadExtractLines returns an IEnumerable and uses yield to return each line- the stored proc it runs is quite intensive- the whole thing looks like this;</p>
<pre class="brush: csharp">
public static IEnumerable&lt;PurchaseOrderLine&gt; LoadExtractLines(DateTime cutOff,int systemId)
        {
            using (SqlConnection conn = new SqlConnection(SingleAccess.Instance.ConnectionToUse))
            {
                conn.Open();
                using (SqlCommand cmd = new SqlCommand(&quot;Get_PurchaseOrderLinesToExtract&quot;, conn))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue(&quot;@CutOff&quot;, cutOff.ToString(&quot;dd MMM yyyy HH:mm:ss&quot;));
                    cmd.Parameters.AddWithValue(&quot;@SystemId&quot;, systemId);
                    using (SqlDataReader reader = cmd.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            yield return LoadLine(reader);
                        }
                    }
                }
            }
        }
</pre>
<p>MarkAsExported runs quite an intensive update procedure on the database.  As more and more data came into the system we started to see Sql Timeouts, and upon running a trace noticed something strange.  Logging the RPC:Start and Completed events of the stored procs, the Get_PurchaseOrderLinesToExtract proc which feed&#8217;s the for loop was starting, then the update was starting before the Get_ had finished- the two were running side by side, causing the timeout&#8217;s!  </p>
<p>Turns out the foreach loop started the moment it received it&#8217;s first row, yielded back from the LoadExtractLine method- which in retrospect does make sense!  The solution was to convert the Load method to populate a local List<> then return the whole thing once complete, removing the yield statement alltoghether and forcing the process to wait for the entire result set to be complete before starting the loop.</p>


<p>Related posts:<ul><li><a href='http://www.shawson.co.uk/codeblog/2-tabs-fresh/' rel='bookmark' title='Permanent Link: 2 tabs fresh!'>2 tabs fresh!</a></li>
<li><a href='http://www.shawson.co.uk/codeblog/syndicating-to-rss-using-the-build-in-net-syndicationfeed-classes/' rel='bookmark' title='Permanent Link: Syndicating to RSS using the built in .net SyndicationFeed classes'>Syndicating to RSS using the built in .net SyndicationFeed classes</a></li>
<li><a href='http://www.shawson.co.uk/codeblog/aspnet-role-membership-providers-under-iis7-doesnt-work/' rel='bookmark' title='Permanent Link: ASP.Net Role &#038; Membership Providers (Under IIS7) &#8211; DOESN&#8217;T Work!'>ASP.Net Role &#038; Membership Providers (Under IIS7) &#8211; DOESN&#8217;T Work!</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.shawson.co.uk/codeblog/asynchonous-yield-messing-up-my-foreach-loop/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Running vb.net alongside c# in a web app</title>
		<link>http://www.shawson.co.uk/codeblog/running-vb-net-alongside-c-in-a-web-app/</link>
		<comments>http://www.shawson.co.uk/codeblog/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;
   [...]


Related posts:<ul><li><a href='http://www.shawson.co.uk/codeblog/referencing-custom-properties-on-a-master-page-from-the-child-page/' rel='bookmark' title='Permanent Link: 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://www.shawson.co.uk/codeblog/stop-the-web-config-being-inherited-by-child-applications-in-sub-folders/' rel='bookmark' title='Permanent Link: 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://www.shawson.co.uk/codeblog/the-provided-uri-scheme-http-is-invalid-expected-https/' rel='bookmark' title='Permanent Link: 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://www.shawson.co.uk/codeblog/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://www.shawson.co.uk/codeblog/referencing-custom-properties-on-a-master-page-from-the-child-page/' rel='bookmark' title='Permanent Link: 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://www.shawson.co.uk/codeblog/stop-the-web-config-being-inherited-by-child-applications-in-sub-folders/' rel='bookmark' title='Permanent Link: 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://www.shawson.co.uk/codeblog/the-provided-uri-scheme-http-is-invalid-expected-https/' rel='bookmark' title='Permanent Link: 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://www.shawson.co.uk/codeblog/running-vb-net-alongside-c-in-a-web-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thycotic Design Pattern Articles</title>
		<link>http://www.shawson.co.uk/codeblog/thycotic-pattern-articles/</link>
		<comments>http://www.shawson.co.uk/codeblog/thycotic-pattern-articles/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 14:16:37 +0000</pubDate>
		<dc:creator>shawson</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[C#.net]]></category>
		<category><![CDATA[OO Design]]></category>

		<guid isPermaLink="false">http://www.shawson.co.uk/codeblog/?p=320</guid>
		<description><![CDATA[Great bunch of articles on different design patterns up on the Thycotic Blog;

The Strategy Pattern
The Template Pattern



Related posts:Google Code Highlighter
Missing / Corrupt *.aspx(/ascx).Designer.cs file
Some handy Regular Expressions



Related posts:<ul><li><a href='http://www.shawson.co.uk/codeblog/google-code-highlighter/' rel='bookmark' title='Permanent Link: Google Code Highlighter'>Google Code Highlighter</a></li>
<li><a href='http://www.shawson.co.uk/codeblog/missing-corrupt-aspxascx-designer-cs-file/' rel='bookmark' title='Permanent Link: Missing / Corrupt *.aspx(/ascx).Designer.cs file'>Missing / Corrupt *.aspx(/ascx).Designer.cs file</a></li>
<li><a href='http://www.shawson.co.uk/codeblog/some-handy-regular-expressions/' rel='bookmark' title='Permanent Link: Some handy Regular Expressions'>Some handy Regular Expressions</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>Great bunch of articles on different design patterns up on the Thycotic Blog;</p>
<ul>
<li><a href="http://www.thycotic.com/bringing-plausible-deniability-to-development-the-strategy-pattern" target="_blank">The Strategy Pattern</a></li>
<li><a href="http://www.thycotic.com/the-template-pattern-a-benevolent-dictator" target="_blank">The Template Pattern</a></li>
</ul>


<p>Related posts:<ul><li><a href='http://www.shawson.co.uk/codeblog/google-code-highlighter/' rel='bookmark' title='Permanent Link: Google Code Highlighter'>Google Code Highlighter</a></li>
<li><a href='http://www.shawson.co.uk/codeblog/missing-corrupt-aspxascx-designer-cs-file/' rel='bookmark' title='Permanent Link: Missing / Corrupt *.aspx(/ascx).Designer.cs file'>Missing / Corrupt *.aspx(/ascx).Designer.cs file</a></li>
<li><a href='http://www.shawson.co.uk/codeblog/some-handy-regular-expressions/' rel='bookmark' title='Permanent Link: Some handy Regular Expressions'>Some handy Regular Expressions</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.shawson.co.uk/codeblog/thycotic-pattern-articles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Syndicating to RSS using the built in .net SyndicationFeed classes</title>
		<link>http://www.shawson.co.uk/codeblog/syndicating-to-rss-using-the-build-in-net-syndicationfeed-classes/</link>
		<comments>http://www.shawson.co.uk/codeblog/syndicating-to-rss-using-the-build-in-net-syndicationfeed-classes/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 11:31:20 +0000</pubDate>
		<dc:creator>shawson</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[C#.net]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[extension methods]]></category>
		<category><![CDATA[generic list]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[syndication]]></category>

		<guid isPermaLink="false">http://www.shawson.co.uk/codeblog/?p=314</guid>
		<description><![CDATA[My boss recently showed me a pretty handy bunch of classes for generating RSS and ATOM feeds, all built into dot net.
Start by adding a new reference to your project; System.Services.Web.
The SyndicationFeed class holds all the data about your feed and lets you spit everything out in a number of different formats (RSS2.0, ATOM1.0)- each [...]


Related posts:<ul><li><a href='http://www.shawson.co.uk/codeblog/asp-net-aspx-pages-posting-back-to-the-wrong-url-when-using-server-rewrite/' rel='bookmark' title='Permanent Link: ASP.net aspx pages posting back to the wrong URL when using Server Rewrite'>ASP.net aspx pages posting back to the wrong URL when using Server Rewrite</a></li>
<li><a href='http://www.shawson.co.uk/codeblog/rss-xslt/' rel='bookmark' title='Permanent Link: RSS XSLT'>RSS XSLT</a></li>
<li><a href='http://www.shawson.co.uk/codeblog/creating-a-re-usable-shopping-basket-with-generics-in-c-sharp/' rel='bookmark' title='Permanent Link: Creating a re-usable shopping basket with Generics in C#'>Creating a re-usable shopping basket with Generics in C#</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>My boss recently showed me a pretty handy bunch of classes for generating RSS and ATOM feeds, all built into dot net.</p>
<p>Start by adding a new reference to your project; System.Services.Web.</p>
<p>The SyndicationFeed class holds all the data about your feed and lets you spit everything out in a number of different formats (RSS2.0, ATOM1.0)- each item in the feed is held in a generic list of SyndicationItem objects.  As I work for a publishers, I was creating an RSS feed of coming soon books so I added an extension method to my book class- ToSyndicationItem();</p>
<pre class="brush: csharp">
public static SyndicationItem ToSyndicationItem(this Book book)
{
    return new SyndicationItem(book.CoverTitle + &quot; &quot; + book.Subtitle, book.Description, new Uri(book.GetURL()))
    {
        Summary = new TextSyndicationContent(book.DescriptionShort, TextSyndicationContentKind.Plaintext),
        Id = book.Id.ToString(),
        LastUpdatedTime = book.InsertedDate
    };
}
</pre>
<p>This allows me to use all the standard select methods I already in my book class, to also populate my RSS feed.  So to create the feed all I need do in my RSS.ashx handler file is;</p>
<pre class="brush: csharp">
List&lt;Book&gt; books = Book.GetBookPublishedBetween(DateTime.Now,DateTime.Now.AddDays( int.Parse( GroupConstants.ComingSoonMaxDays)));
List&lt;SyndicationItem&gt; syndicationItems = new List&lt;SyndicationItem&gt;();
foreach (Book book in books)
    syndicationItems.Add(book.ToSyndicationItem());

feed = new SyndicationFeed(syndicationItems)
{
    Title = new TextSyndicationContent(&quot;Coming Soon Titles&quot;),
    Description = new TextSyndicationContent(&quot;Forthcoming publications.&quot;),
    BaseUri = new Uri(LinkHelper.GetBaseUrl())
};

var output = new StringWriter();
var writer = new XmlTextWriter(output);

new Rss20FeedFormatter(feed).WriteTo(writer);

context.Response.ContentType = &quot;application/rss+xml&quot;;
context.Response.Write(output.ToString());
</pre>


<p>Related posts:<ul><li><a href='http://www.shawson.co.uk/codeblog/asp-net-aspx-pages-posting-back-to-the-wrong-url-when-using-server-rewrite/' rel='bookmark' title='Permanent Link: ASP.net aspx pages posting back to the wrong URL when using Server Rewrite'>ASP.net aspx pages posting back to the wrong URL when using Server Rewrite</a></li>
<li><a href='http://www.shawson.co.uk/codeblog/rss-xslt/' rel='bookmark' title='Permanent Link: RSS XSLT'>RSS XSLT</a></li>
<li><a href='http://www.shawson.co.uk/codeblog/creating-a-re-usable-shopping-basket-with-generics-in-c-sharp/' rel='bookmark' title='Permanent Link: Creating a re-usable shopping basket with Generics in C#'>Creating a re-usable shopping basket with Generics in C#</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.shawson.co.uk/codeblog/syndicating-to-rss-using-the-build-in-net-syndicationfeed-classes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How To Display Hierarchical Data Using Nested Repeater Controls and Visual C# .NET</title>
		<link>http://www.shawson.co.uk/codeblog/how-to-display-hierarchical-data-by-using-nested-repeater-controls-and-visual-c-net/</link>
		<comments>http://www.shawson.co.uk/codeblog/how-to-display-hierarchical-data-by-using-nested-repeater-controls-and-visual-c-net/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 13:02:51 +0000</pubDate>
		<dc:creator>shawson</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[C#.net]]></category>

		<guid isPermaLink="false">http://www.shawson.co.uk/codeblog/?p=291</guid>
		<description><![CDATA[Just found a piece of functionality which I&#8217;ve never noticed before, for populating nested Repeaters, without doing so in the code behind with a &#8220;OnDataBound&#8221; Event.
It&#8217;s as simple as just setting the DataSource on the child repeater, to a property of the parent repeaters DataItem.  For example;

&#60;asp:Repeater ID=&#34;BookRepeater&#34; runat=&#34;server&#34; onitemdatabound=&#34;bibRepeater_ItemDataBound&#34;&#62;
    &#60;HeaderTemplate&#62;&#60;ul&#62;&#60;/HeaderTemplate&#62;
  [...]


Related posts:<ul><li><a href='http://www.shawson.co.uk/codeblog/using-findcontrol-to-find-a-repeater-nested-inside-a-repeater-with-headertemplate-or-footertemplate-defined/' rel='bookmark' title='Permanent Link: 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://www.shawson.co.uk/codeblog/aspnet-nested-listview-controls-with-all-edit-functionality-working/' rel='bookmark' title='Permanent Link: Asp.net nested ListView control&#8217;s, with edit functionality- example'>Asp.net nested ListView control&#8217;s, with edit functionality- example</a></li>
<li><a href='http://www.shawson.co.uk/codeblog/consuming-rss-feeds-using-asp-net-controls/' rel='bookmark' title='Permanent Link: Consuming RSS Feeds using ASP.net controls'>Consuming RSS Feeds using ASP.net controls</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>Just found a piece of functionality which I&#8217;ve never noticed before, for populating nested Repeaters, without doing so in the code behind with a &#8220;OnDataBound&#8221; Event.</p>
<p>It&#8217;s as simple as just setting the DataSource on the child repeater, to a property of the parent repeaters DataItem.  For example;</p>
<pre class="brush: html">
&lt;asp:Repeater ID=&quot;BookRepeater&quot; runat=&quot;server&quot; onitemdatabound=&quot;bibRepeater_ItemDataBound&quot;&gt;
    &lt;HeaderTemplate&gt;&lt;ul&gt;&lt;/HeaderTemplate&gt;
    &lt;ItemTemplate&gt;
      &lt;li&gt;
         &lt;h1&gt;&lt;%# DataBinder.Eval(Container.DataItem, &quot;BookTitle&quot;)%&gt;&lt;/h1&gt;
         &lt;asp:Repeater ID=&quot;AuthorsRepeater&quot; runat=&quot;server&quot; DataSource=&#039;&lt;%# ((Book)Container.DataItem).Authors %&gt;&#039;&gt;
         &lt;HeaderTemplate&gt;&lt;h5&gt;Author: &lt;/HeaderTemplate&gt;
             &lt;ItemTemplate&gt;
                 &lt;a href=&#039;/AuthorDetails.aspx?id=&lt;%# DataBinder.Eval(Container.DataItem, &quot;Id&quot;)%&gt;&#039; title=&quot;&lt;%# DataBinder.Eval(Container.DataItem, &quot;FirstName&quot;)%&gt; &lt;%# DataBinder.Eval(Container.DataItem, &quot;LastName&quot;)%&gt;&quot;&gt;&lt;%# DataBinder.Eval(Container.DataItem, &quot;FirstName&quot;)%&gt; &lt;%# DataBinder.Eval(Container.DataItem, &quot;LastName&quot;)%&gt;&lt;/a&gt;
             &lt;/ItemTemplate&gt;
             &lt;SeparatorTemplate&gt;, &lt;/SeparatorTemplate&gt;
             &lt;FooterTemplate&gt;&lt;/h5&gt;&lt;/FooterTemplate&gt;
         &lt;/asp:Repeater&gt;
      &lt;/li&gt;
    &lt;/ItemTemplate&gt;
    &lt;FooterTemplate&gt;&lt;/ul&gt;&lt;/FooterTemplate&gt;
&lt;/asp:Repeater&gt;
</pre>
<p>You may need to add a declaration to the namespace in which your entities reside, at the top of your aspx file, like this;</p>
<pre class="brush: xml">
&lt;%@ Import Namespace=&quot;Hachette.Entities.Orchard&quot; %&gt;
</pre>
<p>full details on MSDN; <a href="http://support.microsoft.com/kb/306154">How To Display Hierarchical Data by Using Nested Repeater Controls and Visual C# .NET</a>.</p>


<p>Related posts:<ul><li><a href='http://www.shawson.co.uk/codeblog/using-findcontrol-to-find-a-repeater-nested-inside-a-repeater-with-headertemplate-or-footertemplate-defined/' rel='bookmark' title='Permanent Link: 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://www.shawson.co.uk/codeblog/aspnet-nested-listview-controls-with-all-edit-functionality-working/' rel='bookmark' title='Permanent Link: Asp.net nested ListView control&#8217;s, with edit functionality- example'>Asp.net nested ListView control&#8217;s, with edit functionality- example</a></li>
<li><a href='http://www.shawson.co.uk/codeblog/consuming-rss-feeds-using-asp-net-controls/' rel='bookmark' title='Permanent Link: Consuming RSS Feeds using ASP.net controls'>Consuming RSS Feeds using ASP.net controls</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.shawson.co.uk/codeblog/how-to-display-hierarchical-data-by-using-nested-repeater-controls-and-visual-c-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Asp.net nested ListView control&#8217;s, with edit functionality- example</title>
		<link>http://www.shawson.co.uk/codeblog/aspnet-nested-listview-controls-with-all-edit-functionality-working/</link>
		<comments>http://www.shawson.co.uk/codeblog/aspnet-nested-listview-controls-with-all-edit-functionality-working/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 19:44:03 +0000</pubDate>
		<dc:creator>shawson</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[C#.net]]></category>

		<guid isPermaLink="false">http://www.shawson.co.uk/codeblog/?p=239</guid>
		<description><![CDATA[It might not sound like that much of a tall order, but I couldn&#8217;t find a single working example of this online- there were plenty of nested listview&#8217;s simply spitting out the data, but they all seemed to fall apart when you wanted to perform CRUD operations on the records in the nested ListView.
I eventually [...]


Related posts:<ul><li><a href='http://www.shawson.co.uk/codeblog/how-to-display-hierarchical-data-by-using-nested-repeater-controls-and-visual-c-net/' rel='bookmark' title='Permanent Link: 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://www.shawson.co.uk/codeblog/stop-the-web-config-being-inherited-by-child-applications-in-sub-folders/' rel='bookmark' title='Permanent Link: 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://www.shawson.co.uk/codeblog/globalization-using-aspnet/' rel='bookmark' title='Permanent Link: Globalization &#8220;Current Culture&#8221; settings in the web.config (ASP.NET)'>Globalization &#8220;Current Culture&#8221; settings in the web.config (ASP.NET)</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>It might not sound like that much of a tall order, but I couldn&#8217;t find a single working example of this online- there were plenty of nested listview&#8217;s simply spitting out the data, but they all seemed to fall apart when you wanted to perform CRUD operations on the records in the nested ListView.</p>
<p>I eventually got this going today, after spending far longer than i ever imagined i would on it- the solution in hindsight seems obvious, but they always do- figured i would post here for anyone else who gives this ago, or for when i&#8217;ve totally forgotten about this whole episode, in about a months time;</p>
<p>Create your two ListViews- make sure your nested list view is in the &#8220;SelectedItemTemplate&#8221;  and not the &#8220;EditItemTemplate&#8221; as i tried initially (doh!).  When a row is selected in the ListView, the SelectedValue (or SelectedDataKey) property is set- you can then use this to feed a parameter of the child list view&#8217;s SQL/Object/Linq/Whatever data source.</p>
<p>Here is the complete ASPX markup- there is no code behind used at all.</p>
<pre class="brush: html">&lt;%@ Page Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot;
    CodeBehind=&quot;Default.aspx.cs&quot; Inherits=&quot;ListViewExample._Default&quot; %&gt;
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;
    &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; &gt;
&lt;head runat=&quot;server&quot;&gt;
    &lt;title&gt;ListView Demo&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;form id=&quot;form1&quot; runat=&quot;server&quot;&gt;
    &lt;div&gt;
        &lt;asp:ListView ID=&quot;QuizList&quot; runat=&quot;server&quot; DataSourceID=&quot;QuizData&quot;
            InsertItemPosition=&quot;LastItem&quot; DataKeyNames=&quot;id&quot;&gt;
            &lt;ItemTemplate&gt;
                &lt;tr style=&quot;background-color: #E0FFFF;color: #333333;&quot;&gt;
                    &lt;td&gt;
                        &lt;asp:Button ID=&quot;DeleteButton&quot; runat=&quot;server&quot; CommandName=&quot;Delete&quot;
                            Text=&quot;Delete&quot; /&gt;
                        &lt;asp:Button ID=&quot;EditButton&quot; runat=&quot;server&quot; CommandName=&quot;Edit&quot; Text=&quot;Edit&quot; /&gt;
                        &lt;asp:Button ID=&quot;SelectButton&quot; runat=&quot;server&quot; CommandName=&quot;Select&quot; Text=&quot;Select&quot; /&gt;
                    &lt;/td&gt;
                    &lt;td&gt;
                        &lt;asp:Label ID=&quot;IdLabel&quot; runat=&quot;server&quot; Text=&#039;&lt;%# Eval(&quot;Id&quot;) %&gt;&#039; /&gt;
                    &lt;/td&gt;
                    &lt;td&gt;
                        &lt;asp:Label ID=&quot;QuizTitleLabel&quot; runat=&quot;server&quot; Text=&#039;&lt;%# Eval(&quot;QuizTitle&quot;) %&gt;&#039; /&gt;
                    &lt;/td&gt;
                &lt;/tr&gt;
            &lt;/ItemTemplate&gt;
            &lt;SelectedItemTemplate&gt;
                &lt;tr style=&quot;background-color: #E0FFFF;color: #333333;&quot;&gt;
                    &lt;td&gt;
                        &lt;asp:Button ID=&quot;DeleteButton&quot; runat=&quot;server&quot; CommandName=&quot;Delete&quot;
                            Text=&quot;Delete&quot; /&gt;
                        &lt;asp:Button ID=&quot;EditButton&quot; runat=&quot;server&quot; CommandName=&quot;Edit&quot; Text=&quot;Edit&quot; /&gt;
                    &lt;/td&gt;
                    &lt;td&gt;
                        &lt;asp:Label ID=&quot;IdLabel&quot; runat=&quot;server&quot; Text=&#039;&lt;%# Eval(&quot;Id&quot;) %&gt;&#039; /&gt;
                    &lt;/td&gt;
                    &lt;td&gt;
                        &lt;asp:Label ID=&quot;QuizTitleLabel&quot; runat=&quot;server&quot; Text=&#039;&lt;%# Eval(&quot;QuizTitle&quot;) %&gt;&#039; /&gt;
                    &lt;/td&gt;
                &lt;/tr&gt;
                &lt;tr&gt;
                    &lt;td&gt;&lt;/td&gt;
                    &lt;td colspan=&quot;2&quot;&gt;
                        &lt;asp:ListView ID=&quot;QuestionList&quot; runat=&quot;server&quot; DataSourceID=&quot;QuestionData&quot;
                            InsertItemPosition=&quot;LastItem&quot; DataKeyNames=&quot;id&quot;&gt;
                            &lt;ItemTemplate&gt;
                                &lt;tr style=&quot;background-color:#DCDCDC;color: #000000;&quot;&gt;
                                    &lt;td&gt;
                                        &lt;asp:Button ID=&quot;DeleteButton&quot; runat=&quot;server&quot;
                                               CommandName=&quot;Delete&quot; Text=&quot;Delete&quot; /&gt;
                                        &lt;asp:Button ID=&quot;EditButton&quot; runat=&quot;server&quot;
                                               CommandName=&quot;Edit&quot; Text=&quot;Edit&quot; /&gt;
                                    &lt;/td&gt;
                                    &lt;td&gt;
                                        &lt;asp:Label ID=&quot;IdLabel&quot; runat=&quot;server&quot; Text=&#039;&lt;%# Eval(&quot;Id&quot;) %&gt;&#039; /&gt;
                                    &lt;/td&gt;
                                    &lt;td&gt;
                                        &lt;asp:Label ID=&quot;QuestionLabel&quot; runat=&quot;server&quot;
                                            Text=&#039;&lt;%# Eval(&quot;Question&quot;) %&gt;&#039; /&gt;
                                    &lt;/td&gt;
                                &lt;/tr&gt;
                            &lt;/ItemTemplate&gt;
                            &lt;InsertItemTemplate&gt;
                                &lt;tr style=&quot;&quot;&gt;
                                    &lt;td&gt;
                                        &lt;asp:Button ID=&quot;InsertButton&quot; runat=&quot;server&quot; CommandName=&quot;Insert&quot;
                                            Text=&quot;Insert&quot; /&gt;
                                        &lt;asp:Button ID=&quot;CancelButton&quot; runat=&quot;server&quot; CommandName=&quot;Cancel&quot;
                                            Text=&quot;Clear&quot; /&gt;
                                    &lt;/td&gt;
                                    &lt;td&gt;
                                        &amp;nbsp;&lt;/td&gt;
                                    &lt;td&gt;
                                        &lt;asp:TextBox ID=&quot;QuestionTextBox&quot; runat=&quot;server&quot;
                                            Text=&#039;&lt;%# Bind(&quot;Question&quot;) %&gt;&#039; /&gt;
                                    &lt;/td&gt;
                                &lt;/tr&gt;
                            &lt;/InsertItemTemplate&gt;
                            &lt;LayoutTemplate&gt;
                                &lt;table id=&quot;Table2&quot; runat=&quot;server&quot;&gt;
                                    &lt;tr id=&quot;Tr1&quot; runat=&quot;server&quot;&gt;
                                        &lt;td id=&quot;Td1&quot; runat=&quot;server&quot;&gt;
                                            &lt;table ID=&quot;itemPlaceholderContainer&quot; runat=&quot;server&quot; border=&quot;1&quot;
                                                style=&quot;background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;
                                                &lt;tr id=&quot;Tr2&quot; runat=&quot;server&quot; style=&quot;background-color:#DCDCDC;color: #000000;&quot;&gt;
                                                    &lt;th id=&quot;Th1&quot; runat=&quot;server&quot;&gt;
                                                    &lt;/th&gt;
                                                    &lt;th id=&quot;Th2&quot; runat=&quot;server&quot;&gt;
                                                        Id&lt;/th&gt;
                                                    &lt;th id=&quot;Th3&quot; runat=&quot;server&quot;&gt;
                                                        Question&lt;/th&gt;
                                                &lt;/tr&gt;
                                                &lt;tr ID=&quot;itemPlaceholder&quot; runat=&quot;server&quot;&gt;
                                                &lt;/tr&gt;
                                            &lt;/table&gt;
                                        &lt;/td&gt;
                                    &lt;/tr&gt;
                                    &lt;tr id=&quot;Tr3&quot; runat=&quot;server&quot;&gt;
                                        &lt;td id=&quot;Td2&quot; runat=&quot;server&quot;
                                            style=&quot;text-align: center;background-color: #CCCCCC;font-family: Verdana, Arial, Helvetica, sans-serif;color: #000000;&quot;&gt;
                                        &lt;/td&gt;
                                    &lt;/tr&gt;
                                &lt;/table&gt;
                            &lt;/LayoutTemplate&gt;
                            &lt;EditItemTemplate&gt;
                                &lt;tr style=&quot;background-color:#008A8C;color: #FFFFFF;&quot;&gt;
                                    &lt;td&gt;
                                        &lt;asp:Button ID=&quot;UpdateButton&quot; runat=&quot;server&quot; CommandName=&quot;Update&quot;
                                            Text=&quot;Update&quot; /&gt;
                                        &lt;asp:Button ID=&quot;CancelButton&quot; runat=&quot;server&quot; CommandName=&quot;Cancel&quot;
                                            Text=&quot;Cancel&quot; /&gt;
                                        &lt;asp:HiddenField ID=&quot;HiddenField1&quot; runat=&quot;server&quot; value=&#039;&lt;%# Bind(&quot;QuizId&quot;) %&gt;&#039;/&gt;
                                    &lt;/td&gt;
                                    &lt;td&gt;
                                        &lt;asp:Label ID=&quot;IdLabel1&quot; runat=&quot;server&quot; Text=&#039;&lt;%# Eval(&quot;Id&quot;) %&gt;&#039; /&gt;
                                    &lt;/td&gt;
                                    &lt;td&gt;
                                        &lt;asp:TextBox ID=&quot;QuestionTextBox&quot; runat=&quot;server&quot;
                                            Text=&#039;&lt;%# Bind(&quot;Question&quot;) %&gt;&#039; /&gt;
                                    &lt;/td&gt;
                                &lt;/tr&gt;
                            &lt;/EditItemTemplate&gt;
                            &lt;SelectedItemTemplate&gt;
                                &lt;tr style=&quot;background-color:#008A8C;font-weight: bold;color: #FFFFFF;&quot;&gt;
                                    &lt;td&gt;
                                        &lt;asp:Button ID=&quot;DeleteButton&quot; runat=&quot;server&quot; CommandName=&quot;Delete&quot;
                                            Text=&quot;Delete&quot; /&gt;
                                        &lt;asp:Button ID=&quot;EditButton&quot; runat=&quot;server&quot; CommandName=&quot;Edit&quot; Text=&quot;Edit&quot; /&gt;
                                    &lt;/td&gt;
                                    &lt;td&gt;
                                        &lt;asp:Label ID=&quot;IdLabel&quot; runat=&quot;server&quot; Text=&#039;&lt;%# Eval(&quot;Id&quot;) %&gt;&#039; /&gt;
                                    &lt;/td&gt;
                                    &lt;td&gt;
                                        &lt;asp:Label ID=&quot;QuestionLabel&quot; runat=&quot;server&quot; Text=&#039;&lt;%# Eval(&quot;Question&quot;) %&gt;&#039; /&gt;
                                    &lt;/td&gt;
                                &lt;/tr&gt;
                            &lt;/SelectedItemTemplate&gt;
                        &lt;/asp:ListView&gt;
                    &lt;/td&gt;
                &lt;/tr&gt;
            &lt;/SelectedItemTemplate&gt;
            &lt;InsertItemTemplate&gt;
                &lt;tr style=&quot;&quot;&gt;
                    &lt;td&gt;
                        &lt;asp:Button ID=&quot;InsertButton&quot; runat=&quot;server&quot; CommandName=&quot;Insert&quot;
                            Text=&quot;Insert&quot; /&gt;
                        &lt;asp:Button ID=&quot;CancelButton&quot; runat=&quot;server&quot; CommandName=&quot;Cancel&quot;
                            Text=&quot;Clear&quot; /&gt;
                    &lt;/td&gt;
                    &lt;td&gt;
                        &amp;nbsp;&lt;/td&gt;
                    &lt;td&gt;
                        &lt;asp:TextBox ID=&quot;QuizTitleTextBox&quot; runat=&quot;server&quot;
                            Text=&#039;&lt;%# Bind(&quot;QuizTitle&quot;) %&gt;&#039; /&gt;
                    &lt;/td&gt;
                &lt;/tr&gt;
            &lt;/InsertItemTemplate&gt;
            &lt;LayoutTemplate&gt;
                &lt;table runat=&quot;server&quot;&gt;
                    &lt;tr runat=&quot;server&quot;&gt;
                        &lt;td runat=&quot;server&quot;&gt;
                            &lt;table ID=&quot;itemPlaceholderContainer&quot; runat=&quot;server&quot; border=&quot;1&quot;
                                style=&quot;background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;
                                &lt;tr runat=&quot;server&quot; style=&quot;background-color: #E0FFFF;color: #333333;&quot;&gt;
                                    &lt;th runat=&quot;server&quot;&gt;
                                    &lt;/th&gt;
                                    &lt;th runat=&quot;server&quot;&gt;
                                        Id&lt;/th&gt;
                                    &lt;th runat=&quot;server&quot;&gt;
                                        QuizTitle&lt;/th&gt;
                                &lt;/tr&gt;
                                &lt;tr ID=&quot;itemPlaceholder&quot; runat=&quot;server&quot;&gt;
                                &lt;/tr&gt;
                            &lt;/table&gt;
                        &lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr runat=&quot;server&quot;&gt;
                        &lt;td runat=&quot;server&quot;
                            style=&quot;text-align: center;background-color: #5D7B9D;font-family: Verdana, Arial, Helvetica, sans-serif;color: #FFFFFF&quot;&gt;
                            &lt;asp:DataPager ID=&quot;DataPager1&quot; runat=&quot;server&quot;&gt;
                                &lt;Fields&gt;
                                    &lt;asp:NextPreviousPagerField ButtonType=&quot;Button&quot; ShowFirstPageButton=&quot;True&quot;
                                        ShowLastPageButton=&quot;True&quot; /&gt;
                                &lt;/Fields&gt;
                            &lt;/asp:DataPager&gt;
                        &lt;/td&gt;
                    &lt;/tr&gt;
                &lt;/table&gt;
            &lt;/LayoutTemplate&gt;
            &lt;EditItemTemplate&gt;
                &lt;tr style=&quot;background-color: #999999;&quot;&gt;
                    &lt;td&gt;
                        &lt;asp:Button ID=&quot;UpdateButton&quot; runat=&quot;server&quot; CommandName=&quot;Update&quot;
                            Text=&quot;Update&quot; /&gt;
                        &lt;asp:Button ID=&quot;CancelButton&quot; runat=&quot;server&quot; CommandName=&quot;Cancel&quot;
                            Text=&quot;Cancel&quot; /&gt;
                    &lt;/td&gt;
                    &lt;td&gt;
                        &lt;asp:Label ID=&quot;IdLabel1&quot; runat=&quot;server&quot; Text=&#039;&lt;%# Eval(&quot;Id&quot;) %&gt;&#039; /&gt;
                    &lt;/td&gt;
                    &lt;td&gt;
                        &lt;asp:TextBox ID=&quot;QuizTitleTextBox&quot; runat=&quot;server&quot;
                            Text=&#039;&lt;%# Bind(&quot;QuizTitle&quot;) %&gt;&#039; /&gt;
                    &lt;/td&gt;
                &lt;/tr&gt;
            &lt;/EditItemTemplate&gt;
        &lt;/asp:ListView&gt;       

        &lt;asp:SqlDataSource ID=&quot;QuizData&quot; runat=&quot;server&quot;
            ConnectionString=&quot;&lt;%$ ConnectionStrings:TestDBConnection %&gt;&quot;
            DeleteCommand=&quot;DeleteQuiz&quot; DeleteCommandType=&quot;StoredProcedure&quot;
            InsertCommand=&quot;UpdateQuiz&quot; InsertCommandType=&quot;StoredProcedure&quot; SelectCommand=&quot;GetAllQuizes&quot;
            SelectCommandType=&quot;StoredProcedure&quot; UpdateCommand=&quot;UpdateQuiz&quot;
            UpdateCommandType=&quot;StoredProcedure&quot;&gt;
            &lt;DeleteParameters&gt;
                &lt;asp:Parameter Name=&quot;Id&quot; Type=&quot;Int32&quot; /&gt;
            &lt;/DeleteParameters&gt;
            &lt;UpdateParameters&gt;
                &lt;asp:Parameter Name=&quot;Id&quot; Type=&quot;Int32&quot; /&gt;
                &lt;asp:Parameter Name=&quot;QuizTitle&quot; Type=&quot;String&quot; /&gt;
            &lt;/UpdateParameters&gt;
            &lt;InsertParameters&gt;
                &lt;asp:Parameter Name=&quot;Id&quot; Type=&quot;Int32&quot; /&gt;
                &lt;asp:Parameter Name=&quot;QuizTitle&quot; Type=&quot;String&quot; /&gt;
            &lt;/InsertParameters&gt;
        &lt;/asp:SqlDataSource&gt;
        &lt;asp:SqlDataSource ID=&quot;QuestionData&quot; runat=&quot;server&quot;
            ConnectionString=&quot;&lt;%$ ConnectionStrings:TestDBConnection %&gt;&quot;
            DeleteCommand=&quot;DeleteQuestion&quot; DeleteCommandType=&quot;StoredProcedure&quot;
            InsertCommand=&quot;InsertQuestion&quot; InsertCommandType=&quot;StoredProcedure&quot;
            ProviderName=&quot;System.Data.SqlClient&quot; SelectCommand=&quot;GetQuestionsByQuizId&quot;
            SelectCommandType=&quot;StoredProcedure&quot; UpdateCommand=&quot;UpdateQuestion&quot;
            UpdateCommandType=&quot;StoredProcedure&quot;&gt;
            &lt;SelectParameters&gt;
                &lt;asp:ControlParameter ControlID=&quot;QuizList&quot; Name=&quot;QuizId&quot;
                    PropertyName=&quot;SelectedValue&quot; Type=&quot;Int32&quot; DefaultValue=&quot;&quot; /&gt;
            &lt;/SelectParameters&gt;
            &lt;DeleteParameters&gt;
                &lt;asp:Parameter Name=&quot;Id&quot; Type=&quot;Int32&quot; /&gt;
            &lt;/DeleteParameters&gt;
            &lt;UpdateParameters&gt;
                &lt;asp:Parameter Name=&quot;Id&quot; Type=&quot;Int32&quot; /&gt;
                &lt;asp:Parameter Name=&quot;QuizId&quot; Type=&quot;Int32&quot; /&gt;
                &lt;asp:Parameter Name=&quot;Question&quot; Type=&quot;String&quot; /&gt;
            &lt;/UpdateParameters&gt;
            &lt;InsertParameters&gt;
                &lt;asp:Parameter Name=&quot;Id&quot; Type=&quot;Int32&quot; /&gt;

                &lt;asp:ControlParameter ControlID=&quot;QuizList&quot; Name=&quot;QuizId&quot;
                    PropertyName=&quot;SelectedValue&quot; Type=&quot;Int32&quot; DefaultValue=&quot;&quot; /&gt;

                &lt;asp:Parameter Name=&quot;Question&quot; Type=&quot;String&quot; /&gt;
            &lt;/InsertParameters&gt;
        &lt;/asp:SqlDataSource&gt;
    &lt;/div&gt;
    &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<p>Related posts:<ul><li><a href='http://www.shawson.co.uk/codeblog/how-to-display-hierarchical-data-by-using-nested-repeater-controls-and-visual-c-net/' rel='bookmark' title='Permanent Link: 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://www.shawson.co.uk/codeblog/stop-the-web-config-being-inherited-by-child-applications-in-sub-folders/' rel='bookmark' title='Permanent Link: 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://www.shawson.co.uk/codeblog/globalization-using-aspnet/' rel='bookmark' title='Permanent Link: Globalization &#8220;Current Culture&#8221; settings in the web.config (ASP.NET)'>Globalization &#8220;Current Culture&#8221; settings in the web.config (ASP.NET)</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.shawson.co.uk/codeblog/aspnet-nested-listview-controls-with-all-edit-functionality-working/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The provided URI scheme &#8216;http&#8217; is invalid; expected &#8216;https</title>
		<link>http://www.shawson.co.uk/codeblog/the-provided-uri-scheme-http-is-invalid-expected-https/</link>
		<comments>http://www.shawson.co.uk/codeblog/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 attribute from [...]


Related posts:<ul><li><a href='http://www.shawson.co.uk/codeblog/making-your-wcf-service-compatible-with-legacy-net-1-1-applications/' rel='bookmark' title='Permanent Link: 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://www.shawson.co.uk/codeblog/setting-up-session-state-database-on-sql-server/' rel='bookmark' title='Permanent Link: Setting up session state database on sql server'>Setting up session state database on sql server</a></li>
<li><a href='http://www.shawson.co.uk/codeblog/running-vb-net-alongside-c-in-a-web-app/' rel='bookmark' title='Permanent Link: 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>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://www.shawson.co.uk/codeblog/making-your-wcf-service-compatible-with-legacy-net-1-1-applications/' rel='bookmark' title='Permanent Link: 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://www.shawson.co.uk/codeblog/setting-up-session-state-database-on-sql-server/' rel='bookmark' title='Permanent Link: Setting up session state database on sql server'>Setting up session state database on sql server</a></li>
<li><a href='http://www.shawson.co.uk/codeblog/running-vb-net-alongside-c-in-a-web-app/' rel='bookmark' title='Permanent Link: 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://www.shawson.co.uk/codeblog/the-provided-uri-scheme-http-is-invalid-expected-https/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
