<feed xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns="http://www.w3.org/2005/Atom" xml:lang="nl-BE">
    <title>Jeroen Bourdeaud'hui</title>
    <link rel="self" type="application/xml" href="http://geekswithblogs.net/jeroenb/Atom.aspx" />
    <subtitle type="html"> web application developer</subtitle>
    <id>http://geekswithblogs.net/jeroenb/Default.aspx</id>
    <author>
        <name>Jeroen Bourdeaud'hui</name>
        <uri>http://geekswithblogs.net/jeroenb/Default.aspx</uri>
    </author>
    <generator uri="http://subtextproject.com" version="Subtext Version 0.0.0.0">Subtext</generator>
    <updated>2012-02-17T19:50:26Z</updated>
    <entry>
        <title>TechDays Belgium 2012</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/jeroenb/archive/2012/01/06/techdays-belgium.aspx" />
        <id>http://geekswithblogs.net/jeroenb/archive/2012/01/06/techdays-belgium.aspx</id>
        <published>2012-01-06T13:55:0001:00:00</published>
        <updated>2012-01-06T14:01:22Z</updated>
        <content type="html">&lt;font face="Verdana"&gt;&lt;br /&gt;Next month, the TechDays edition 2012 (14-15-16 february)&lt;/font&gt; &lt;font face="Verdana"&gt;will take place in Belgium. The &lt;/font&gt;&lt;font face="Verdana"&gt;last three years, the&lt;/font&gt;&lt;font face="Verdana"&gt; event passed in Antwerp, but now they are moving to a new location.
				Kinepolis Imagibraine in Braine l'Alleud (Eigenbrakel).&lt;br /&gt;The location isn't that important.&lt;br /&gt;&lt;br /&gt;The hard thing will be, to pick out the most interesting sessions, because there any many sessions in the same time-blocks.&lt;br /&gt;
&lt;table border="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;
Here is a list of some sessions, i'll certainly attend:&lt;br /&gt;&lt;h3&gt;&lt;font size="2" face="Verdana"&gt;&lt;a target="_blank" href="http://www.microsoft.com/belux/techdays/2012/SessionDetail.aspx?sessionId=282"&gt;Introducing Windows Runtime in Windows 8&lt;/a&gt;&lt;a target="_blank" href="http://www.microsoft.com/belux/techdays/2012/SessionDetail.aspx?sessionId=245"&gt;&lt;br /&gt;What's new in Visual Studio 11 for Application Lifecycle Management&lt;/a&gt;&lt;a target="_blank" href="http://www.microsoft.com/belux/techdays/2012/SessionDetail.aspx?sessionId=200"&gt;&lt;br /&gt;The Future of C# and Visual Basic&lt;/a&gt;&lt;a target="_blank" href="http://www.microsoft.com/belux/techdays/2012/SessionDetail.aspx?sessionId=267"&gt;&lt;br /&gt;The Developer Story: Platform Futures&lt;/a&gt;&lt;a target="_blank" href="http://www.microsoft.com/belux/techdays/2012/SessionDetail.aspx?sessionId=238"&gt;&lt;br /&gt;Project Roslyn: Exposing the C# and VB compiler’s code analysis&lt;/a&gt;&lt;br /&gt;&lt;a target="_blank" href="http://www.microsoft.com/belux/techdays/2012/SessionDetail.aspx?sessionId=271"&gt;Real world example: integration in the cloud&lt;br /&gt;Windows Phone 7 by Rob Miles&lt;/a&gt;&lt;/font&gt;&lt;br /&gt;&lt;/h3&gt;
&lt;/td&gt;
&lt;td style="text-align:right" align="right"&gt;
&lt;div align="right"&gt;&lt;br /&gt;&lt;img src="http://www.microsoft.com/belux/techdays/2012/images/mstoplogo.png" /&gt;
&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;img src="http://www.microsoft.com/belux/techdays/2012/images/techdayslogo.png" /&gt;
&lt;/td&gt;
&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/font&gt;&lt;img src="http://geekswithblogs.net/jeroenb/aggbug/148260.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/jeroenb/comments/148260.aspx</wfw:comment>
        <slash:comments>2</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/jeroenb/comments/commentRss/148260.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/jeroenb/services/trackbacks/148260.aspx</trackback:ping>
    </entry>
    <entry>
        <title>SignalR: example chat application</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/jeroenb/archive/2011/12/14/signalr-starter-application.aspx" />
        <id>http://geekswithblogs.net/jeroenb/archive/2011/12/14/signalr-starter-application.aspx</id>
        <published>2011-12-14T08:44:1901:00:00</published>
        <updated>2011-12-14T11:32:27Z</updated>
        <content type="html">
		&lt;p&gt;I remember myself a tweet from Scott Hanselman a couple of months ago, where he asked us to check out a small application he wrote. As one of  the first testers of his new "thing", I was interested but there were no documentation or libs available yet.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
		&lt;p&gt;
				&lt;img src="http://www.hanselman.com/blog/content/binary/WindowsLiveWriter/Asynchronousscalablewebapplicationswithp_122E/SignalR%20Chat%20-%20Google%20Chrome%20%2869%29_thumb.png" /&gt;
		&lt;/p&gt;
		&lt;br /&gt;
		&lt;br /&gt;
		&lt;br /&gt;
		&lt;br /&gt;
		&lt;br /&gt;
		&lt;br /&gt;
		&lt;br /&gt;
		&lt;br /&gt;
		&lt;br /&gt;
		&lt;br /&gt;
		&lt;br /&gt;
		&lt;br /&gt;
		&lt;br /&gt;
		&lt;br /&gt;
		&lt;br /&gt;
		&lt;br /&gt;
		&lt;br /&gt;
		&lt;br /&gt;
		&lt;br /&gt;
		&lt;br /&gt;
		&lt;br /&gt;
		&lt;br /&gt;
		&lt;br /&gt;
		&lt;br /&gt;
		&lt;br /&gt;
		&lt;br /&gt;
		&lt;br /&gt;
		&lt;br /&gt;
		&lt;br /&gt;
		&lt;br /&gt;
		&lt;p&gt;A couple of days a go, I read a blogpost from Maarten Balliauw about SignalR. (&lt;a href="http://blog.maartenballiauw.be/post/2011/11/29/Techniques-for-real-time-client-server-communication.aspx" target="_blank"&gt;Maarten's blog&lt;/a&gt;). Because I allready heard about SignalR a couple of months ago, I had to develop a very small application to test how it really works.&lt;/p&gt;
		&lt;br /&gt;
		&lt;p&gt;
				&lt;strong&gt;
						&lt;font size="4"&gt;1. Install SignalR package&lt;/font&gt;
				&lt;/strong&gt;
		&lt;/p&gt;
		&lt;p&gt;You also have to update the jquery package to 1.6.2 or higher&lt;img src="http://gwb.blob.core.windows.net/jeroenb/9949/o_nuget.png" /&gt;&lt;/p&gt;
		&lt;p&gt;
				&lt;strong&gt;
						&lt;font size="4"&gt;2. Create a chat class&lt;/font&gt;
				&lt;/strong&gt;
		&lt;/p&gt;We only want 1 chat instance so use the Singleton pattern, lazy creation because that's thread safe. &lt;br /&gt;&lt;pre&gt;&lt;code&gt;
    public class Chat
    {
        private readonly static Lazy&lt;chat&gt; _instance = new Lazy&lt;chat&gt;(() =&amp;gt; new Chat());
                public static Chat Instance
        {
            get
            {
                return _instance.Value;
            }
        }
    }
&lt;/chat&gt;&lt;/chat&gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;font size="4"&gt;3. Create a (chat)hub&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Create a class ChatHub which will inherit from Hub&lt;/p&gt;&lt;br /&gt;Have a look at the HubName attribute. That's the name you will use in javascript to define the connection. &lt;pre&gt;&lt;code&gt;
    [HubName("chatHub")]
    public class ChatHub : Hub
    {
        private readonly int TimeoutInSeconds = 30;
        private readonly Chat _chat;

        public ChatHub() : this(Chat.Instance) { }

        public ChatHub(Chat chat)
        {            
            _chat = chat;
        }
    }
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;&lt;font size="4"&gt;&lt;strong&gt;4. Javascript connection&lt;/strong&gt;&lt;/font&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;Create a connection between the client and the server. When the connection has been started, we want to call the join method on the server.&lt;br /&gt;&lt;pre&gt;&lt;code&gt;var chatHubClient = $.connection.chatHub;&lt;br /&gt;
// Start the connection&lt;br /&gt;
$.connection.hub.start(function () {&lt;br /&gt;
chatHubClient.join('@Model.Name');&lt;br /&gt;
});&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;&lt;font size="4"&gt;&lt;strong&gt;5. Model&lt;/strong&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Define a callback method on the server in the Chathub class &lt;br /&gt;&lt;/p&gt;&lt;pre&gt;&lt;code&gt;        public void Join(string myName)
        {
            if (Chat.Clients.Where(x =&amp;gt; x.Name.Equals(myName)).Count().Equals(0))
            {
                Chat.Clients.Add(new Client() { Name = myName, LastResponse=DateTime.Now });
                SendMessageServer(string.Format("{0} entered the chat", myName));
                GetClients();
                Caller.Naam = myName;
            }
            else
                throw new Exception("This login is allready in use");
        }&lt;/code&gt; &lt;/pre&gt;&lt;br /&gt;&lt;a target="_blank" href="http://www.2shared.com/file/SAiy5Jo-/SignalRSimpleChat.html"&gt;Download the Chat Application Example&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Get more information on &lt;a target="_blank" href="https://github.com/SignalR/SignalR"&gt;GitHub&lt;/a&gt;&lt;br /&gt;Listen to a podcast about SignalR on &lt;a target="_blank" href="http://www.dotnetrocks.com/default.aspx?showNum=723"&gt;DotNetRocks&lt;/a&gt;&lt;img src="http://geekswithblogs.net/jeroenb/aggbug/148041.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/jeroenb/comments/148041.aspx</wfw:comment>
        <slash:comments>7</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/jeroenb/comments/commentRss/148041.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/jeroenb/services/trackbacks/148041.aspx</trackback:ping>
    </entry>
    <entry>
        <title>ASP.Net Web Application Administration Website showing error.aspx on startup</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/jeroenb/archive/2011/12/13/asp.net-web-application-administration-website-showing-error.aspx-on-startup.aspx" />
        <id>http://geekswithblogs.net/jeroenb/archive/2011/12/13/asp.net-web-application-administration-website-showing-error.aspx-on-startup.aspx</id>
        <published>2011-12-13T23:06:2301:00:00</published>
        <updated>2011-12-13T23:06:23Z</updated>
        <content type="html">To add a new role into my aspnet database, I tried to use the &lt;a title="asp.net" href="http://geekswithblogs.net/jeroenb" rel="asp.net" target="_blank"&gt;asp.net&lt;/a&gt; Web Application Administration Website. But it was showing the following error message:&lt;br /&gt;&lt;b&gt;An error was encountered. Please return to the previous page and try again.                                    
                                    &lt;br /&gt;&lt;/b&gt;&lt;br /&gt;Strange, because I was sure, that my connectionstring was correct.&lt;br /&gt;&lt;br /&gt;After a while, after reading about the  &lt;a title="asp.net" href="http://geekswithblogs.net/jeroenb" rel="asp.net" target="_blank"&gt;asp.net&lt;/a&gt; Web Application Administration Website, I found that it can't handle spaces or special character in the project path.&lt;br /&gt;My project was located in C:\Users\JEROEN\Documents\&lt;font color="#FF0000"&gt;Visual Studio 2010&lt;/font&gt;\Projects\&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://geekswithblogs.net/jeroenb/aggbug/148037.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/jeroenb/comments/148037.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/jeroenb/comments/commentRss/148037.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/jeroenb/services/trackbacks/148037.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Trouble with WCF and X 509 certificates</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/jeroenb/archive/2011/12/13/trouble-with-wcf-and-x-509-certificates.aspx" />
        <id>http://geekswithblogs.net/jeroenb/archive/2011/12/13/trouble-with-wcf-and-x-509-certificates.aspx</id>
        <published>2011-12-13T22:49:2501:00:00</published>
        <updated>2011-12-15T14:18:34Z</updated>
        <content type="html">
		&lt;br /&gt;I played a bit with WCF and security, but I had some trouble to create certificates between the server and the client.&lt;br /&gt;&lt;br /&gt;This article helped me out:&lt;br /&gt;&lt;a target="_blank" title="9 simple steps to enable X.509 certificates on WCF" href="http://www.codeproject.com/KB/WCF/9StepsWCF.aspx?msg=3181718"&gt;9 simple steps to enable X.509 certificates on WCF&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://geekswithblogs.net/jeroenb/aggbug/148036.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/jeroenb/comments/148036.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/jeroenb/comments/commentRss/148036.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/jeroenb/services/trackbacks/148036.aspx</trackback:ping>
    </entry>
    <entry>
        <title>How to prevent the user to post page twice, by using refresh</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/jeroenb/archive/2011/09/29/how-to-prevent-the-user-to-post-page-twice-by-again.aspx" />
        <id>http://geekswithblogs.net/jeroenb/archive/2011/09/29/how-to-prevent-the-user-to-post-page-twice-by-again.aspx</id>
        <published>2011-09-29T21:51:3902:00:00</published>
        <updated>2011-09-29T21:51:39Z</updated>
        <content type="html">&lt;p&gt;When a user post's data to the server, the page will be reloaded. When the user hits the F5/refresh button, a message appears, which tells us, that we´ve allready sended the data to the server. And asks us if we want to sent it again.&lt;br /&gt;
If the user clicks "yes", we have to catch that, we don´t want this in our application&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
- check that the user can only post something every 2 minutes.&lt;br /&gt;
- save the posted data in viewstate and check if something changed &lt;br /&gt;
- ...&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
Or we can check if the user hit the refresh button. I haven't found a way to check this in Javascript, which will work in all browser.&lt;br /&gt;
&lt;br /&gt;
Or our solution is to check it in code. Add the following code, for example in a basepage.&lt;/p&gt;
&lt;p&gt;    &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;     Private _refreshState As Boolean&lt;br /&gt;     Private _isRefresh As Boolean&lt;br /&gt;     Private _terminateRaisePostback As Boolean&lt;br /&gt; &lt;br /&gt;     Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load&lt;br /&gt;         If Page.IsPostBack AndAlso _isRefresh Then&lt;br /&gt;             Response.Redirect(HttpContext.Current.Request.Url.ToString(), False)&lt;br /&gt;             HttpContext.Current.ApplicationInstance.CompleteRequest()&lt;br /&gt;             _terminateRaisePostback = True&lt;br /&gt;         End If&lt;br /&gt;     End Sub&lt;br /&gt; &lt;br /&gt;     Protected Overrides Sub LoadViewState(ByVal savedState As Object)&lt;br /&gt;         Dim AllStates As Object() = CType(savedState, Object())&lt;br /&gt;         MyBase.LoadViewState(AllStates(0))&lt;br /&gt;         _refreshState = Boolean.Parse(CStr(AllStates(1)))&lt;br /&gt;         _isRefresh = _refreshState.Equals(CBool(Session("__ISREFRESH")))&lt;br /&gt;     End Sub&lt;br /&gt; &lt;br /&gt;     Protected Overrides Function SaveViewState() As Object&lt;br /&gt;         Session("__ISREFRESH") = _refreshState&lt;br /&gt;         Dim AllStates() As Object = New Object(2) {}&lt;br /&gt;         AllStates(0) = MyBase.SaveViewState&lt;br /&gt;         AllStates(1) = Not (_refreshState)&lt;br /&gt;         Return AllStates&lt;br /&gt;     End Function&lt;br /&gt; &lt;br /&gt;     Protected Overrides Sub RaisePostBackEvent(ByVal sourceControl As System.Web.UI.IPostBackEventHandler, ByVal eventArgument As String)&lt;br /&gt;         If Not _terminateRaisePostback Then&lt;br /&gt;             MyBase.RaisePostBackEvent(sourceControl, eventArgument)&lt;br /&gt;         End If&lt;br /&gt;     End Sub &lt;/code&gt;&lt;/pre&gt;&lt;img src="http://geekswithblogs.net/jeroenb/aggbug/147111.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/jeroenb/comments/147111.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/jeroenb/comments/commentRss/147111.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/jeroenb/services/trackbacks/147111.aspx</trackback:ping>
    </entry>
    <entry>
        <title>How to Encrypt connection string in web.config</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/jeroenb/archive/2011/06/08/how-to-encrypt-connection-string-in-web.config.aspx" />
        <id>http://geekswithblogs.net/jeroenb/archive/2011/06/08/how-to-encrypt-connection-string-in-web.config.aspx</id>
        <published>2011-06-08T14:07:4502:00:00</published>
        <updated>2011-06-09T07:57:28Z</updated>
        <content type="html">&lt;p&gt;A couple of years ago, I used 'something' to encrypt the connectionstring on a production server. But I never wrote anything down about it. And in the other projects I did later, I never had deploy to the production server. &lt;br /&gt;
&lt;br /&gt;
Yesterday, I had to use it again but I couldn't find it. Why? Because I never wrote about it. This blogpost is copy of &lt;a target="_blank" href="http://chiragrdarji.wordpress.com/"&gt;Chirag Darji &lt;/a&gt;post about the encryption of the connectionstring in web.config. All credits to him!&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;The most sensitive information stored in web.config file can be the connection string. You do not want to disclose the information related to your database to all the users where the application is deployed. Every time it is not possible to have a private machine for your sites, you may need to deploy the site in shared host environment. To encrypt the connection string in above situation is advisable.&lt;/p&gt;
&lt;p&gt;ASP.NET 2.0 provides in built functionality to encrypt few sections of web.config file. The task can be completed using Aspnet_regiis.exe. Below is the web.config file and &amp;lt;connectionStrings&amp;gt; section.   &lt;/p&gt;
&lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, 'Courier New', courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;
&lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;
&lt;pre&gt;&lt;code&gt;
&amp;lt;connectionstrings&amp;gt;		
	&amp;lt;add name="cn1" connectionstring="Server=DB SERVER;
	database=TestDatabase;
	uid=UID;
	pwd=PWD;"&amp;gt;
&amp;lt;/connectionstrings&amp;gt;		
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Fig – (1) Connection string section of web.config file&lt;/p&gt;
&lt;p&gt;     To encrypt the connection string section follow the steps,&lt;/p&gt;
&lt;p&gt;1. Go to Start - Programm Files -&amp;gt; Microsoft Visual Studio 2005 -&amp;gt; Visual Tools &lt;br /&gt;
    -&amp;gt; Microsoft Visual Studio 2005 Command Prompt&lt;/p&gt;
&lt;p&gt;2. Type following command,&lt;/p&gt;
&lt;p&gt;&lt;b&gt;    aspnet_regiis.exe -pef “connectionStrings” C:\Projects\DemoApplication&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;    &lt;strong&gt;-pef&lt;/strong&gt; indicates that the application is built as File System website.  The second argument is the name of configuration section needs to be encrypted. Third argument is the physical path where the web.config file is located.&lt;/p&gt;
&lt;p&gt;   If you are using IIS base web site the command will be,&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;   aspnet_regiis.exe -pe “connectionStrings” -app “/DemoApplication”&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt; -pe&lt;/strong&gt; indicates that the application is built as IIS based site. The second argument is the name of configuration section needs to be encrypted. Third argument “-app” indicates virtual directory and last argument is the name of virtual directory where application is deployed.   &lt;/p&gt;
&lt;p&gt;   If everything goes well you will receive a message “&lt;strong&gt;Encrypting configuration section…&lt;/strong&gt;&lt;strong&gt;Succeeded!”&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;  Open your web.config file and you can see that connection string is encrypted,&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
&amp;lt;connectionStrings configProtectionProvider="RsaProtectedConfigurationProvider"&amp;gt;
	&amp;lt;EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element"
   	xmlns="http://www.w3.org/2001/04/xmlenc#"&amp;gt;
   		&amp;lt;EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc" /&amp;gt;		
		&amp;lt;KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"&amp;gt; 
			&amp;lt;EncryptedKey xmlns="http://www.w3.org/2001/04/xmlenc#"&amp;gt;
				&amp;lt;EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5" /&amp;gt;
				&amp;lt;KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"&amp;gt;
					&amp;lt;KeyName&amp;gt;Rsa Key&amp;lt;/KeyName&amp;gt;		
				&amp;lt;/KeyInfo&amp;gt;
  				&amp;lt;CipherData&amp;gt;
 					&amp;lt;CipherValue&amp;gt;Ik+l105qm6WIIQgS9LsnF8RRxQtj2ChEwq7DbHapb440GynFEoGF6Y3EM3Iw/lyDV8+P8bIsketi5Ofy9gpZlCBir7n315Q6RPbdclUo79o/LKadhX4jHFpnSIQNIF/LhwjwkLFC0=&amp;lt;/CipherValue&amp;gt;
	 			&amp;lt;/CipherData&amp;gt;
 			&amp;lt;/EncryptedKey&amp;gt;
  		&amp;lt;/KeyInfo&amp;gt;
  		&amp;lt;CipherData&amp;gt;
  			&amp;lt;CipherValue&amp;gt;JsLrQ5S8Pq3U72nQzmSl/XlLX72GM0O3EbPLaHRNvjTDgG9seDflGMjTfO10M1s7/mPh//3MhA7pr0dNHUJ143Svhu5YXODRC6z9CkR0uyE4H7uDvTKJ8eR3m9APhXoo1sT1K3tCLHD6a2BM+gqSk9d8PzCfbM8Gmzmpjz1ElIaxu62b4cg9SNxp8o86O9N3fBl2mq&amp;lt;/CipherValue&amp;gt;
  		&amp;lt;/CipherData&amp;gt;
  	&amp;lt;/EncryptedData&amp;gt;
&amp;lt;/connectionStrings&amp;gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Fig – (2) Encrypted connection string section&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;       You do not have to write any code to decrypt this connection string in your application, dotnet automatically decrypts it. So if you write following code you can see plaintext connection string.&lt;/p&gt;
&lt;div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, 'Courier New', courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px"&gt;
&lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;
&lt;pre&gt;&lt;code&gt;Response.Write(ConfigurationManager.ConnectionStrings[&lt;span style="color: #006080"&gt;"cn1"&lt;/span&gt;].ConnectionString);&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;    Now to decrypt the configuration section in web.config file use following command,&lt;/p&gt;
&lt;p&gt;For File System Application,&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;aspnet_regiis.exe -pdf “connectionStrings” C:\Projects\DemoApplication&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;For IIS based Application&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;aspnet_regiis.exe -pd “connectionStrings” -app “/DemoApplication”&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;    If you want to encrypt any nested section in web.config file like &amp;lt;pages&amp;gt; element within &amp;lt;system.web&amp;gt; you need to write full section name as shown below,&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;aspnet_regiis.exe -pef “system.web/Pages” C:\Projects\DemoApplication&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;     You can encrypt all the sections of web.config file except following using the method I displayed in this article,&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;lt;processModel&amp;gt;&lt;br /&gt;
&amp;lt;runtime&amp;gt;&lt;br /&gt;
&amp;lt;mscorlib&amp;gt;&lt;br /&gt;
&amp;lt;startup&amp;gt;&lt;br /&gt;
&amp;lt;system.runtime.remoting&amp;gt;&lt;br /&gt;
&amp;lt;configProtectedData&amp;gt;&lt;br /&gt;
&amp;lt;satelliteassemblies&amp;gt;&lt;br /&gt;
&amp;lt;cryptographySettings&amp;gt;&lt;br /&gt;
&amp;lt;cryptoNameMapping&amp;gt;&lt;br /&gt;
&amp;lt;cryptoClasses&amp;gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;   To encrypt these section you needed to use Aspnet_setreg.exe tool.  For more detail about Aspnet_setreg.exe tool search Microsoft Knowledge Base article 329290, How to use the ASP.NET utility to encrypt credentials and session state connection strings.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://chiragrdarji.wordpress.com/2008/08/11/how-to-encrypt-connection-string-in-webconfig/"&gt;Source&lt;/a&gt;&lt;/p&gt;&lt;img src="http://geekswithblogs.net/jeroenb/aggbug/145770.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/jeroenb/comments/145770.aspx</wfw:comment>
        <slash:comments>2</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/jeroenb/comments/commentRss/145770.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/jeroenb/services/trackbacks/145770.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Just to remember: new Guid() != Guid.NewGuid()</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/jeroenb/archive/2011/05/13/just-to-remember-new-guid--guid.newguid.aspx" />
        <id>http://geekswithblogs.net/jeroenb/archive/2011/05/13/just-to-remember-new-guid--guid.newguid.aspx</id>
        <published>2011-05-13T10:30:0102:00:00</published>
        <updated>2011-05-13T10:44:28Z</updated>
        <content type="html">&lt;p&gt;Just to remember:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
 &lt;/p&gt;
&lt;p&gt;when you want a new guid:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Dim g As New Guid()&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;--&amp;gt; the value of g is empty&lt;/p&gt;
&lt;p&gt;Just call:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Dim g As Guid = Guid.NewGuid()&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and everything works fine!&lt;/p&gt;&lt;img src="http://geekswithblogs.net/jeroenb/aggbug/145320.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/jeroenb/comments/145320.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/jeroenb/comments/commentRss/145320.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/jeroenb/services/trackbacks/145320.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Paging using Linq</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/jeroenb/archive/2011/05/10/paging-using-linq.aspx" />
        <id>http://geekswithblogs.net/jeroenb/archive/2011/05/10/paging-using-linq.aspx</id>
        <published>2011-05-10T12:22:2002:00:00</published>
        <updated>2011-05-10T12:30:58Z</updated>
        <content type="html">&lt;p&gt;Last, I needed a function to add paging. The first problem I had, was how to this.&lt;br /&gt;
A couple of seconds later, I allready had a solution to this problem: Linq&lt;/p&gt;
&lt;p&gt;Skip and take will do the trick.&lt;/p&gt;
&lt;p&gt;list&amp;lt;t&amp;gt;.Skip(_howManyRecordsDoYouWantToSkip).Take(_howManyRecordsDoYouWantToTake)&lt;br /&gt;
&lt;br /&gt;
This won't crash if you pass one of both statements. It will just return the result.&lt;/p&gt;
&lt;p&gt;source.Skip(startRowIndex).Take(pageSize)&lt;/p&gt;
&lt;p&gt;I've created an extension method to use this function.&lt;/p&gt;
&lt;p&gt; VB&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
     Module LinqHelpers
        &amp;lt;System.Runtime.CompilerServices.Extension()&amp;gt; _
        Public Function Page(Of TSource)(ByVal source As IEnumerable(Of TSource), ByVal startRowIndex As Integer, ByVal pageSize As Integer) As IEnumerable(Of TSource)
            Return source.Skip(startRowIndex).Take(pageSize)
        End Function
    End Module

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;
 C#&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
public static class LinqHelpers
{
    public static IEnumerable&lt;tsource&gt;&lt;/tsource&gt; Page&lt;tsource&gt;&lt;/tsource&gt;(this IEnumerable&lt;tsource&gt;&lt;/tsource&gt; source, int startRowIndex, int pageSize)
    {
            return source.Skip(startRowIndex).Take(pageSize);
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Change IEnumerable to IQueryable if you want to use Linq to SQL.&lt;/p&gt;
&lt;p&gt;Take care about the traffic, if you use large lists and add paging at runtime. You'd better select the rows you want to show! (IQueryable)&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;img src="http://geekswithblogs.net/jeroenb/aggbug/145259.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/jeroenb/comments/145259.aspx</wfw:comment>
        <slash:comments>2</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/jeroenb/comments/commentRss/145259.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/jeroenb/services/trackbacks/145259.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Code Retreat Belgium</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/jeroenb/archive/2011/05/08/code-retreat.aspx" />
        <id>http://geekswithblogs.net/jeroenb/archive/2011/05/08/code-retreat.aspx</id>
        <published>2011-05-08T22:22:0102:00:00</published>
        <updated>2011-05-09T12:59:38Z</updated>
        <content type="html">&lt;p style="text-align: left"&gt;Last saturday I participated the Code Retreat organised by &lt;a target="_blank" href="http://www.agileminds.be"&gt;Agileminds.be&lt;/a&gt; &lt;br /&gt;
There were 6 code retreats at the same moment arround the world. In Belgium, UK, Spain, USA and  2 in Romania.&lt;/p&gt;
&lt;p&gt;We all had the same challenge, to implement the Conway's Game of Life. By writing beautiful code, using TDD .&lt;br /&gt;
&lt;br /&gt;
For me, TDD is a new thing. I allready read about it, but thinking in a TDD way is really different and difficult. &lt;br /&gt;
I met interesting people, and it was great to skype with the other Code Retreat around the world. We had people working the .Net framework (C# and vb.net), Java, Python, Ruby and it was great to work/test in other frameworks.&lt;br /&gt;
&lt;br /&gt;
In the future I will try to apply some of the best practices defined by TDD, but it will be hard.&lt;br /&gt;
&lt;br /&gt;
Thanks to Adrian Bolboaca, Erik Talboom and the other participants to introduce me in TDD.&lt;br /&gt;
Hope to see you again at one of the following Code Retreat.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
You can check Code Retreat on twitter: &lt;img alt="" width="20" height="20" src="http://gwb.blob.core.windows.net/jeroenb/9949/t_twitter-blank.png" /&gt; #coderetreat&lt;br /&gt;
Or on &lt;a href="http://www.coderetreat.ning.com"&gt;http://coderetreat.ning.com&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Some pictures of the event in Belgium:&lt;/p&gt;
&lt;center&gt;
&lt;table border="0" cellspacing="1" cellpadding="1" width="200"&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td style="text-align: right"&gt;&lt;img alt="" width="450" height="337" src="http://gwb.blob.core.windows.net/jeroenb/9949/coderetreat1(1).jpg" /&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;&lt;img alt="" width="450" height="337" src="http://gwb.blob.core.windows.net/jeroenb/9949/coderetreat2.jpg" /&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;&lt;img alt="" width="450" height="337" src="http://gwb.blob.core.windows.net/jeroenb/9949/coderetreat3.jpg" /&gt;&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
&lt;/center&gt;
&lt;p&gt; &lt;a href="http://yfrog.com/user/talboomerik/photos"&gt;yfrog.com/user/talboomerik/photos&lt;/a&gt;&lt;/p&gt;&lt;img src="http://geekswithblogs.net/jeroenb/aggbug/145243.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/jeroenb/comments/145243.aspx</wfw:comment>
        <slash:comments>1</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/jeroenb/comments/commentRss/145243.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/jeroenb/services/trackbacks/145243.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Community Day 2011</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/jeroenb/archive/2011/04/21/community-day-2011.aspx" />
        <id>http://geekswithblogs.net/jeroenb/archive/2011/04/21/community-day-2011.aspx</id>
        <published>2011-04-21T13:06:3802:00:00</published>
        <updated>2011-05-08T22:02:38Z</updated>
        <content type="html">&lt;p&gt;The next community day event will be on 23rd of June. I will attend this event.&lt;br /&gt;
Spread the word about this free event and subscribe!&lt;/p&gt;
&lt;p&gt;For more information: &lt;a href="http://www.communityday.be"&gt;www.communityday.be&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://www.snowball.be/2011/04/21/Community+Day+2011+Is+Coming+Closer+Save+The+Date.aspx"&gt;www.snowball.be/2011/04/21/Community+Day+2011+Is+Coming+Closer+Save+The+Date.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;&lt;img src="http://geekswithblogs.net/jeroenb/aggbug/144991.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/jeroenb/comments/144991.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/jeroenb/comments/commentRss/144991.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/jeroenb/services/trackbacks/144991.aspx</trackback:ping>
    </entry>
</feed>