<?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>PeterKellner.net &#187; ASP.NET 3.5</title>
	<atom:link href="http://peterkellner.net/category/aspnet-35/feed/" rel="self" type="application/rss+xml" />
	<link>http://peterkellner.net</link>
	<description>Microsoft Focused, JavaScript,HTML5 (ExtJS, SenchaTouch &#38; Windows 8 Metro)</description>
	<lastBuildDate>Fri, 11 May 2012 16:43:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Microsoft&#8217;s ASP.NET MVC Lite, Building a TextReformatter With JsonResult</title>
		<link>http://peterkellner.net/2012/04/10/microsofts-asp-net-mvc-lite-building-a-textreformatter-with-jsonresult/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=microsofts-asp-net-mvc-lite-building-a-textreformatter-with-jsonresult</link>
		<comments>http://peterkellner.net/2012/04/10/microsofts-asp-net-mvc-lite-building-a-textreformatter-with-jsonresult/#comments</comments>
		<pubDate>Tue, 10 Apr 2012 19:40:18 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[ASP.NET 3.5]]></category>
		<category><![CDATA[ASP.NET 4.0]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>
		<category><![CDATA[Visual Studio 2011 Developer Preview]]></category>

		<guid isPermaLink="false">http://peterkellner.net/?p=1931</guid>
		<description><![CDATA[&#160;
Introduction
&#160;
People often ask me if I use MVC or WebForms for my Microsoft ASP.NET projects.&#160; I always tell them MVC, but I don’t use it in the classic way that most others do.&#160; That is to say, I emit no html from my views, and for that matter really don’t even use views (with the [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<h2>Introduction</h2>
<p>&#160;</p>
<p>People often ask me if I use <a href="http://www.asp.net/mvc">MVC</a> or <a href="http://www.asp.net/web-forms">WebForms</a> for my Microsoft <a href="http://www.asp.net/">ASP.NET</a> projects.&#160; I always tell them <a href="http://www.asp.net/mvc">MVC</a>, but I don’t use it in the classic way that most others do.&#160; That is to say, I emit no html from my views, and for that matter really don’t even use views (with the exception of one view which is essentially my entire app.&#160;&#160; People often refer to this as a SPA or Single-Page-Application. What this basically means is that my entire view is built with JavaScript (in my case <a href="'">Sencha’s</a> <a href="http://www.sencha.com/products/extjs/">ExtJS</a>) and the only interaction with the server is to simply bring down <a href="http://json.org/">Json</a> results.</p>
<p>In this post, I’m going to build a simple app following this principle. It’s purpose will be to take a big pile of text, chop it up into words, then output it in some c# friendly manner.&#160; My motivation for doing this is I happen to need that functionality right now and instead of creating a little <a href="http://en.wikipedia.org/wiki/AWK">awk</a> script to do it, I’m going to right a web site!</p>
<p>&#160;</p>
<p>So, Here is what we will build.&#160; A handy formatter! (and you can run it at:&#160;&#160; <a href="http://reformatter.peterkellner.net/">http://reformatter.peterkellner.net/</a> )</p>
<p>&#160;</p>
<p><a href="http://reformatter.peterkellner.net/app.html"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://PetersBlogCDN.s3.amazonaws.com/wp/wp/wp-content/uploads/2012/04/image4.png" width="510" height="438" /></a></p>
<p><a href="http://reformatter.peterkellner.net/app.html"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://PetersBlogCDN.s3.amazonaws.com/wp/wp/wp-content/uploads/2012/04/image5.png" width="511" height="444" /></a></p>
<p>&#160;</p>
<p>&#160;</p>
<h2>Part I, The Visual Studio Project</h2>
<p>&#160;</p>
<p>Let’s first create the Visual Studio project.&#160; My development these days is actually using the latest Windows 8 Consumer build with the beta of Visual Studio 2011 running on it.&#160; The nice thing about this is because Microsoft added “Round Tripping” to VS2011, I can now use VS2011 to create the project and you, my happy readers, can download the project and open it in Visual Studio 2010.&#160; This has been long in coming and Microsoft has finally done it for the newest version of Visual Studio.&#160; Thank you Microsoft!</p>
<p>&#160;</p>
<p><a href="http://PetersBlogCDN.s3.amazonaws.com/wp/wp/wp-content/uploads/2012/04/image.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://PetersBlogCDN.s3.amazonaws.com/wp/wp/wp-content/uploads/2012/04/image_thumb.png" width="438" height="271" /></a></p>
<p>&#160;</p>
<p>And with an Internet Application with Razor (though I really don’t need all that extra stuff, it does not hurt)</p>
<p>&#160;</p>
<p><a href="http://PetersBlogCDN.s3.amazonaws.com/wp/wp/wp-content/uploads/2012/04/image1.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://PetersBlogCDN.s3.amazonaws.com/wp/wp/wp-content/uploads/2012/04/image_thumb1.png" width="385" height="353" /></a></p>
<p>&#160;</p>
<p>The structure created is as as shown below with a Controller and Views folder and all the proper routing setup.</p>
<p>&#160;</p>
<p><a href="http://PetersBlogCDN.s3.amazonaws.com/wp/wp/wp-content/uploads/2012/04/image2.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://PetersBlogCDN.s3.amazonaws.com/wp/wp/wp-content/uploads/2012/04/image_thumb2.png" width="218" height="340" /></a></p>
<p>&#160;</p>
<p>Because I want to make a very simple MVC app that only emits Json, Let’s create our own empty controller called ReformatterController.&#160; We do that by right clicking on the Controller folder and pressing “Add Controller”, then “Add Empty Controller”.</p>
<p><a href="http://PetersBlogCDN.s3.amazonaws.com/wp/wp/wp-content/uploads/2012/04/image3.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://PetersBlogCDN.s3.amazonaws.com/wp/wp/wp-content/uploads/2012/04/image_thumb3.png" width="352" height="256" /></a></p>
<p>&#160;</p>
<p>Now, let’s create a very very simple controller with just one method that returns a JSON Result.&#160; I’m returning the data in a friendly format to&#160; Sencha’s ExtJS (or SenchaTouch for that matter).&#160; <a href="http://www.webappers.com/2011/02/16/how-to-build-single-page-applications-with-jquery/">JQuery</a> would be similar.&#160; Here is our new controller class (I’m sure my little tokenizer, line maker could be improved, but I’m just doing this to show some real work.</p>
<pre class="csharpcode"><span class="kwrd">using</span> System;
<span class="kwrd">using</span> System.Collections.Generic;
<span class="kwrd">using</span> System.Linq;
<span class="kwrd">using</span> System.Text;
<span class="kwrd">using</span> System.Web;
<span class="kwrd">using</span> System.Web.Mvc;

<span class="kwrd">namespace</span> MvcLiteApp.Controllers
{
    <span class="kwrd">public</span> <span class="kwrd">class</span> ReformatterController : Controller
    {

        <span class="kwrd">public</span> JsonResult ConvertTextToFriendlyText(<span class="kwrd">string</span> inputText)
        {
            <span class="kwrd">const</span> <span class="kwrd">int</span> maxCharactersInLine = 30;
            <span class="kwrd">bool</span> success;
            <span class="kwrd">string</span> messageReturn;
            var outputDataList = <span class="kwrd">new</span> List&lt;<span class="kwrd">string</span>&gt;();

            <span class="kwrd">try</span>
            {
                var words = inputText.Split(<span class="str">' '</span>).ToList();
                var newLine = <span class="kwrd">new</span> StringBuilder();
                <span class="kwrd">foreach</span> (var word <span class="kwrd">in</span> words)
                {
                    <span class="kwrd">if</span> (newLine.Length + word.Length &lt; maxCharactersInLine &amp;&amp;
                        word.Length &lt; maxCharactersInLine)
                    {
                        newLine.Append(<span class="str">&quot; &quot;</span>);
                        newLine.Append(word);
                    }
                    <span class="kwrd">else</span>
                    {
                        outputDataList.Add(newLine.ToString().Trim());
                        newLine = <span class="kwrd">new</span> StringBuilder();
                        newLine.Append(word);
                    }
                }
                success = <span class="kwrd">true</span>;
                messageReturn = <span class="str">&quot;&quot;</span>;
            }
            <span class="kwrd">catch</span> (Exception e)
            {
                messageReturn = e.ToString();
                success = <span class="kwrd">false</span>;
            }

            <span class="kwrd">return</span> Json(<span class="kwrd">new</span>
            {
                Success = success,
                Data = outputDataList,
                message = messageReturn
            }, JsonRequestBehavior.AllowGet);
        }

    }
}</pre>
<p>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>Now, let’s feed it a URL and see what happens.&#160; Here is a sample URL:</p>
<p><a title="http://localhost:3600/Reformatter/ConvertTextToFriendlyText?inputText=Romeo%20Montague%20and%20Juliet%20Capulet%20meet%20and%20fall%20in%20love%20in%20Shakespeare&#39;s%20lyrical%20tale%20of%20%22star-cross&#39;d%22%20lovers." href="http://localhost:3600/Reformatter/ConvertTextToFriendlyText?inputText=Romeo%20Montague%20and%20Juliet%20Capulet%20meet%20and%20fall%20in%20love%20in%20Shakespeare's%20lyrical%20tale%20of%20%22star-cross'd%22%20lovers.">http://localhost:3600/Reformatter/ConvertTextToFriendlyText?inputText=Romeo%20Montague%20and%20Juliet%20Capulet%20meet%20and%20fall%20in%20love%20in%20Shakespeare&#8217;s%20lyrical%20tale%20of%20%22star-cross&#8217;d%22%20lovers.</a></p>
<p>I actually pasted the sentence in to the the browser’s URL line and it added the nice encoded spaces for me.&#160; The output is as follows:</p>
<p>{&quot;Success&quot;:true,&quot;Data&quot;:[&quot;Romeo Montague and Juliet&quot;,&quot;Capulet meet and fall in love&quot;,&quot;in Shakespeare\u0027s lyrical tale&quot;],&quot;message&quot;:&quot;&quot;}</p>
<p>Notice that it created the nice lines formatted as a JavaScript array!</p>
<p>Next step, let’s make a real JavaScript program out of this.</p>
<p>&#160;</p>
<h2>Part 2, Our SPA (Single Page App) That Does Real Work</h2>
<p>&#160;</p>
<p>I’m only going to explain here the part of the Sencha Program that actually consumes the data but first, let’s add a little “properness” to our controller so it responds only to POST.&#160; That is, we add an attribute to the top of the method and we change the behavior attribute on the bottom to say to not allow get.</p>
<pre class="csharpcode">        [HttpPost]
        <span class="kwrd">public</span> JsonResult ConvertTextToFriendlyText(<span class="kwrd">string</span> inputText)
        {
            .......
            <span class="kwrd">return</span> Json(<span class="kwrd">new</span>
            {
                Success = success,
                Data = outputDataList,
                message = messageReturn
            }, JsonRequestBehavior.DenyGet);
        }</pre>
<p>And, the JavaScript in the SPA is very straight forward and is here:</p>
<pre class="csharpcode"><span class="kwrd">var</span> beforeTextAreaComponent = Ext.getCmp(<span class="str">'BeforeFormatTextAreaId'</span>);
textBefore = beforeTextAreaComponent.getValue();

<span class="rem">// how to not pollute global name space here?</span>
<span class="kwrd">var</span> stringbuildervalue = Ext.getCmp(<span class="str">'stringbuilderid'</span>).getValue();
<span class="kwrd">var</span> javascriptarrayvalue = Ext.getCmp(<span class="str">'javascriptarrayid'</span>).getValue();
<span class="kwrd">var</span> noformattingvalue = Ext.getCmp(<span class="str">'noformattingid'</span>).getValue();
<span class="kwrd">var</span> outputwidthvalue = Ext.getCmp(<span class="str">'outputwidthid'</span>).getValue();

Ext.Ajax.request({
    url: <span class="str">'ReFormatter/ConvertTextToFriendlyText'</span>,
    <span class="kwrd">params</span>: {
        inputText: textBefore,
        stringbuilder: stringbuildervalue,
        javascriptarray: javascriptarrayvalue,
        noformatting: noformattingvalue,
        outputwidth: outputwidthvalue
    },
    success: <span class="kwrd">function</span>(response){
        <span class="kwrd">var</span> localData = Ext.JSON.decode(response.responseText).Data;
        <span class="kwrd">var</span> numberRows = localData.length;
        <span class="kwrd">var</span> newData = <span class="str">''</span>;
        <span class="kwrd">for</span> (<span class="kwrd">var</span> i=0;i&lt;numberRows;i++) {
            newData += localData[i] + <span class="str">'\n'</span>;
        }

        <span class="kwrd">var</span> afterTextAreaComponent = Ext.getCmp(<span class="str">'AfterFormatTextAreaId'</span>);
        afterTextAreaComponent.setValue(newData);

    },
    failure: <span class="kwrd">function</span>(error) {
        alert(<span class="str">'error'</span>);
    }

});</pre>
<p>Now, in reality, I’ve added some useful stuff to the controller (and put the project here for your review, comments and suggestions).</p>
<div id="scid:fb3a1972-4489-4e52-abe7-25a00bb07fdf:279ce901-a751-4b1a-8603-ebda182698cc" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px">
<p>Visual Studio Project <a href="http://PetersBlogCDN.s3.amazonaws.com/wp/wp/wp-content/uploads/2012/04/TextReformatter.zip" target="_blank">TextReformatter.zip</a></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2012/04/10/microsofts-asp-net-mvc-lite-building-a-textreformatter-with-jsonresult/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Meetup At Sencha Headquarters Tomorrow (Tuesday 8/23) in Redwood City Talking MVC in JavaScript!</title>
		<link>http://peterkellner.net/2011/08/22/meetup-at-sencha-headquarters-tomorrow-tuesday-823-in-redwood-city-talking-mvc-in-javascript/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=meetup-at-sencha-headquarters-tomorrow-tuesday-823-in-redwood-city-talking-mvc-in-javascript</link>
		<comments>http://peterkellner.net/2011/08/22/meetup-at-sencha-headquarters-tomorrow-tuesday-823-in-redwood-city-talking-mvc-in-javascript/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 00:21:50 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[Code Camp]]></category>
		<category><![CDATA[Community]]></category>
		<category><![CDATA[ExtJS]]></category>
		<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2011/08/22/meetup-at-sencha-headquarters-tomorrow-tuesday-823-in-redwood-city-talking-mvc-in-javascript/</guid>
		<description><![CDATA[Tomorrow night (Tuesday, August 23rd), we are having another meetup to talk about using MVC inside of Sencha’s JavaScript products.&#160; I (Peter Kellner) will be talking for the first 20 minutes about how we are integrating the MVC pattern in our Silicon Valley Code Camp web site, then Ed Spencer from Sencha will follow on [...]]]></description>
			<content:encoded><![CDATA[<p>Tomorrow night (Tuesday, August 23rd), we are having another meetup to talk about using <a href="http://dev.sencha.com/deploy/ext-4.0.2a/docs/#/guide/application_architecture">MVC</a> inside of <a href="http://www.sencha.com/">Sencha’s</a> JavaScript products.&#160; I (Peter Kellner) will be talking for the first 20 minutes about how we are integrating the MVC pattern in our <a href="http://www.siliconvalley-codecamp.com/">Silicon Valley Code Camp web site</a>, then Ed Spencer from Sencha will follow on talking a lot more about MVC and best practices as well as Q&amp;A</p>
<p>Hope you can make it.&#160; Details are here:</p>
<p><a title="http://www.meetup.com/The-San-Francisco-ExtJS-Meetup-Group/events/28760211/" href="http://www.meetup.com/The-San-Francisco-ExtJS-Meetup-Group/events/28760211/">http://www.meetup.com/The-San-Francisco-ExtJS-Meetup-Group/events/28760211/</a></p>
<p>&#160;</p>
<p><a href="http://www.meetup.com/The-San-Francisco-ExtJS-Meetup-Group/events/28760211/"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://PetersBlogCDN.s3.amazonaws.com/wp/wp/wp-content/uploads/2011/08/image3.png" width="640" height="388" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2011/08/22/meetup-at-sencha-headquarters-tomorrow-tuesday-823-in-redwood-city-talking-mvc-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>With ASP.NET WebForms, How to Keep / Stop a Data Control Like GridView From Retrieving Data</title>
		<link>http://peterkellner.net/2011/08/01/with-asp-net-webforms-how-to-keep-stop-a-data-control-like-gridview-from-retrieving-data/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=with-asp-net-webforms-how-to-keep-stop-a-data-control-like-gridview-from-retrieving-data</link>
		<comments>http://peterkellner.net/2011/08/01/with-asp-net-webforms-how-to-keep-stop-a-data-control-like-gridview-from-retrieving-data/#comments</comments>
		<pubDate>Mon, 01 Aug 2011 21:35:00 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[ASP.NET 2.0]]></category>
		<category><![CDATA[ASP.NET 3.5]]></category>
		<category><![CDATA[ASP.NET 4.0]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[ObjectDataSource]]></category>
		<category><![CDATA[WebForms]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2011/08/01/with-asp-net-webforms-how-to-keep-stop-a-data-control-like-gridview-from-retrieving-data/</guid>
		<description><![CDATA[The What and Where
Something that may not be obvious is if are creating an asp.net WebForms project and you put a datasource such as SqlDataSource or ObjectDataSource for example on the page, how can you prevent the SqlSelect associated with that datasource from being triggered.
The answer is to set the control’s visible property to false.&#160; [...]]]></description>
			<content:encoded><![CDATA[<h2>The What and Where</h2>
<p>Something that may not be obvious is if are creating an asp.net <a href="http://msdn.microsoft.com/en-us/library/ms973868.aspx">WebForms</a> project and you put a datasource such as <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.sqldatasource.aspx">SqlDataSource</a> or <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.objectdatasource.aspx">ObjectDataSource</a> for example on the page, how can you prevent the SqlSelect associated with that datasource from being triggered.</p>
<p>The answer is to set the control’s visible property to false.&#160; That’s it!</p>
<p>  <span id="more-1529"></span>
<p>&#160;</p>
<h2>The Why</h2>
<p>The reason you might want to do this is for a case where you have a public facing web page that might be easily subjected to a denial of service attach.&#160; If that web page is always causing some SqlDataSource to fire, you could easily find your <a href="http://www.microsoft.com/sqlserver/en/us/default.aspx">SqlServer</a> overloaded.&#160; At least by checking to see a user is logged in before firing the sql statement, you buy yourself a little bit of protection.</p>
<p>&#160;</p>
<h2>The Code</h2>
<pre class="csharpcode"><span class="asp">&lt;%@ Page Language=&quot;C#&quot; %&gt;</span>

<span class="kwrd">&lt;!</span><span class="html">DOCTYPE</span> <span class="attr">html</span> <span class="attr">PUBLIC</span> <span class="kwrd">&quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;</span>
<span class="kwrd">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;</span><span class="kwrd">&gt;</span>

<span class="kwrd">&lt;</span><span class="html">script</span> <span class="attr">runat</span><span class="kwrd">=&quot;server&quot;</span><span class="kwrd">&gt;</span>

    <span class="kwrd">protected</span> <span class="kwrd">void</span>
        GridView1_SelectedIndexChanged(<span class="kwrd">object</span> sender, EventArgs e)
    {

    }

    <span class="kwrd">protected</span> <span class="kwrd">void</span> Page_Init(<span class="kwrd">object</span> sender, EventArgs e)
    {
        <span class="kwrd">if</span> (!Context.User.Identity.IsAuthenticated)
        {
            GridView1.Visible = <span class="kwrd">false</span>;
        }
    }
<span class="kwrd">&lt;/</span><span class="html">script</span><span class="kwrd">&gt;</span>

<span class="kwrd">&lt;</span><span class="html">html</span> <span class="attr">xmlns</span><span class="kwrd">=&quot;http://www.w3.org/1999/xhtml&quot;</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">head</span> <span class="attr">runat</span><span class="kwrd">=&quot;server&quot;</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">title</span><span class="kwrd">&gt;&lt;/</span><span class="html">title</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">head</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">body</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">form</span> <span class="attr">id</span><span class="kwrd">=&quot;form1&quot;</span> <span class="attr">runat</span><span class="kwrd">=&quot;server&quot;</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">div</span><span class="kwrd">&gt;</span>
        <span class="kwrd">&lt;</span><span class="html">asp:SqlDataSource</span> <span class="attr">ID</span><span class="kwrd">=&quot;SqlDataSource1&quot;</span> <span class="attr">runat</span><span class="kwrd">=&quot;server&quot;</span>
            <span class="attr">ConnectionString</span><span class="kwrd">=&quot;&lt;%$ ConnectionStrings:CodeCampSV06 %&gt;&quot;</span>
            <span class="attr">SelectCommand</span>=
            <span class="kwrd">&quot;SELECT [Id], [Username], [Email] FROM [Attendees] ORDER BY [Id] DESC&quot;</span><span class="kwrd">&gt;</span>
            <span class="kwrd">&lt;/</span><span class="html">asp:SqlDataSource</span><span class="kwrd">&gt;</span>
        <span class="kwrd">&lt;</span><span class="html">asp:GridView</span> <span class="attr">ID</span><span class="kwrd">=&quot;GridView1&quot;</span> <span class="attr">runat</span><span class="kwrd">=&quot;server&quot;</span> <span class="attr">AutoGenerateColumns</span><span class="kwrd">=&quot;False&quot;</span>
            <span class="attr">DataKeyNames</span><span class="kwrd">=&quot;Id&quot;</span> <span class="attr">DataSourceID</span><span class="kwrd">=&quot;SqlDataSource1&quot;</span>
            <span class="attr">onselectedindexchanged</span><span class="kwrd">=&quot;GridView1_SelectedIndexChanged&quot;</span><span class="kwrd">&gt;</span>
            <span class="kwrd">&lt;</span><span class="html">Columns</span><span class="kwrd">&gt;</span>
                <span class="kwrd">&lt;</span><span class="html">asp:BoundField</span> <span class="attr">DataField</span><span class="kwrd">=&quot;Id&quot;</span> <span class="attr">HeaderText</span><span class="kwrd">=&quot;Id&quot;</span> <span class="attr">InsertVisible</span><span class="kwrd">=&quot;False&quot;</span>
                    <span class="attr">ReadOnly</span><span class="kwrd">=&quot;True&quot;</span> <span class="attr">SortExpression</span><span class="kwrd">=&quot;Id&quot;</span> <span class="kwrd">/&gt;</span>
                <span class="kwrd">&lt;</span><span class="html">asp:BoundField</span> <span class="attr">DataField</span><span class="kwrd">=&quot;Username&quot;</span> <span class="attr">HeaderText</span><span class="kwrd">=&quot;Username&quot;</span>
                    <span class="attr">SortExpression</span><span class="kwrd">=&quot;Username&quot;</span> <span class="kwrd">/&gt;</span>
                <span class="kwrd">&lt;</span><span class="html">asp:BoundField</span> <span class="attr">DataField</span><span class="kwrd">=&quot;Email&quot;</span> <span class="attr">HeaderText</span><span class="kwrd">=&quot;Email&quot;</span>
                <span class="attr">SortExpression</span><span class="kwrd">=&quot;Email&quot;</span> <span class="kwrd">/&gt;</span>
            <span class="kwrd">&lt;/</span><span class="html">Columns</span><span class="kwrd">&gt;</span>
        <span class="kwrd">&lt;/</span><span class="html">asp:GridView</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;/</span><span class="html">div</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;/</span><span class="html">form</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">body</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">html</span><span class="kwrd">&gt;</span></pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2011/08/01/with-asp-net-webforms-how-to-keep-stop-a-data-control-like-gridview-from-retrieving-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DevConnections Presentation Orlando, How To Make Your Browser fly</title>
		<link>http://peterkellner.net/2011/03/29/devconnections-presentation-orlando-how-to-make-your-browser-fly/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=devconnections-presentation-orlando-how-to-make-your-browser-fly</link>
		<comments>http://peterkellner.net/2011/03/29/devconnections-presentation-orlando-how-to-make-your-browser-fly/#comments</comments>
		<pubDate>Tue, 29 Mar 2011 21:08:27 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[Presentations]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2011/03/29/devconnections-presentation-orlando-how-to-make-your-browser-fly/</guid>
		<description><![CDATA[(About 100 People)
The Presentation was broken down into three parts.&#160; 
Part 1
Created a windows razor project that cached in image on a web site using best practices for threading and locking.&#160; The code and project to do this are below:

var downloadByteArray = HttpContext.Current.Cache[cacheName] as byte[]; if (downloadByteArray == null) {     // [...]]]></description>
			<content:encoded><![CDATA[<p>(About 100 People)</p>
<p>The Presentation was broken down into three parts.&#160; </p>
<h2>Part 1</h2>
<p>Created a windows razor project that cached in image on a web site using best practices for threading and locking.&#160; The code and project to do this are below:</p>
<div id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">var downloadByteArray = HttpContext.Current.Cache[cacheName] <span style="color: #0000ff">as</span> <span style="color: #0000ff">byte</span>[]; <span style="color: #0000ff">if</span> (downloadByteArray == <span style="color: #0000ff">null</span>) {     <span style="color: #008000">// make sure multiple requestors are not filling up the cache</span>     <span style="color: #0000ff">lock</span> (LockVal)     {         downloadByteArray = HttpContext.Current.Cache[cacheName] <span style="color: #0000ff">as</span> <span style="color: #0000ff">byte</span>[];         <span style="color: #0000ff">if</span> (downloadByteArray == <span style="color: #0000ff">null</span>)         {             Thread.Sleep(sleep * 1000);

             <span style="color: #0000ff">string</span> imageLocation = HttpContext.Current.Server.MapPath(<span style="color: #006080">&quot;~&quot;</span>) + imageUrl;

             downloadByteArray = File.ReadAllBytes(imageLocation);             <span style="color: #0000ff">if</span> (cacheExpiresSeconds &gt; 0)             {                 HttpContext.Current.Cache.Insert(cacheName, downloadByteArray,                                                  <span style="color: #0000ff">null</span>,                                                  DateTime.Now.Add(<span style="color: #0000ff">new</span> TimeSpan(0, 0, 0, cacheExpiresSeconds)),                                                  TimeSpan.Zero, CacheItemPriority.NotRemovable, <span style="color: #0000ff">null</span>);                 CacheInsertCounter = 9999; <span style="color: #008000">// any touch of this increments the global counter</span>             }         }     } }</pre>
<p></div>
<p>&#160;</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:8eb9d37f-1541-4f29-b6f4-1eea890d4876:2267f0db-4ee6-46f0-8cec-12de6f76545d" class="wlWriterEditableSmartContent">
<div><a href="http://peterkellner.net/FilesForWebDownload/DevConnections-Presentation_EE06/WebFormsPreSprite.zip" target="_self">WebFormsPreSprite.zip</a></div>
</p>
</div>
<p>&#160;</p>
<h2>Part 2</h2>
<p>Tips from Steve Souders</p>
<p>&#160;</p>
<h2>Part 3</h2>
<p>Sprite Library from Microsoft Example:&#160;
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:8eb9d37f-1541-4f29-b6f4-1eea890d4876:62dccea0-5635-435b-b07a-d12f2bec4e7e" class="wlWriterEditableSmartContent">
<div><a href="http://peterkellner.net/FilesForWebDownload/DevConnections-Presentation_EE06/WebFormsPreSprite_3.zip" target="_self">WebFormsPreSprite.zip</a></div>
</p>
</div>
<p>&#160;</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/DevConnections-Presentation_EE06/image.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/DevConnections-Presentation_EE06/image_thumb.png" width="312" height="451" /></a><a href="http://peterkellner.net/FilesForWebDownload/DevConnections-Presentation_EE06/IMAG0174.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="IMAG0174" border="0" alt="IMAG0174" src="http://peterkellner.net/FilesForWebDownload/DevConnections-Presentation_EE06/IMAG0174_thumb.jpg" width="148" height="244" /></a><a href="http://peterkellner.net/FilesForWebDownload/DevConnections-Presentation_EE06/IMAG0177.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="IMAG0177" border="0" alt="IMAG0177" src="http://peterkellner.net/FilesForWebDownload/DevConnections-Presentation_EE06/IMAG0177_thumb.jpg" width="244" height="148" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2011/03/29/devconnections-presentation-orlando-how-to-make-your-browser-fly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MVC3 Unable To Return Large JSON Even with Web Config Patch, Using LargeJsonResult Instead</title>
		<link>http://peterkellner.net/2011/03/21/mvc3-unable-to-return-large-json-even-with-web-config-patch-using-largejsonresult-instead/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mvc3-unable-to-return-large-json-even-with-web-config-patch-using-largejsonresult-instead</link>
		<comments>http://peterkellner.net/2011/03/21/mvc3-unable-to-return-large-json-even-with-web-config-patch-using-largejsonresult-instead/#comments</comments>
		<pubDate>Mon, 21 Mar 2011 18:11:25 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[ASP.NET 4.0]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2011/03/21/mvc3-unable-to-return-large-json-even-with-web-config-patch-using-largejsonresult-instead/</guid>
		<description><![CDATA[I’m trying to download a base64 encoded image that is about 4 Megabytes embedded inside a JSON object.  When I first tried this from my MVC3 Web application, I got the error:

Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.


I then tried [...]]]></description>
			<content:encoded><![CDATA[<p>I’m trying to download a base64 encoded image that is about 4 Megabytes embedded inside a <a href="http://json.org/">JSON</a> object.  When I first tried this from my <a href="http://www.asp.net/mvc/mvc3">MVC3 Web application</a>, I got the error:</p>
<blockquote>
<h4><em>Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.</em></h4>
</blockquote>
<p><span id="more-1450"></span></p>
<p>I then tried to set the web.config property that everyone seems to reference on the web as follows:</p>
<div id="codeSnippetWrapper">
<pre id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">system.web.extensions</span><span style="color: #0000ff;">&gt;</span>
    <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">scripting</span><span style="color: #0000ff;">&gt;</span>
        <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">webServices</span><span style="color: #0000ff;">&gt;</span>
            <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">jsonSerialization</span> <span style="color: #ff0000;">maxJsonLength</span><span style="color: #0000ff;">="2147483645"</span> <span style="color: #ff0000;">recursionLimit</span><span style="color: #0000ff;">="100"</span><span style="color: #0000ff;">&gt;</span>
            <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">jsonSerialization</span><span style="color: #0000ff;">&gt;</span>
        <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">webServices</span><span style="color: #0000ff;">&gt;</span>
        <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">scripting</span><span style="color: #0000ff;">&gt;</span>
<span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">system.web.extensions</span><span style="color: #0000ff;">&gt;</span></pre>
</div>
<p>However, I kept getting the same error over and over.  So, I used the technique suggested in this article</p>
<p><a title="http://thoughtfulcode.wordpress.com/2011/01/03/custom-jsonresult-class-for-asp-net-mvc-to-avoid-maxjsonlength-exceeded-exception/" href="http://thoughtfulcode.wordpress.com/2011/01/03/custom-jsonresult-class-for-asp-net-mvc-to-avoid-maxjsonlength-exceeded-exception/">http://thoughtfulcode.wordpress.com/2011/01/03/custom-jsonresult-class-for-asp-net-mvc-to-avoid-maxjsonlength-exceeded-exception/</a></p>
<p>by <a href="http://brianreiter.org/about/">Brian Reiter</a> to create an override of the JsonResult class.  That actually worked for me, however unfortunately, it does not show the shape of the data that is currently being returned by MVC3.  That is, MVC3 currently returns a JsonResult as follows:</p>
<div>
<pre id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #0000ff;">return</span> Json(<span style="color: #0000ff;">new</span>
{
    total = blobs.Count,
    data = blobs.ToList()
}, JsonRequestBehavior.AllowGet);</pre>
</div>
<div>Brian suggest in his article to return his LargeJsonResult, do the following:</div>
<div>
<pre id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #0000ff;">return</span> <span style="color: #0000ff;">new</span> LargeJsonResult() { Data = output, MaxJsonLength = <span style="color: #0000ff;">int</span>.MaxValue };</pre>
</div>
<div>This does not quite work for what I want.  For my result to work, I needed to modify the result a little and return it as follows:</div>
<div id="codeSnippetWrapper">
<pre id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #0000ff;">return</span>
   <span style="color: #0000ff;">new</span> LargeJsonResult
       {
           MaxJsonLength = 20000000,
           JsonRequestBehavior = JsonRequestBehavior.AllowGet,
           Data = <span style="color: #0000ff;">new</span>
                      {
                          total = blobs.Count,
                          data = blobs.ToList()
                      }
       };</pre>
</div>
<div>Not much different, but does solve my problem.</div>
<div>Thanks Brian for the nice contribution!</div>
]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2011/03/21/mvc3-unable-to-return-large-json-even-with-web-config-patch-using-largejsonresult-instead/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Installing NuGet on VS2010 (first blood)</title>
		<link>http://peterkellner.net/2011/03/02/installing-nuget-on-vs2010-first-blood/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=installing-nuget-on-vs2010-first-blood</link>
		<comments>http://peterkellner.net/2011/03/02/installing-nuget-on-vs2010-first-blood/#comments</comments>
		<pubDate>Thu, 03 Mar 2011 00:11:34 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[ASP.NET 4.0]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[NuGet]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2011/03/02/installing-nuget-on-vs2010-first-blood/</guid>
		<description><![CDATA[So, here are the steps necessary to install NuGet on my windows laptop computer.&#160; I’ve got vs2010 (not sp1) installed, I’ve disabled both Resharper and .net Reflector just to be safe.
First step, is to go to the NuGet.org web site and click on Install.

&#160;
Accept the default:
&#160;

&#160;
Run Visual Studio 2010 again, then go into Tool/Extension Manager [...]]]></description>
			<content:encoded><![CDATA[<p>So, here are the steps necessary to install <a href="http://nuget.codeplex.com/">NuGet</a> on my windows laptop computer.&#160; I’ve got vs2010 (not sp1) installed, I’ve disabled both Resharper and .net Reflector just to be safe.</p>
<p>First step, is to go to the <a href="http://nuget.org/">NuGet.org</a> web site and click on Install.</p>
<p><a href="http://nuget.org/"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/Installing-NuGet-on-VS2010-first-blood_D77F/image.png" width="449" height="234" /></a></p>
<p>&#160;</p>
<p>Accept the default:</p>
<p>&#160;</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/Installing-NuGet-on-VS2010-first-blood_D77F/image_3.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/Installing-NuGet-on-VS2010-first-blood_D77F/image_thumb.png" width="244" height="182" /></a></p>
<p>&#160;</p>
<p>Run Visual Studio 2010 again, then go into Tool/Extension Manager and select “Automatically check for updates to installed extensions” as follows:</p>
<p>&#160;</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/Installing-NuGet-on-VS2010-first-blood_D77F/image_4.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/Installing-NuGet-on-VS2010-first-blood_D77F/image_thumb_3.png" width="515" height="398" /></a></p>
<p>&#160;</p>
<p>Then, go to View / Other Windows / Package Manager and you will get the Nu-Get prompt.</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/Installing-NuGet-on-VS2010-first-blood_D77F/image_5.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/Installing-NuGet-on-VS2010-first-blood_D77F/image_thumb_4.png" width="466" height="401" /></a></p>
<p>&#160;</p>
<p>Now, you&#8217; have the NuGet prompt as follows.</p>
<p>&#160;</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/Installing-NuGet-on-VS2010-first-blood_D77F/image_6.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/Installing-NuGet-on-VS2010-first-blood_D77F/image_thumb_5.png" width="420" height="181" /></a></p>
<p>At the PM prompt, to install scaffolding, start typing the following:</p>
<p>Install-Package mvc&#160; {then press tab for auto expansion}</p>
<p>You’ll get a list of all packages that begin with mvc as follows:</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/Installing-NuGet-on-VS2010-first-blood_D77F/image_7.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/Installing-NuGet-on-VS2010-first-blood_D77F/image_thumb_6.png" width="498" height="323" /></a></p>
<p>I choose MvcScaffolding, press enter and.. you’ll get the error that you need to have a project open.&#160; Of course, because it wants to add it to your project.</p>
<p>&#160;</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/Installing-NuGet-on-VS2010-first-blood_D77F/image_8.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/Installing-NuGet-on-VS2010-first-blood_D77F/image_thumb_7.png" width="368" height="379" /></a></p>
<p>&#160;</p>
<p>Now, let me add a real project with a simple class called MyTeam</p>
<div id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> MyTeam    {

        [Key]        <span style="color: #0000ff">public</span> <span style="color: #0000ff">int</span> ID { get; set; }

        [Required]        <span style="color: #0000ff">public</span> <span style="color: #0000ff">string</span> Name { get; set; }        <span style="color: #0000ff">public</span> <span style="color: #0000ff">string</span> City { get; set; }        <span style="color: #0000ff">public</span> DateTime Founded { get; set; }    }</pre>
<p></div>
<p>Now, when I re-run the last command, I get all my Controllers and Views.</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/Installing-NuGet-on-VS2010-first-blood_D77F/image_9.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/Installing-NuGet-on-VS2010-first-blood_D77F/image_thumb_8.png" width="610" height="251" /></a></p>
<p>Hope this helps, I have a lot more to learn now.</p>
]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2011/03/02/installing-nuget-on-vs2010-first-blood/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Installing Umbraco To Windows 7 Ultimate &#8211; Step By Step</title>
		<link>http://peterkellner.net/2010/07/10/installing-umbraco-to-win7-step-by-step/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=installing-umbraco-to-win7-step-by-step</link>
		<comments>http://peterkellner.net/2010/07/10/installing-umbraco-to-win7-step-by-step/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 16:29:41 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[ASP.NET 3.5]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[Forums Software]]></category>
		<category><![CDATA[Umbraco]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2010/07/10/installing-umbraco-to-win7-step-by-step/</guid>
		<description><![CDATA[I’m planning on launching some small consumer software products in the next couple months and to support this effort, I need to have a CMS, Forums Software, Store Front (Credit Card Processing) and Wiki solutions up and running.&#160; Since I’m a .Net guy, my first choice is to use Microsoft .Net technology, but if I [...]]]></description>
			<content:encoded><![CDATA[<p>I’m planning on launching some small consumer software products in the next couple months and to support this effort, I need to have a <a href="http://en.wikipedia.org/wiki/Content_management_system">CMS</a>, <a href="http://en.wikipedia.org/wiki/Comparison_of_Internet_forum_software">Forums Software</a>, <a href="http://en.wikipedia.org/wiki/Shopping_cart_software">Store Front (Credit Card Processing)</a> and <a href="http://en.wikipedia.org/wiki/Wiki">Wiki solutions</a> up and running.&#160; Since I’m a .Net guy, my first choice is to use Microsoft .Net technology, but if I don’t find anything there that suits me, off to the LAMP stack I go.&#160; It’s important to me that all of these are tied together with a <a href="http://en.wikipedia.org/wiki/Single_sign-on">single sign-on</a>.&#160; It always irritates me when you go to a site and they make you first log in to the site, the create a separate login for forums.&#160; I will avoid that experience for my customers and users.</p>
<p>&#160;</p>
<h2>
<p>My Research</p>
</h2>
<p>My research first started with Google/Bing type searches.&#160; That really leads me to many choices.&#160; Actually too many.&#160; Next, I go to my friend network.&#160; The first obvious person I turn to is <a href="http://scottcate.com/blog/">Scott Cate</a> because he seems to always have the best advice on this kind of thing. The guy is plugged into everything!</p>
<p>Scott give me a very strong recommendation to look at Umbraco.&#160; He says he is personally involved in writing code for that CMS, it’s very extensible, has a great admin UI and bottom line, is just good stuff.&#160; So, Off I go to <a href="http://umbraco.org">http://umbraco.org</a>.</p>
<p>&#160;</p>
<p> <span id="more-1341"></span>
<p>&#160;</p>
<h2>What I Find</h2>
<p>I discover Umbraco is an open source project hosted at <a href="http://www.codeplex.com">http://www.codeplex.com</a>.&#160; I find that it’s available in <a href="http://www.microsoft.com/web/downloads/platform.aspx">Microsoft Web Platform Installer</a>.&#160; It’s not obvious to me that it includes forum, wiki or shopping cart software.&#160; I don’t really expect the shopping cart, but I was hoping for wiki and forums software integrated.&#160; At this point, I’m sure none are integrated but it seems there are add-ins that might help me. </p>
<h3>Forums Software</h3>
<p>After searching the web, I find <a title="http://uforum.codeplex.com/" href="http://uforum.codeplex.com/">http://uforum.codeplex.com/</a> which has lots of downloads but not no checkins since June last year (not very active).&#160; I also find, what appears to be the treasure chest of addins at <a title="http://our.umbraco.org/projects" href="http://our.umbraco.org/projects">http://our.umbraco.org/projects</a>.&#160; I do find uForum listed here, and it does say it is what is used with Umbraco so I’ll probably go with that.&#160; </p>
<p>There is another forum mentioned quite a bit called YAF (<a title="http://www.yetanotherforum.net/" href="http://www.yetanotherforum.net/">http://www.yetanotherforum.net/</a>).&#160; It seems much more active than uForum so I should probably give that some thought.&#160; I did see another post on configuring it that looked complex.</p>
<h3>Ecommerce Software</h3>
<p>For Ecommerce, they list Commerce for Umbraco.&#160; They give a link to a site using it ( <a title="http://orders.homaxproducts.com/" href="http://orders.homaxproducts.com/">http://orders.homaxproducts.com/</a> ) which is a dead link.&#160; The primary site is <a title="http://commerce4umbraco.codeplex.com/" href="http://commerce4umbraco.codeplex.com/">http://commerce4umbraco.codeplex.com/</a>.&#160; There seems to be some controversy on the net about dashCommerce.net.&#160; </p>
<p>Clearly there is history here and it seems some issues around licensing and open source but I don’t quite follow all the threads.&#160; It would be nice if someone clarified this so I would know the story and could decide if I’m comfortable with what is going on there.</p>
<h3>Wiki Software</h3>
<p>Here I draw a big zero.&#160; When I search for <a href="http://www.bing.com/search?q=umbraco%20wiki%20integration&amp;mkt=en-us&amp;FORM=TOOLBR&amp;DI=6244&amp;CE=14.0&amp;CM=SearchWeb">“Umbraco Wiki Integration”</a> I don’t find anything obvious for what wiki to use.&#160; Umbraco has a wiki on their main site, but I can’t tell which one it is and how they integrated it.&#160; Another worry is I posted a question to the forums about which wiki/forums software they use and still don’t have answer after about 18 hours.&#160; Seems like this is a trivial answer making me think the forums are not very active.&#160; Here is a link to my thread.&#160; Maybe by the time you read this, someone will have answered it.&#160; <a title="http://our.umbraco.org/forum/getting-started/questions-about-runway-and-modules/10554-which-forum-and-wiki-sw-is-Umbracoorg-using" href="http://our.umbraco.org/forum/getting-started/questions-about-runway-and-modules/10554-which-forum-and-wiki-sw-is-Umbracoorg-using">http://our.umbraco.org/forum/getting-started/questions-about-runway-and-modules/10554-which-forum-and-wiki-sw-is-Umbracoorg-using</a>.&#160; </p>
<p>Also, just a side note.&#160; The forum software is not so easy to find.&#160; From <a href="http://umbraco.org">http://umbraco.org</a>, you have to chose the Documentation link, then 5 subcategories down is a forum link.&#160; Ultimately, you end up here:&#160; <a title="http://our.umbraco.org/forum" href="http://our.umbraco.org/forum">http://our.umbraco.org/forum</a>.</p>
<p>&#160;</p>
<h2>Installation Of Umbraco Experience</h2>
<h3>Preamble</h3>
<p>Finally, the meat of this post.&#160; My installation experience.&#160; I typically don’t blog everything I install, but in this case, I had a special request from <a href="http://twitter.com/paulsterling">@paulsterling</a>.&#160; I had tweeted “Just Installed umbraco on my local win7 box with iis7.&#160; web pi failed. recreated web site with iis worked.&#160; Lots of complaints posted”.&#160; Paul tweets back “do you have link to your feedback from your #epbi <a href="http://twitter.com/umbraco">@umbraco</a> install experience? always looking to improve”.</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb.png" width="335" height="254" /></a> </p>
<p>Well Paul, I’m a sucker for the “always looking to improve” which is what motivated this post.</p>
<p>To make sure I’m reasonably fair, I’ve created a VM with just Windows 7 Ultimate loaded. No Visual Studio, No Db. I’m going to install from there and document the steps in as much detail as I can.&#160; The first time I did this (OK, the first several times) it did not work.&#160; Let’s see what happens now.</p>
<p>&#160;</p>
<h3>Step By Step Experience</h3>
<p>Go to the <a href="http://www.microsoft.com/web/downloads/platform.aspx">Windows Platform Installer</a> Site, choose “Download It Now” and Choose Umbarco under the CMS category</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_3.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_3.png" width="399" height="301" /></a> </p>
<p>Then, PI figures out lots of dependencies of which I just accept and say install (about 100 meg).</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_4.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_4.png" width="419" height="364" /></a> </p>
<p>I then get prompted for a whether I want mixed mode or integrated authentication with SqlExpress.&#160; I say Integrated because I’m running everything on my local vm and that is good enough.&#160; In my earlier tests, I was doing this with SqlServer 2008 on my real development so this is a little different than what I did previously which failed.&#160; Let’s see what happens here.</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_5.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_5.png" width="433" height="378" /></a> </p>
<p>And now, we are off for the install.&#160; It says it’s installing lots of components.</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_6.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_6.png" width="441" height="385" /></a> </p>
<p>About 5 minutes later I get this screen where I fill in MyUmbracoApp and press continue.</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_7.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_7.png" width="465" height="404" /></a> </p>
<p>Then, I get a screen where I leave the defaults including “Create a New Database” and fill in a password for sqlexpress (I just make that up since it’s going to create a sqlexpress database for me).</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_8.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_8.png" width="475" height="417" /></a>&#160;</p>
<p>I forget to scroll down and see the rest of the page so I get a warning.&#160; I then scroll down, fill in the below with the same password (which probably could be different) and press continue.</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_9.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_9.png" width="468" height="410" /></a> </p>
<p>&#160;</p>
<p>And, I get this error:</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_10.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_10.png" width="414" height="214" /></a>&#160;</p>
<p>I say “no” because likely bad things will happen.&#160; Now, I go backwards a little and try to install it to a SqlServer Instance running externally.&#160; I do know that I will be able to make this work, but here is where the experience kind of sucks.&#160; I don’t know that most people who have not spend years like I have messing around with sqlserver and asp.net would figure it out.</p>
<p>As a little bit of a disclaimer and possible reason why things did not work, I have to admit I have almost no experience with SqlExpress.&#160; I use SqlServer on all my projects.&#160; Maybe I did not answer a question as well as I could of had I known SqlExpress better.</p>
<p>So, now I update my screen to point to a SqlServer on a system named W500 (that’s the main computer the VM is running on with it’s firewall open to SqlServer port 1433.&#160; I rename the database to umbracofirst hoping it will create this as well as the user umbracouser.&#160; Let’s see.</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_11.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_11.png" width="457" height="399" /></a> </p>
<p>Up comes this screen after I press Continue which is encouraging.</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_12.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_12.png" width="468" height="409" /></a> </p>
<p>A few minutes go by and then I get some good news.</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_13.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_13.png" width="410" height="363" /></a> </p>
<p>I press Finish and am brought back to the the PI screen.</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_14.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_14.png" width="436" height="327" /></a> </p>
<p>Now, time to see what happened.&#160; A completion dialog with “what’s next might have been nice as opposed to just a “Finished and Congratulations” message.</p>
<p>&#160;</p>
<h3>Time to Snoop Around for What Happened</h3>
<p>My first guess is it installed an IIS web site.&#160; So, let’s run IIS Manager as follows to see.</p>
<p>&#160;</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_15.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_15.png" width="342" height="434" /></a> </p>
<p>Sure enough, here is the site it created.</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_16.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_16.png" width="437" height="307" /></a>&#160;</p>
<p>To run the default.aspx page, I do this:</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_17.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_17.png" width="454" height="405" /></a> </p>
<p>Http 404 just means not found.</p>
<p>&#160;</p>
<h2>Things Did Not Work! Time for a Fix</h2>
<p>&#160;</p>
<p>After trolling the internet for a while, I find someone who says try removing and re-adding the web site in IIS Manager.&#160; I do that as follows:</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_18.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_18.png" width="372" height="378" /></a> </p>
<p>Then, do re-add it.</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_19.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_19.png" width="428" height="263" /></a> </p>
<p>which leads to the following where I’ve name the site “MyUmbracoWeb” and added the physical path to where the app was installed by PI.</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_20.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_20.png" width="530" height="395" /></a> </p>
<p>I get the following warning</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_21.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_21.png" width="382" height="161" /></a> </p>
<p>which means I’ve created another web site (in addition to the one there originally named “Default” that is running on port 80.&#160; If I try to run the new web site, something bad will happen because I’ve asked for two sites to run on port 80.&#160; So, I say Yes.&#160; Now, it shows me that Default Web Site is running and MyEmbracoWeb is not.</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_22.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_22.png" width="304" height="181" /></a> </p>
<p>So, I need to stop “Default Web Site” and start “MyUmbracoWeb”.&#160; I do that as follows:</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_23.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_23.png" width="402" height="306" /></a> </p>
<p>Then,</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_24.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_24.png" width="411" height="310" /></a> </p>
<p>which gives me just MyUmbraco running.</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_25.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_25.png" width="210" height="156" /></a> </p>
<p>So, now to run the default page again.</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_26.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_26.png" width="318" height="379" /></a> </p>
<p>and Presto! now I’m back on track.</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_27.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_27.png" width="423" height="364" /></a></p>
<p>&#160;</p>
<h3>Continuing With Step By Step</h3>
<p>So, now we are back on track, let’s finish the setup.</p>
<p>The screen above has a “Next” button on the bottom right (a little out of site). Press that.</p>
<p>We get Step1/5, Accept License.</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_28.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_28.png" width="327" height="257" /></a>&#160; </p>
<p>Next, Confirm Defaults (nothing to change)</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_29.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_29.png" width="346" height="209" /></a> </p>
<p>Confirm leads to and error:</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_30.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_30.png" width="368" height="260" /></a> </p>
<p>This means we can’t write to the directory where the web site lives.&#160; So, let’s add permissions to that as follows:</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_31.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_31.png" width="364" height="319" /></a> </p>
<p>goes to:</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_32.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_32.png" width="261" height="338" /></a> </p>
<p>chose Edit and then full control for the IIS_IUSRS user.</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_33.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_33.png" width="323" height="332" /></a> </p>
<p>Press OK (Apply happens automatically)</p>
<p>For some reason, I lost my IE session so I had to back and re-run Default.aspx from IIS again, then go through first two wizard steps which takes me to the second step successfully completing.</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_34.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_34.png" width="430" height="142" /></a> </p>
<p>Moving on to by pressing Install button.</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_35.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_35.png" width="452" height="101" /></a> </p>
<p>Feeling like I went to step 3, but still happy because I’m getting good messages.&#160; After pressing Next gain I get:</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_36.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_36.png" width="471" height="138" /></a> </p>
<p>It tells me my permissions are Perfect!&#160; Now, really starting to feel good, pressing next gives me:</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_37.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_37.png" width="489" height="248" /></a> </p>
<p>I put in a password for my umbraco admin account and press “Change Password” button. I get another success!</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_38.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_38.png" width="376" height="123" /></a> </p>
<p>Pressing Next again I get:</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_39.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_39.png" width="415" height="233" /></a> </p>
<p>Clearly, I’m not an expert so I chose “Add Runway” and I do actually watch the video.&#160; It’s quite good IMHO.</p>
<p>Pressing next again, I get the following where I now chose Standard top Navigation and Contact Form.</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_40.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_40.png" width="423" height="332" /></a> </p>
<p>I press “Install Selected Modules” button and get&#160; a success install message:</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_41.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_41.png" width="430" height="130" /></a> ]</p>
<p>Pressing Next asks me to Register with umbarco (which I do), the press the hyperlink “Launch Umbraco”.</p>
<p>Now, I get the admin screen for umbraco!</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_42.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_42.png" width="421" height="308" /></a> </p>
<p>If I go back and now run <a href="http://localhost">http://localhost</a> I get:</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_43.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InstallingUmbracoToWindows7UltimateStepB_6E5F/image_thumb_43.png" width="437" height="383" /></a> </p>
<p>Everything is working!!! Hurray!!</p>
<p>&#160;</p>
<h2>Conclusions</h2>
<p>Kind of early for conclusions, but I’d say that the installation is clearly a work in progress.&#160; My personal preference would not to have this installer since it is obviously still a work in progress.&#160; Again, my personal opinion is that in this case less is more.&#160; Unless the experience with the wizard is near perfect, don’t do one. It just gets people (like me) frustrated.</p>
<p>On a happier note, I’ve been playing with Umbraco now for about 2 or 3 hours and am really impressed with it’s potential.&#160; I am going to continue down the path of evaluating (and hopefully using) umbraco for my CMS,Forums,Wiki and Ecommerce solutions.</p>
<p>Wish me luck!</p>
<p>and,… HTH’s.</p>
]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2010/07/10/installing-umbraco-to-win7-step-by-step/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Returning JsonResult From ASP.NET MVC 2.0 Controller and Unit Testing</title>
		<link>http://peterkellner.net/2010/05/14/unit-test-jsonresult-aspnet-mvc-reflection/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=unit-test-jsonresult-aspnet-mvc-reflection</link>
		<comments>http://peterkellner.net/2010/05/14/unit-test-jsonresult-aspnet-mvc-reflection/#comments</comments>
		<pubDate>Sat, 15 May 2010 04:19:31 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[ASP.NET 3.5]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[Reflection]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2010/05/14/unit-test-jsonresult-aspnet-mvc-reflection/</guid>
		<description><![CDATA[* I’m adding this comment after the post has been written to let anyone coming here know of another great post that goes further to explain no only what I’ve done here, but also two other ways including Mock and using Json Serialization.&#160; The Post is written by Ashic Mahtab, aka “HeartattacK” on the forums.&#160; [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>* I’m adding this comment after the post has been written to let anyone coming here know of another great post that goes further to explain no only what I’ve done here, but also two other ways including Mock and using Json Serialization.&#160; The Post is written by <a href="http://www.heartysoft.com/page/about.aspx">Ashic Mahtab</a>, aka “<a href="http://forums.asp.net/members/HeartattacK.aspx">HeartattacK</a>” on the forums.&#160; His well written and informative article is here:&#160; <a href="http://www.heartysoft.com/post/2010/05/25/ASPNET-MVC-Unit-Testing-JsonResult-Returning-Anonymous-Types.aspx">ASP.NET MVC – Unit Testing JsonResult Returning Anonymous Types</a>.</p>
</blockquote>
<p>This post will show how to return a simple Json result from an <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=c9ba1fe1-3ba8-439a-9e21-def90a8615a9&amp;displaylang=en">ASP.NET MVC 2.0</a> web project.&#160; It will show how to test that result inside a unit test and essentially pick apart the Json, just like a JavaScript (or other client) would do.&#160; It seems like it should be very simple (and indeed, once you see the answer it is), however there are lots of length discussions on the forums about this with all kinds of positives and negatives.&#160; The one I based my solution on is from Stack Overflow and is <a href="http://stackoverflow.com/questions/482363/should-my-mvc-controller-really-know-about-json">here</a>..&#160; My personal length discussion that did not really yield a satisfactory answer is <a href="http://social.msdn.microsoft.com/Forums/en-US/csharplanguage/thread/552b6dda-5e98-4012-8df2-70a845aab680/">here</a>.</p>
<p>If you follow my method, you’ll be able to unit test a <a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.jsonresult.aspx">JsonResult</a> created by an <a href="http://www.asp.net/(S(d35rmemuuono1wvm1gsp2n45))/mvc">MVC asp.net web application</a>. </p>
<p> <span id="more-1316"></span><br />
<h2>Controller Side (Server)</h2>
<p>Let’s get started. First thing we need to do is have a controller that return a JsonResult.&#160; Below is the one I’m currently working on.&#160; Let me show the code, then explain it.</p>
<p>&#160;</p>
<div id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">public</span> ActionResult Get(FormCollection form)       {           var query = <span style="color: #0000ff">new</span> FolderPairQuery();           <span style="color: #0000ff">if</span> (form[<span style="color: #006080">&quot;query&quot;</span>] != <span style="color: #0000ff">null</span>)           {               query = form[<span style="color: #006080">&quot;query&quot;</span>].FromJson&lt;FolderPairQuery&gt;();           }

           <span style="color: #0000ff">if</span> (form[<span style="color: #006080">&quot;start&quot;</span>] != <span style="color: #0000ff">null</span> &amp;&amp; form[<span style="color: #006080">&quot;limit&quot;</span>] != <span style="color: #0000ff">null</span>)           {               query.Start = Convert.ToInt32(form[<span style="color: #006080">&quot;start&quot;</span>]);               query.Limit = Convert.ToInt32(form[<span style="color: #006080">&quot;limit&quot;</span>]);           }

           var results = FolderPairManager.I.Get(query);           <span style="color: #0000ff">return</span> Json(<span style="color: #0000ff">new</span>                           {                               success = <span style="color: #0000ff">true</span>,                               rows = results,                               total = query.OutputTotal                           }, JsonRequestBehavior.AllowGet);       }</pre>
</div>
<div>&#160;</div>
<p>This code is actually part of the file FolderPairController.cs.&#160; It returns an ActionResult (which in this case is JsonResult that derives from ActionResult).&#160; All the way to the return statement is just stuff that I do in my code to pull apart the passed in Request variables and process them.&#160; I only leave them in for context.&#160; It does not matter how you get your “results” and “total”, it just matters that you do. Then, the return statement is the part that is of interest.&#160; It’s basically returning an anonymous class which is actually a JsonResult.&#160; In System.Web.Mvc.Controller.cs, you will see that Json is defined as:</p>
<p>&#160;</p>
<div>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">protected</span> <span style="color: #0000ff">internal</span> JsonResult Json(<span style="color: #0000ff">object</span> data, JsonRequestBehavior behavior);</pre>
</div>
<div>&#160;</div>
<div>&#160;</div>
<div>The first parameter is “object data” which means it can be anything, and in our case, it is an anonymous object.</div>
<div>&#160;</div>
<h2>Unit Test Side (Client)</h2>
<div>&#160;</div>
<div>So now, let’s take a look at the unit test itself.&#160; Again, let me show the code, then explain it.</div>
<div>&#160;</div>
<div id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">[TestMethod]<span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> InsertControllerTest(){    var pairName = <span style="color: #0000ff">string</span>.Format(<span style="color: #006080">&quot;FolderPair {0}&quot;</span>,         (<span style="color: #0000ff">new</span> Random().Next(1, 10000)));    var folderPairResults =        <span style="color: #0000ff">new</span> List&lt;FolderPairResult&gt;()            {                <span style="color: #0000ff">new</span> FolderPairResult                    {                        ActionTypeId = 1,                        CheckFileContent = <span style="color: #0000ff">true</span>,                        ActiveForRunAll = <span style="color: #0000ff">true</span>,                        ExcludeHiddenFiles = <span style="color: #0000ff">true</span>,                        ExcludeReadOnly = <span style="color: #0000ff">true</span>,                        ExcludeSystemFiles = <span style="color: #0000ff">true</span>,                        FolderPairName = pairName,                        LeftFolder = <span style="color: #006080">&quot;left&quot;</span>,                        RightFolder = <span style="color: #006080">&quot;right&quot;</span>,                        SaveOverWrittenRecycleBin = <span style="color: #0000ff">true</span>,                        UsersId = 1                    }            };

    <span style="color: #0000ff">string</span> jsonInsert = JsonConvert.SerializeObject(folderPairResults);

    var form =        <span style="color: #0000ff">new</span> FormCollection            {                {<span style="color: #006080">&quot;data&quot;</span>, jsonInsert}            };

    <span style="color: #0000ff">using</span> (var controller = <span style="color: #0000ff">new</span> FolderPairController())    {

        controller.Insert(form);    }

    <span style="color: #008000">// verify it got inserted.</span>    var queryObj = <span style="color: #0000ff">new</span> FolderPairQuery { FolderPairName = pairName };    <span style="color: #0000ff">string</span> json = JsonConvert.SerializeObject(queryObj);    var formGet =        <span style="color: #0000ff">new</span> FormCollection()            {                {<span style="color: #006080">&quot;query&quot;</span>, json}            };

    <span style="color: #0000ff">using</span> (var controller = <span style="color: #0000ff">new</span> FolderPairController())    {        var jsonResult1 = controller.Get(formGet) <span style="color: #0000ff">as</span> JsonResult;        Assert.IsNotNull(jsonResult1,<span style="color: #006080">&quot;jsonResult1 is null which is bad&quot;</span>);

            List&lt;FolderPairResult&gt; folderPairResults1 =                (List&lt;FolderPairResult&gt;)                (jsonResult1.Data.GetType().GetProperty(<span style="color: #006080">&quot;rows&quot;</span>)).GetValue(jsonResult1.Data, <span style="color: #0000ff">null</span>);            <span style="color: #0000ff">bool</span> success =                (<span style="color: #0000ff">bool</span>)                (jsonResult1.Data.GetType().GetProperty(<span style="color: #006080">&quot;success&quot;</span>)).GetValue(jsonResult1.Data, <span style="color: #0000ff">null</span>);            <span style="color: #0000ff">int</span> total =                (<span style="color: #0000ff">int</span>)                (jsonResult1.Data.GetType().GetProperty(<span style="color: #006080">&quot;total&quot;</span>)).GetValue(jsonResult1.Data, <span style="color: #0000ff">null</span>);

            Assert.IsTrue(folderPairResults1.Count == 1, <span style="color: #006080">&quot;Not one item returned&quot;</span>);            Assert.IsTrue(folderPairResults1[0].FolderPairName.Equals(pairName),                <span style="color: #006080">&quot;Wrong pairname returned&quot;</span>);    }}</pre>
<p></div>
<div>Up to the line “// verify it got inserted”, we simply are adding the record to the database in our unit test.&#160; I won’t go into detail about that in this post since it is not really the purpose here.&#160; I’m really just trying to show how to extract from the JsonResult the values that are returned from the server.</div>
<div>&#160;</div>
<div>So, notice the line “var jsonResult1 = controller.Get(formGet) as JsonResult;”.&#160; This line simply calls the controller’s get method with the appropriate query parameters and returns us a JsonResult.&#160; Now, let’s look at how to get the data out of that.&#160; It’s really quite simple using reflection.&#160; Each of the following three lines pulls the data out so that at the end, we have our typed data for rows,total and count.</div>
<div>&#160;</div>
<div>Hopefully, this will help you.&#160; Like I said in the beginning, there are lots of ways to do this.&#160; This just shows one that works for me.</div>
<div>&#160;</div>
<div>
  </div>
]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2010/05/14/unit-test-jsonresult-aspnet-mvc-reflection/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Is There A Need For End-To-End ExtJS to Microsoft Server (MVC-C#, LOB) 4 Day Class? (Poll Enclosed)</title>
		<link>http://peterkellner.net/2010/05/04/lob-training-poll-using-extjs-dotnet-aspnet-mvc/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=lob-training-poll-using-extjs-dotnet-aspnet-mvc</link>
		<comments>http://peterkellner.net/2010/05/04/lob-training-poll-using-extjs-dotnet-aspnet-mvc/#comments</comments>
		<pubDate>Wed, 05 May 2010 02:54:13 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[.NET 4.0]]></category>
		<category><![CDATA[ASP.NET 4.0]]></category>
		<category><![CDATA[Entity Framework]]></category>
		<category><![CDATA[ExtJS]]></category>
		<category><![CDATA[LINQ to SQL]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[OData]]></category>
		<category><![CDATA[Training]]></category>

		<guid isPermaLink="false">http://peterkellner.net/?p=1289</guid>
		<description><![CDATA[Over the past couple years, the focus of the web development I’ve been doing involves building highly flexible, highly scalable and straight forward web sites to implement and maintain Line of Business (LOB) applications.&#160; As you can probably tell from my posts, I’m very “practical” focused, and at the same time have a desire to [...]]]></description>
			<content:encoded><![CDATA[<p>Over the past couple years, the focus of the web development I’ve been doing involves building highly flexible, highly scalable and straight forward web sites to implement and maintain <a href="http://en.wikipedia.org/wiki/Line_of_business">Line of Business</a> (LOB) applications.&#160; As you can probably tell from my posts, I’m very “practical” focused, and at the same time have a desire to build awesome web applications.</p>
<p>The technology pairing I’ve chosen is <a href="http://www.asp.net/mvc/whatisaspmvc/">Microsoft’s .Net platform with MVC</a> on the server, and <a href="http://www.extjs.com/">ExtJS</a> on the client.&#160; Though it’s possible to still use ExtJS with standard html/aspx pages, I’ve found the best combination is to use 100% <a href="http://www.javascript.com/">JavaScript</a> on the client (ExtJS) and have all the server side technology be 100% service based.&#160; I’ve used <a href="http://msdn.microsoft.com/en-us/library/bb425822.aspx">LINQ2SQL</a> extensively as well as <a href="http://msdn.microsoft.com/en-us/magazine/ee336128.aspx">Entity Framework</a> in the latest <a href="http://msdn.microsoft.com/en-us/vstudio/default.aspx">Visual Studio 2010</a> release.</p>
<p>The learning curve was quite steep to actually be able to efficiently build highly flexible, highly scalable applications using these technologies, but now that I know it, I wouldn’t have it any other way.</p>
<p>I’m considering putting together a series of <strong>4 Day Classes</strong> around the country (or even world) that would basically teach people the methods and patterns I’ve learned and essentially leap frog a development team into being able to quickly do what it has taken me years to figure out.&#160; I’ve been fortunate enough to know the top 1% instructors and I’m sure with the right incentive, can get them to join me in both putting together these classes as well as teaching them.</p>
<p> <span id="more-1289"></span>
<p>So, my question is:</p>
<p> [poll id=2]
<p>I really appreciate your feedback.&#160; If I go down this path, it will be a lot of work and it would be nice to know if people are really interested.&#160; I know for myself, I&#8217; would have gone to something like this 2 years ago and it would have saved me a lot of time.</p>
<p>Thanks for your feedback.</p>
]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2010/05/04/lob-training-poll-using-extjs-dotnet-aspnet-mvc/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>ReSharper 5.0&#8217;s LINQ Refactoring Continues to be Amazing!</title>
		<link>http://peterkellner.net/2010/04/21/linq-refactor-resharper-aspnet-dropdownlist/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=linq-refactor-resharper-aspnet-dropdownlist</link>
		<comments>http://peterkellner.net/2010/04/21/linq-refactor-resharper-aspnet-dropdownlist/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 00:46:00 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[ASP.NET 3.5]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[ReSharper]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2010/04/21/linq-refactor-resharper-aspnet-dropdownlist/</guid>
		<description><![CDATA[&#160;
In this post, we’ll take a straight forward procedure based set of code and convert it to LINQ using a ReSharper from JetBrains suggestion.&#160;&#160; I’ve found that in general, when I do things with foreach syntax, there is often a better way in Linq to do this.&#160; The better does not jump out at me [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>In this post, we’ll take a straight forward procedure based set of code and convert it to <a href="http://msdn.microsoft.com/en-us/netframework/aa904594.aspx">LINQ</a> using a <a href="http://www.jetbrains.com/resharper/whatsnew/">ReSharper</a> from <a href="http://www.jetbrains.com/index.html">JetBrains</a> suggestion.&#160;&#160; I’ve found that in general, when I do things with foreach syntax, there is often a better way in Linq to do this.&#160; The better does not jump out at me sometimes, however with ReSharper, it is often a button click away.</p>
<p> <span id="more-1274"></span>
<p>The initial code is as follows:</p>
<pre class="csharpcode"><span class="kwrd">int</span> selectedIndex = 0;
<span class="kwrd">foreach</span> (var rec <span class="kwrd">in</span> codeCampStringDictionary)
{
    <span class="kwrd">if</span> (rec.Key == codeCampYear)
    {
        <span class="kwrd">break</span>;
    }
    selectedIndex++;
}</pre>
<p>And, <a href="http://www.jetbrains.com/resharper/">ReSharper</a> is going to suggest turning it into:</p>
<pre class="csharpcode"><span class="kwrd">int</span> selectedIndex = codeCampStringDictionary.TakeWhile(rec =&gt; rec.Key != codeCampYear).Count();</pre>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>Simply Amazing!&#160; <a href="http://www.hookedonlinq.com/TakeWhileOperator.ashx">TakeWhile</a> had not even occurred to me.</p>
<p>(All while getting the <a href="http://www.siliconvalley-codecamp.com/">Silicon Valley Code Camp</a> Site Ready for our V5 Event, October 9th and 10th, 2010)</p>
<p>So, to explain the problem a little better, on the <a href="http://www.siliconvalley-codecamp.com/">Silicon Valley Code Camp</a> web site (which, by the way is scheduled for October 9th and 10th, 2010 this year), we have an ASP.NET <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.dropdownlist.aspx">DropDownList</a> in the upper right hand corner that the user can switch between different years. That is, say they want to see all the sessions in 2008’s code camp, they can simply change the dropdown and the site completely updates.&#160; When they do this, we don’t want to re-read the data table that contains the code camp years, we simply want to process the data that has already been stored in the <a href="http://msdn.microsoft.com/en-us/library/ms972976.aspx">ViewState</a> of the DropDownList and use that to figure out the key value of the table entry for the code camp year they selected.</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/ReS.0sLINQRefactoringContinuestobeAmazin_F9C9/image.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/ReS.0sLINQRefactoringContinuestobeAmazin_F9C9/image_thumb.png" width="632" height="172" /></a> </p>
<p>OK, if you didn’t follow all that, it really doesn’t matter.&#160; This blog post is simply about how clever ReSharper is and how much I enjoy what the tool does.&#160; It’s nice to have a tool teach me things!</p>
<p>The complete commented code is below that includes some comments about how it actually works.&#160; I’m looking forward to several people posting comments letting me know that there is even a simpler way to do this.&#160;&#160; I love my job!</p>
<p>&#160;</p>
<div id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #008000">// Create a dictionary out of values in a DropDownList.  That is,</span><span style="color: #008000">// the DropDownList has a Key Value which is it's primary key</span><span style="color: #008000">// and a text value which is the Code Camp Year.</span>Dictionary&lt;<span style="color: #0000ff">int</span>, <span style="color: #0000ff">string</span>&gt; codeCampStringDictionary =    DropDownListCodeCampYearID.Items.Cast&lt;ListItem&gt;().        OrderBy(a =&gt; a.Value).        ToDictionary(itemdd =&gt; Convert.ToInt32(itemdd.Value),                     itemdd =&gt; itemdd.Text);

<span style="color: #008000">// Then, loop through the values in the dictionary and figure out</span><span style="color: #008000">// the offset of a particular value.  That is, if there are 3 values</span><span style="color: #008000">// in the list of 2008,2009,2010 which have primary keys of 3,4,5</span><span style="color: #008000">// we want to know, that given codeCampYear is 4, then selectedIndex </span><span style="color: #008000">// is the second value and should be 2.</span><span style="color: #0000ff">int</span> selectedIndex = codeCampStringDictionary.TakeWhile    (rec =&gt; rec.Key != codeCampYear).Count();

<span style="color: #0000ff">string</span> dateString = Utils.GetCodeCampDateStringByCodeCampYearId(codeCampYear);DropDownListCodeCampYearID.SelectedIndex = selectedIndex;HeaderId1.Text = String.Format(<span style="color: #006080">&quot;Saturday and Sunday, {0}&quot;</span>, dateString);</pre>
<p></div>
<p>Let the comments roll! </p>
]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2010/04/21/linq-refactor-resharper-aspnet-dropdownlist/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How To User StreamReader to Open A File ReadOnly in C# (.NET)</title>
		<link>http://peterkellner.net/2009/12/07/csharp-streamreader-readonly/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=csharp-streamreader-readonly</link>
		<comments>http://peterkellner.net/2009/12/07/csharp-streamreader-readonly/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 01:14:35 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[ASP.NET 3.5]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2009/12/07/csharp-streamreader-readonly/</guid>
		<description><![CDATA[&#160;
This is probably something pretty simple, hardly worth blogging about, but it took me a little while (15 minutes)&#160; to figure out how to open a file ReadOnly with StreamReader,&#160; so hopefully, next person looking will hit my blog post right away and save themselves 14 minutes.&#160; StreamReader can be very useful in C#.
Say you [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p>This is probably something pretty simple, hardly worth blogging about, but it took me a little while (15 minutes)&#160; to figure out how to open a file <a href="http://msdn.microsoft.com/en-us/library/acdd6hb7.aspx">ReadOnly</a> with StreamReader,&#160; so hopefully, next person looking will hit my blog post right away and save themselves 14 minutes.&#160; <a href="http://msdn.microsoft.com/en-us/library/system.io.streamreader.aspx">StreamReader</a> can be very useful in <a href="http://msdn.microsoft.com/en-us/vcsharp/aa336809.aspx">C#.</a></p>
<p>Say you have a block of code like the following for simply reading all lines of a file:</p>
<p> <span id="more-393"></span>
<pre class="csharpcode">StreamReader streamReader = <span class="kwrd">new</span> StreamReader(<span class="str">&quot;myfile.txt&quot;</span>)
<span class="kwrd">string</span> line;
  <span class="kwrd">while</span> ((line = streamReader.ReadLine()) != <span class="kwrd">null</span>)
  {
       <span class="rem">// do something      </span>
   }</pre>
<p>
  </p>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>When you run this, you will quickly find out that the file gets opened read/write.</p>
<p>To open the file ReadOnly, you have to add a little bit of extra information to the StreamReader constructor call.</p>
<p>That is:</p>
<pre class="csharpcode">StreamReader streamReader = <span class="kwrd">new</span> StreamReader(File.OpenRead(file));</pre>
<p>
  </p>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>Hope this helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2009/12/07/csharp-streamreader-readonly/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Fun Times at &#8220;Ask the Experts&#8221; table at PDC09 Today</title>
		<link>http://peterkellner.net/2009/11/16/pdc09-asktheexperts-dynamicdata/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=pdc09-asktheexperts-dynamicdata</link>
		<comments>http://peterkellner.net/2009/11/16/pdc09-asktheexperts-dynamicdata/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 22:56:38 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[ASP.NET 3.5]]></category>
		<category><![CDATA[Community]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2009/11/16/pdc09-asktheexperts-dynamicdata/</guid>
		<description><![CDATA[One of the fun parts of being an MVP is that occasionally we get asked to help at Microsoft events and answer questions around topics that are just fun to talk about regardless (and usually includes a free lunch).&#160; Today, I was sitting at the ASP.NET Dynamic Data table.&#160; We probably had about 10 people [...]]]></description>
			<content:encoded><![CDATA[<p>One of the fun parts of being an MVP is that occasionally we get asked to help at Microsoft events and answer questions around topics that are just fun to talk about regardless (and usually includes a free lunch).&#160; Today, I was sitting at the ASP.NET Dynamic Data table.&#160; We probably had about 10 people come and go.&#160; turns out, the most interesting topic was Commerce server.&#160; One of the guys at the table talked about a LINQ provider they developed that lets you make commerce server look just like any other LINQ data source.</p>
<p>Here are some pictures from my table.</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/FunTimesatAsktheExpertstableatPDC09Today_D0C8/CIMG0100.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="CIMG0100" border="0" alt="CIMG0100" src="http://peterkellner.net/FilesForWebDownload/FunTimesatAsktheExpertstableatPDC09Today_D0C8/CIMG0100_thumb.jpg" width="244" height="184" /></a> <a href="http://peterkellner.net/FilesForWebDownload/FunTimesatAsktheExpertstableatPDC09Today_D0C8/CIMG0102.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="CIMG0102" border="0" alt="CIMG0102" src="http://peterkellner.net/FilesForWebDownload/FunTimesatAsktheExpertstableatPDC09Today_D0C8/CIMG0102_thumb.jpg" width="244" height="184" /></a></p>
<p>(including, by twitter handles @Zannabanana and @EmilyF)</p>
]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2009/11/16/pdc09-asktheexperts-dynamicdata/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To View JSON in a Pretty Way</title>
		<link>http://peterkellner.net/2009/11/06/formatting-json-best-tool/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=formatting-json-best-tool</link>
		<comments>http://peterkellner.net/2009/11/06/formatting-json-best-tool/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 16:49:04 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2009/11/06/formatting-json-best-tool/</guid>
		<description><![CDATA[Cutting to the chase, I choose Vladimir Bodurov’s Color Formatter!
For the past year or so, I’ve been working on a project that uses Microsoft’s ASP.NET MVC for providing data to our pure JavaScript application.&#160; That is, there are no web forms, no dynamic HTML generation, just 100% JavaScript running on the client.&#160; I’m using a [...]]]></description>
			<content:encoded><![CDATA[<p>Cutting to the chase, I choose <a href="http://blog.bodurov.com/Formatter-and-colorer-of-raw-JSON-code">Vladimir Bodurov’s Color Formatter!</a></p>
<p>For the past year or so, I’ve been working on a project that uses Microsoft’s <a href="http://www.asp.net/mvc/">ASP.NET MVC</a> for providing data to our pure JavaScript application.&#160; That is, there are no web forms, no dynamic HTML generation, just 100% JavaScript running on the client.&#160; I’m using a library called <a href="http://extjs.com">ExtJS</a> which gives us high quality “forms like” user interactions and MVC for getting the data.&#160; That is, the Application looks like this:</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/HowToViewJSONinaPrettyWay_741F/image.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/HowToViewJSONinaPrettyWay_741F/image_thumb.png" width="231" height="283" /></a></p>
<p>The data retrieval URL used by the JavaScript look like:</p>
<p> <span id="more-378"></span>
<p><a href="http://www.mycompany.com/data/Company/Get">http://www.mycompany.com/data/Company/Get</a></p>
<p>And, the JSON that comes back using either FireBug or Fiddler looks like this:</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/HowToViewJSONinaPrettyWay_741F/image_3.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/HowToViewJSONinaPrettyWay_741F/image_thumb_3.png" width="244" height="170" /></a></p>
<p>Problem is that it’s hard to read the JSON data.&#160; <a href="http://getfirebug.com/">Firebug</a> does a reasonable job of formatting, but it’s still not perfect.&#160; Up until now, the way I always have formatted the data is to type into <a href="http://www.bing.com/search?q=format+json&amp;form=QBLH&amp;qs=n">bing</a> or <a href="http://www.google.com/search?hl=en&amp;source=hp&amp;q=json+format&amp;rlz=1R2GGLL_enUS341&amp;aq=f&amp;oq=&amp;aqi=g-p2g4g-s1g3">Google</a> “format json” and the first reasonable choice has been <a title="http://jsonformat.com/" href="http://jsonformat.com/">http://jsonformat.com/</a>.&#160; Cutting and pasting my data into it shows:</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/HowToViewJSONinaPrettyWay_741F/image_4.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/HowToViewJSONinaPrettyWay_741F/image_thumb_4.png" width="244" height="241" /></a></p>
<p>However, my new favorite JSON Formatter&#160; makes the data look like this:</p>
<p>( <a title="http://www.bodurov.com/JsonFormatter/" href="http://www.bodurov.com/JsonFormatter/">http://www.bodurov.com/JsonFormatter/</a> )</p>
<p>(more information at: <a title="http://blog.bodurov.com/Formatter-and-colorer-of-raw-JSON-code" href="http://blog.bodurov.com/Formatter-and-colorer-of-raw-JSON-code">http://blog.bodurov.com/Formatter-and-colorer-of-raw-JSON-code</a>)</p>
<p>And, it’s available as simple html you can run on your own server here at codeplex:</p>
<p><a title="http://www.codeplex.com/QuickJsonFormatter/Release/ProjectReleases.aspx?ReleaseId=10136" href="http://www.codeplex.com/QuickJsonFormatter/Release/ProjectReleases.aspx?ReleaseId=10136">http://www.codeplex.com/QuickJsonFormatter/Release/ProjectReleases.aspx?ReleaseId=10136</a></p>
<p>&#160;</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/HowToViewJSONinaPrettyWay_741F/image_5.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/HowToViewJSONinaPrettyWay_741F/image_thumb_5.png" width="305" height="393" /></a></p>
<p>IMHO, much cleaner, shows me the data both before and after, as well as colorizes it which always makes me happy.</p>
]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2009/11/06/formatting-json-best-tool/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>At PDC09 Windows Bootcamp (Monday 11/16) Doing Table Top Demos of ASP.NET Dynamic Data</title>
		<link>http://peterkellner.net/2009/10/26/pdc09-windows7bootcamp-showingdynamicdata-aspnet/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=pdc09-windows7bootcamp-showingdynamicdata-aspnet</link>
		<comments>http://peterkellner.net/2009/10/26/pdc09-windows7bootcamp-showingdynamicdata-aspnet/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 18:33:13 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[ASP.NET 3.5]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Community]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2009/10/26/pdc09-windows7bootcamp-showingdynamicdata-aspnet/</guid>
		<description><![CDATA[ Microsoft’s big developer conference (PDC http://microsoftpdc.com/) happens about every other year when Microsoft has big announcements.&#160; Turns out, there was one last year, and for the first time ever, they are having a second one in row this year.&#160; Reason is because of large announcements from Microsoft including Windows 7.
The conference is Tuesday through [...]]]></description>
			<content:encoded><![CDATA[<p> Microsoft’s big developer conference (PDC <a href="http://microsoftpdc.com/">http://microsoftpdc.com/</a>) happens about every other year when Microsoft has big announcements.&#160; Turns out, there was one last year, and for the first time ever, they are having a second one in row this year.&#160; Reason is because of large announcements from Microsoft including Windows 7.</p>
<p>The conference is Tuesday through Friday.&#160; On Monday, there are special invents, usually full day in nature.&#160; I’ve been asked to participate in the <a href="http://microsoftpdc.com/Sessions/WKSP08">Windows 7 Bootcamp on Monday</a> showing some of the new technology that is available from Microsoft.</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/AtPDC09WindowsBootcampMon.NETDynamicData_9FE7/image.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/AtPDC09WindowsBootcampMon.NETDynamicData_9FE7/image_thumb.png" width="427" height="154" /></a></p>
<p> <span id="more-374"></span>
<p>My little piece is to talk about the new <a href="http://www.asp.net/dynamicdata/">Dynamic Data</a> Feature built into asp.net.&#160; Basically, what Dynamic Data gives you in a nut shell is the ability to easily make web apps easier for showing all kind of different data types.</p>
<p>For example, if you happen to have a picture stored with each user’s profile, Dynamic Data gives you a straight forward, easy to implement way of uploading and displaying that data in a standard ASP.NET control like <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.aspx">GridView</a>, ListView, DetailsView, etc.&#160; Another example is that say you have a “State” field that is 2 characters long in your database.&#160; Dynamic Data allows you to have validation for that with practically no code.</p>
<p>Dynamic Data is truly one of the most innovative developer technologies Microsoft has brought out IMHO.</p>
<p>Hope to see you there.</p>
]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2009/10/26/pdc09-windows7bootcamp-showingdynamicdata-aspnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using LINQ to Convert an Array Into a Generic List with C#</title>
		<link>http://peterkellner.net/2009/10/14/linq-convert-array-to-list/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=linq-convert-array-to-list</link>
		<comments>http://peterkellner.net/2009/10/14/linq-convert-array-to-list/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 00:35:45 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[ASP.NET 3.5]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[LINQ]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2009/10/14/linq-convert-array-to-list/</guid>
		<description><![CDATA[This is just going to be a short post, but I bet it’s something I do a large number of times so I thought I’d blog it.&#160; Say you get back from something like a web service an array of objects.
 
In my case this:
cmRateResult[] cmRateResults = TransiteUtils.MakeRateRequest(_cmRateRequest);

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", [...]]]></description>
			<content:encoded><![CDATA[<p>This is just going to be a short post, but I bet it’s something I do a large number of times so I thought I’d blog it.&#160; Say you get back from something like a web service an array of objects.</p>
<p> <span id="more-364"></span>
<p>In my case this:</p>
<pre class="csharpcode">cmRateResult[] cmRateResults = TransiteUtils.MakeRateRequest(_cmRateRequest);</pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>Then, I want to convert that into</p>
<p>List&lt;cmRateResult]</p>
<p>We all know the foreach way of doing it, about 5 lines of code</p>
<pre class="csharpcode">var cmRateResultsList = <span class="kwrd">new</span> List&lt;cmRateResult&gt;(cmRateResults.Length);
 <span class="kwrd">foreach</span> (var r <span class="kwrd">in</span> cmRateResults)
 {
      cmRateResultsList.Add(r);
 }</pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>Or, my preferred way is to use the LINQ for syntax as follows:</p>
<pre class="csharpcode">var recs = (from data <span class="kwrd">in</span> cmRateResults select data).ToList();</pre>
<p>But, it’s nicer (IMHO) to do it with LINQ chaining, though exactly the same. here it is:</p>
<pre class="csharpcode">var recs = cmRateResults.Select(data =&gt; data)).ToList()</pre>
<p>Hope this helps!</p>
<pre class="csharpcode">&#160;</pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2009/10/14/linq-convert-array-to-list/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>How to Disable Edit/Insert/New Buttons in DetailsView or GridView (ASP.NET 2.0+)</title>
		<link>http://peterkellner.net/2009/09/06/detailsview-gridview-aspnet-disable-new-edit-delete-buttons/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=detailsview-gridview-aspnet-disable-new-edit-delete-buttons</link>
		<comments>http://peterkellner.net/2009/09/06/detailsview-gridview-aspnet-disable-new-edit-delete-buttons/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 00:27:24 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[ASP.NET 2.0]]></category>
		<category><![CDATA[ASP.NET 3.5]]></category>
		<category><![CDATA[DetailsView]]></category>
		<category><![CDATA[GridView]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2009/09/06/detailsview-gridview-aspnet-disable-new-edit-delete-buttons/</guid>
		<description><![CDATA[So, this is kind of embarrassing, that it took me a while to figure this out.&#160; I have not been doing pure asp.net server control programming for a while, but I figure since it took me a while, maybe there is someone else in the same boat.
So, you have a GridView or DetailsView that has [...]]]></description>
			<content:encoded><![CDATA[<p>So, this is kind of embarrassing, that it took me a while to figure this out.&#160; I have not been doing pure asp.net server control programming for a while, but I figure since it took me a while, maybe there is someone else in the same boat.</p>
<p>So, you have a GridView or <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.detailsview(VS.80).aspx">DetailsView</a> that has standard “Edit” “Update” “New” type command buttons on them.&#160; The way they get there is by having the declaration something like this:</p>
<p> <span id="more-352"></span>
<pre class="csharpcode"> &lt;asp:DetailsView ID=<span class="str">&quot;DetailsView1&quot;</span> runat=<span class="str">&quot;server&quot;</span> Height=<span class="str">&quot;50px&quot;</span> Width=<span class="str">&quot;125px&quot;</span>
            AllowPaging=<span class="str">&quot;True&quot;</span> AutoGenerateRows=<span class="str">&quot;False&quot;</span> DataKeyNames=<span class="str">&quot;Id&quot;</span>
            DataSourceID=<span class="str">&quot;SqlDataSource1&quot;</span>&gt;
            &lt;Fields&gt;
                &lt;asp:BoundField DataField=<span class="str">&quot;Id&quot;</span> HeaderText=<span class="str">&quot;Id&quot;</span> ReadOnly=<span class="str">&quot;True&quot;</span>
                    SortExpression=<span class="str">&quot;Id&quot;</span> /&gt;
                &lt;asp:BoundField DataField=<span class="str">&quot;Name&quot;</span> HeaderText=<span class="str">&quot;Name&quot;</span> SortExpression=<span class="str">&quot;Name&quot;</span> /&gt;
                &lt;asp:BoundField DataField=<span class="str">&quot;CampStartDate&quot;</span> HeaderText=<span class="str">&quot;CampStartDate&quot;</span>
                    SortExpression=<span class="str">&quot;CampStartDate&quot;</span> /&gt;
                &lt;asp:BoundField DataField=<span class="str">&quot;CampEndDate&quot;</span> HeaderText=<span class="str">&quot;CampEndDate&quot;</span>
                    SortExpression=<span class="str">&quot;CampEndDate&quot;</span> /&gt;
                &lt;asp:CommandField ShowEditButton=<span class="str">&quot;True&quot;</span> ShowInsertButton=<span class="str">&quot;True&quot;</span> /&gt;
            &lt;/Fields&gt;
&lt;/asp:DetailsView&gt;</pre>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>What you want is to say something like:</p>
<p>“I only want admin’s to be able to add new rows so&#160; want to hide the “new” button based on that”</p>
<p>So, first thing is to convert the field to a template from the following menu.&#160; You do this by using the little helper in the upper right hand corner of the detailsview (in design mode), chose Edit Fields, CommandField, then convert to template (as in the picture below).</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/HowtoDisableEditInsertNewButtonsinDeta.0_F26A/image.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/HowtoDisableEditInsertNewButtonsinDeta.0_F26A/image_thumb.png" width="521" height="299" /></a></p>
<p>Then, you will have something like this:</p>
<pre class="csharpcode"> &lt;asp:DetailsView ID=<span class="str">&quot;DetailsView1&quot;</span> runat=<span class="str">&quot;server&quot;</span> Height=<span class="str">&quot;50px&quot;</span> Width=<span class="str">&quot;125px&quot;</span>
            AllowPaging=<span class="str">&quot;True&quot;</span> AutoGenerateRows=<span class="str">&quot;False&quot;</span> DataKeyNames=<span class="str">&quot;Id&quot;</span>
            DataSourceID=<span class="str">&quot;SqlDataSource1&quot;</span>&gt;
            &lt;Fields&gt;
                &lt;asp:BoundField DataField=<span class="str">&quot;Id&quot;</span> HeaderText=<span class="str">&quot;Id&quot;</span> ReadOnly=<span class="str">&quot;True&quot;</span>
                    SortExpression=<span class="str">&quot;Id&quot;</span> /&gt;
                &lt;asp:BoundField DataField=<span class="str">&quot;Name&quot;</span> HeaderText=<span class="str">&quot;Name&quot;</span> SortExpression=<span class="str">&quot;Name&quot;</span> /&gt;
                &lt;asp:BoundField DataField=<span class="str">&quot;CampStartDate&quot;</span> HeaderText=<span class="str">&quot;CampStartDate&quot;</span>
                    SortExpression=<span class="str">&quot;CampStartDate&quot;</span> /&gt;
                &lt;asp:BoundField DataField=<span class="str">&quot;CampEndDate&quot;</span> HeaderText=<span class="str">&quot;CampEndDate&quot;</span>
                    SortExpression=<span class="str">&quot;CampEndDate&quot;</span> /&gt;
                &lt;asp:TemplateField ShowHeader=<span class="str">&quot;False&quot;</span>&gt;
                    &lt;ItemTemplate&gt;
                        &lt;asp:LinkButton ID=<span class="str">&quot;LinkButton1&quot;</span> runat=<span class="str">&quot;server&quot;</span> CausesValidation=<span class="str">&quot;False&quot;</span>
                            CommandName=<span class="str">&quot;Edit&quot;</span> Text=<span class="str">&quot;Edit&quot;</span>&gt;&lt;/asp:LinkButton&gt;
                        &amp;nbsp;&lt;asp:LinkButton ID=<span class="str">&quot;LinkButton2&quot;</span> runat=<span class="str">&quot;server&quot;</span> CausesValidation=<span class="str">&quot;False&quot;</span>
                            CommandName=<span class="str">&quot;New&quot;</span> Text=<span class="str">&quot;New&quot;</span>&gt;&lt;/asp:LinkButton&gt;
                    &lt;/ItemTemplate&gt;
                    &lt;EditItemTemplate&gt;
                        &lt;asp:LinkButton ID=<span class="str">&quot;LinkButton1&quot;</span> runat=<span class="str">&quot;server&quot;</span> CausesValidation=<span class="str">&quot;True&quot;</span>
                            CommandName=<span class="str">&quot;Update&quot;</span> Text=<span class="str">&quot;Update&quot;</span>&gt;&lt;/asp:LinkButton&gt;
                        &amp;nbsp;&lt;asp:LinkButton ID=<span class="str">&quot;LinkButton2&quot;</span> runat=<span class="str">&quot;server&quot;</span> CausesValidation=<span class="str">&quot;False&quot;</span>
                            CommandName=<span class="str">&quot;Cancel&quot;</span> Text=<span class="str">&quot;Cancel&quot;</span>&gt;&lt;/asp:LinkButton&gt;
                    &lt;/EditItemTemplate&gt;
                    &lt;InsertItemTemplate&gt;
                        &lt;asp:LinkButton ID=<span class="str">&quot;LinkButton1&quot;</span> runat=<span class="str">&quot;server&quot;</span> CausesValidation=<span class="str">&quot;True&quot;</span>
                            CommandName=<span class="str">&quot;Insert&quot;</span> Text=<span class="str">&quot;Insert&quot;</span>&gt;&lt;/asp:LinkButton&gt;
                        &amp;nbsp;&lt;asp:LinkButton ID=<span class="str">&quot;LinkButton2&quot;</span> runat=<span class="str">&quot;server&quot;</span> CausesValidation=<span class="str">&quot;False&quot;</span>
                            CommandName=<span class="str">&quot;Cancel&quot;</span> Text=<span class="str">&quot;Cancel&quot;</span>&gt;&lt;/asp:LinkButton&gt;
                    &lt;/InsertItemTemplate&gt;
                &lt;/asp:TemplateField&gt;
            &lt;/Fields&gt;
&lt;/asp:DetailsView&gt;</pre>
<p>
  </p>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>Now, you have standard &lt;asp:LinkButton&gt; so you can call the visible property from your codebehind like this:</p>
<pre class="csharpcode"> <span class="kwrd">&lt;</span><span class="html">asp:TemplateField</span> <span class="attr">ShowHeader</span><span class="kwrd">=&quot;False&quot;</span><span class="kwrd">&gt;</span>
                     <span class="kwrd">&lt;</span><span class="html">ItemTemplate</span><span class="kwrd">&gt;</span>
                         <span class="kwrd">&lt;</span><span class="html">asp:LinkButton</span> <span class="attr">ID</span><span class="kwrd">=&quot;LinkButton1&quot;</span> <span class="attr">runat</span><span class="kwrd">=&quot;server&quot;</span> <span class="attr">CausesValidation</span><span class="kwrd">=&quot;False&quot;</span> <span class="attr">Visible</span><span class="kwrd">='&lt;%# GetShowEditButton() %&gt;'</span>
                             <span class="attr">CommandName</span><span class="kwrd">=&quot;Edit&quot;</span> <span class="attr">Text</span><span class="kwrd">=&quot;Edit&quot;</span><span class="kwrd">&gt;&lt;/</span><span class="html">asp:LinkButton</span><span class="kwrd">&gt;</span>
                         <span class="attr">&amp;nbsp;</span><span class="kwrd">&lt;</span><span class="html">asp:LinkButton</span> <span class="attr">ID</span><span class="kwrd">=&quot;LinkButton2&quot;</span> <span class="attr">runat</span><span class="kwrd">=&quot;server&quot;</span> <span class="attr">CausesValidation</span><span class="kwrd">=&quot;False&quot;</span> <span class="attr">Visible</span><span class="kwrd">='&lt;%# GetShowInsertButton() %&gt;'</span>
                             <span class="attr">CommandName</span><span class="kwrd">=&quot;New&quot;</span> <span class="attr">Text</span><span class="kwrd">=&quot;New&quot;</span><span class="kwrd">&gt;&lt;/</span><span class="html">asp:LinkButton</span><span class="kwrd">&gt;</span>
                         <span class="attr">&amp;nbsp;</span><span class="kwrd">&lt;</span><span class="html">asp:LinkButton</span> <span class="attr">ID</span><span class="kwrd">=&quot;LinkButton3&quot;</span> <span class="attr">runat</span><span class="kwrd">=&quot;server&quot;</span> <span class="attr">CausesValidation</span><span class="kwrd">=&quot;False&quot;</span>
                             <span class="attr">CommandName</span><span class="kwrd">=&quot;Delete&quot;</span> <span class="attr">Text</span><span class="kwrd">=&quot;Delete&quot;</span> <span class="attr">Visible</span><span class="kwrd">='&lt;%# GetShowDeleteButton() %&gt;'</span>     <span class="kwrd">&gt;&lt;/</span><span class="html">asp:LinkButton</span><span class="kwrd">&gt;</span>
                     <span class="kwrd">&lt;/</span><span class="html">ItemTemplate</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">asp:TemplateField</span><span class="kwrd">&gt;</span></pre>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>Then, in your codebehind, you have the following:</p>
<pre class="csharpcode"> <span class="kwrd">protected</span> <span class="kwrd">bool</span> GetShowEditButton()
    {
        <span class="kwrd">return</span> Roles.IsUserInRole(<span class="str">&quot;Admin&quot;</span>);
    }

    <span class="kwrd">protected</span> <span class="kwrd">bool</span> GetShowInsertButton()
    {
        <span class="kwrd">return</span> Roles.IsUserInRole(<span class="str">&quot;Admin&quot;</span>);
    }
    <span class="kwrd">protected</span> <span class="kwrd">bool</span> GetShowDeleteButton()
    {
        <span class="kwrd">return</span> Roles.IsUserInRole(<span class="str">&quot;Admin&quot;</span>);
    }
}</pre>
<p>Hope you find this before spending a bunch of time reading about more complicated solutions.</p>
]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2009/09/06/detailsview-gridview-aspnet-disable-new-edit-delete-buttons/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Bravo for ORCSWeb! On so many fronts</title>
		<link>http://peterkellner.net/2009/07/27/orcsweb-hosting-company-awesome-review/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=orcsweb-hosting-company-awesome-review</link>
		<comments>http://peterkellner.net/2009/07/27/orcsweb-hosting-company-awesome-review/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 19:59:07 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[ASP.NET 2.0]]></category>
		<category><![CDATA[ASP.NET 3.5]]></category>
		<category><![CDATA[Code Camp Web Site Series]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[Sql Server]]></category>
		<category><![CDATA[Sql Server 2008]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2009/07/27/orcsweb-hosting-company-awesome-review/</guid>
		<description><![CDATA[Many of you know of ORCSWeb either by reputation, or by way of Scott Forsyth, one of my ASP.NET MVP brothers.&#160; In case you don’t, they are a managed hosting solutions company specializing in Microsoft technologies.&#160; I’ve used their basic services for quite a while and have always been very happy.&#160; It has always seemed [...]]]></description>
			<content:encoded><![CDATA[<p>Many of you know of <a href="http://www.orcsweb.com/">ORCSWeb</a> either by reputation, or by way of <a href="http://weblogs.asp.net/owscott/default.aspx">Scott Forsyth</a>, one of my ASP.NET MVP brothers.&#160; In case you don’t, they are a managed hosting solutions company specializing in Microsoft technologies.&#160; I’ve used their basic services for quite a while and have always been very happy.&#160; It has always seemed that anytime I’ve called them (and it always seems like the middle of the night) one of their tech support staff is always available to help me, and go the extra mile if necessary.</p>
<p>The company I’m now working at is small and we don’t have a lot of resources to maintain hardware and do operating system type support.&#160; We do have a high load requirement so we need a very robust supported solution.&#160; Before this, I’d always been in the under $50 per month type plan with ORCSWeb, but I decided I needed more servers and a higher level of support.&#160; I really did not know what level of support to expect when signing up for the managed servers but decided to go for it anyway.</p>
<p>All&#160; can say is <strong>WOW!!!</strong>&#160; I am over the top impressed. </p>
<p> <span id="more-337"></span>
<p>We currently have 3 virtual servers hosted at ORCSWeb.&#160; One, we use as a development server, and the other two are in a webfarm configuration.&#160; I’ve always believed that when you go into production with a web site it’s critical you start with 2 servers in a webfarm.&#160; it’s really easy to go from 2 to 10, but can be very painful to go from 1 to 2.&#160;&#160; That’s a topic for another post, but suffice it to say, 2 is the minimum.</p>
<p>So, why am I so impressed?&#160; First, the support team they assigned to me is totally awesome.&#160; They all are focussed and competent which is a total relief compared with most hosting companies I’ve dealt with.&#160; Other companies always have good people, but it seems to be the bad ones that really give me cause to remember.&#160; Second, because I paid extra for the full managed support options on our three servers, I’ve been able to ask the things like the following.&#160; Almost all of them I could do myself, but I’m swamped with my technology role in the new company and really appreciate being able to hand stuff like this off.</p>
<ul>
<li>I’ve pointed my MX record at my .149 server.&#160; Could you please set up email and create the following 7 accounts. </li>
<li>Please Setup a secure ftp server at the following address with the following username and password (and make sure the user is locked down to the root) </li>
<li>Setup DFS Replication between these two directories on .148 and .149 </li>
<li>Create a RoboCopy script that copies files from my dev server to the .149 mirrored directory </li>
<li>Please set up web statistics for me on <a href="http://www.siliconvalley-codecamp.com">http://www.siliconvalley-codecamp.com</a> </li>
<li>Please figure out why SqlServer 2008 is not letting me access catalog MyStuff1 from user 3p1 and fix </li>
<li>Please make a replicate of website MyWeb1.com including the sqlserver catalog’s and put it on MyWeb2.com on server .149 </li>
<li>Please replace the sqlserver catalog MyStuff3 on server .149 with the bak file I uploaded to my ftp server </li>
<li>I could go on and on, but I think you are getting the idea. </li>
<li>Always with a smile, 24&#215;7, what else can I say. </li>
</ul>
<p>By the way, if you want to see one of my sites hosted there, go to <a href="http://www.siliconvalley-codecamp.com">http://www.siliconvalley-codecamp.com</a></p>
<p>Thank you <a href="http://www.orcsweb.com/">ORCSWeb</a> for making things a lot easier for me.</p>
]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2009/07/27/orcsweb-hosting-company-awesome-review/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>In ASP.NET, How To Create a DropDownList from an ENUM</title>
		<link>http://peterkellner.net/2009/06/16/in-aspnet-how-to-create-a-dropdownlist-from-an-enum/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=in-aspnet-how-to-create-a-dropdownlist-from-an-enum</link>
		<comments>http://peterkellner.net/2009/06/16/in-aspnet-how-to-create-a-dropdownlist-from-an-enum/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 23:05:14 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[ASP.NET 2.0]]></category>
		<category><![CDATA[ASP.NET 3.5]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2009/06/16/in-aspnet-how-to-create-a-dropdownlist-from-an-enum/</guid>
		<description><![CDATA[ So, you have an enum defined as follows:
public enum CompanyAddressType
    {
        Unknown = 0,
        Primary = 1,
        Warehouse = 2,
        Distribution_Center = 3,
 [...]]]></description>
			<content:encoded><![CDATA[<p> So, you have an enum defined as follows:</p>
<pre class="csharpcode"><span class="kwrd">public</span> <span class="kwrd">enum</span> CompanyAddressType
    {
        Unknown = 0,
        Primary = 1,
        Warehouse = 2,
        Distribution_Center = 3,
        Cross_Dock = 4
    }</pre>
<p>You want to iterate through the list and put the data into an asp.net dropdownlist.</p>
<p><span id="more-326"></span></p>
<p>Here is the simple code:</p>
<pre class="csharpcode"><span class="kwrd">protected</span> <span class="kwrd">void</span> Page_Load(<span class="kwrd">object</span> sender, EventArgs e)
        {
            <span class="kwrd">if</span> (!IsPostBack)
            {
                <span class="kwrd">string</span>[] names = Enum.GetNames(<span class="kwrd">typeof</span>(CompanyAddressType));
                var values = (CompanyAddressType[])Enum.GetValues(<span class="kwrd">typeof</span>(CompanyAddressType));
                <span class="kwrd">for</span> (<span class="kwrd">int</span> i = 0; i &lt; names.Length; i++)
                {
                    DropDownListCompanyAddressType.Items.Add(<span class="kwrd">new</span> ListItem(names[i], values.ToString()));
                }
            }
        }</pre>
<p>&#160;</p>
<p>There are probably easier ways to do it, but this works.</p>
<p>and…</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/InA.NETHowToCreateaDropDownListfromanENU_E21B/image.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/InA.NETHowToCreateaDropDownListfromanENU_E21B/image_thumb.png" width="246" height="154" /></a></p>
<p>HTH’s.</p>
]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2009/06/16/in-aspnet-how-to-create-a-dropdownlist-from-an-enum/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>My Two Presentations Today at VSLive in Las Vegas (ExtJS, Then High Performance ASP.NET Web Sites)</title>
		<link>http://peterkellner.net/2009/06/08/vslive-las-vegas-presentations/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=vslive-las-vegas-presentations</link>
		<comments>http://peterkellner.net/2009/06/08/vslive-las-vegas-presentations/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 05:41:51 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[ASP.NET 3.5]]></category>
		<category><![CDATA[ExtJS]]></category>
		<category><![CDATA[Presentations]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2009/06/08/vslive-las-vegas-presentations/</guid>
		<description><![CDATA[Today was my first time doing 2 presentations during the same day at a professional conference (VSLive, Las Vegas).&#160; Both sessions were fun to present and hopefully the audience got as much out of it as I did.&#160; Lots of great questions, several twitter posts and best of all, they both finished on time (that [...]]]></description>
			<content:encoded><![CDATA[<p>Today was my first time doing 2 presentations during the same day at a professional conference (<a href="http://vslive.com/2009/lasvegas/aspnet.aspx">VSLive, Las Vegas</a>).&#160; Both sessions were fun to present and hopefully the audience got as much out of it as I did.&#160; Lots of great questions, several twitter posts and best of all, they both finished on time (that is, I finished the material at the time I meant to!).</p>
<p>Here is the material for the first presentation:</p>
<p> <span id="more-319"></span>
<p><strong>Build Blazingly Fast ASP.NET Apps with 100% Clientside UI ExtJS</strong></p>
<blockquote><h6>Intermediate</h6>
<p>Need a web application that has the responsiveness and interactivity of a forms app but still looks and feels like a web? One of the best kept secrets (at least to the Microsoft community) is ExtJS. It&#8217;s a different paradigm then we are all use to, but the results are spectacular. <a href="http://extjs.com/deploy/dev/examples/samples.html">Take a look at this url</a> and you will see as well as learn how to do this yourself. The hardest part is shuttling the data back and forth. A lot of this session will be talking about how to do a real world app that does this. Once you go this way, you&#8217;ll be gone from serverside forms for almost ever.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:fb3a1972-4489-4e52-abe7-25a00bb07fdf:b6cf28fe-f692-47a2-af5a-540c990696b2" class="wlWriterSmartContent">
<p>Presentation Files <a href="http://peterkellner.net/FilesForWebDownload/MyTwoPresentationsTodayatVSL.NETWebSites_13F02/Vegas09extjs.zip" target="_blank">Download</a></p>
</p></div>
<p>&#160;</p>
</blockquote>
<p><strong>Building High Performance ASP.NET Web Applications </strong></p>
<blockquote><h6>Intermediate</h6>
<p>Topics will include appropriate use of Cache and Session State, as well as how and when to use them. Viewstate management and methods to minimize its use will be discussed. Code to pop up a warning when a threshold is met in development will be shown. When and how to take advantage of Server Farms will be discussed, as well as trouble shooting techniques to find problems. The evils of Server Affinity, as well as a common pattern for caching database queries will be shown to be wrong. Time permitting, we will talk about using Microsoft’s Ajax.asp.net with UpdatePanel and webservices and how these affect performance and scalability.</p>
<p>&#160;</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:fb3a1972-4489-4e52-abe7-25a00bb07fdf:5cd78bd5-c095-4d51-a9a1-130871cbdc92" class="wlWriterSmartContent">
<p>Presentation Files <a href="http://peterkellner.net/FilesForWebDownload/MyTwoPresentationsTodayatVSL.NETWebSites_13F02/Vegas09Perf.zip" target="_blank">Download</a></p>
</p></div>
</blockquote>
<p>&#160;</p>
<table border="0" cellspacing="0" cellpadding="2" width="597">
<tbody>
<tr colspan="2">
<td valign="top" width="583"><a href="http://peterkellner.net/FilesForWebDownload/MyTwoPresentationsTodayatVSL.NETWebSites_13F02/vslive1.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="vslive1" border="0" alt="vslive1" src="http://peterkellner.net/FilesForWebDownload/MyTwoPresentationsTodayatVSL.NETWebSites_13F02/vslive1_thumb.jpg" width="502" height="392" /></a> </td>
</tr>
<tr>
<td valign="top" width="583">&#160;</td>
<td valign="top" width="6">&#160;</td>
<p><a href="http://peterkellner.net/FilesForWebDownload/MyTwoPresentationsTodayatVSL.NETWebSites_13F02/IMG_1389.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="IMG_1389" border="0" alt="IMG_1389" src="http://peterkellner.net/FilesForWebDownload/MyTwoPresentationsTodayatVSL.NETWebSites_13F02/IMG_1389_thumb.jpg" width="244" height="184" /></a> <a href="http://peterkellner.net/FilesForWebDownload/MyTwoPresentationsTodayatVSL.NETWebSites_13F02/vslive3.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="vslive3" border="0" alt="vslive3" src="http://peterkellner.net/FilesForWebDownload/MyTwoPresentationsTodayatVSL.NETWebSites_13F02/vslive3_thumb.jpg" width="244" height="184" /></a>
</p>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2009/06/08/vslive-las-vegas-presentations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My ExtJS Presentation at Microsoft&#8217;s Office in San Francisco Last Night</title>
		<link>http://peterkellner.net/2009/05/21/baydotnet-presentation-extjs-aspnet-membership-profile-provider/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=baydotnet-presentation-extjs-aspnet-membership-profile-provider</link>
		<comments>http://peterkellner.net/2009/05/21/baydotnet-presentation-extjs-aspnet-membership-profile-provider/#comments</comments>
		<pubDate>Thu, 21 May 2009 19:07:27 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[ASP.NET 3.5]]></category>
		<category><![CDATA[Community]]></category>
		<category><![CDATA[ExtJS]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2009/05/21/baydotnet-presentation-extjs-aspnet-membership-profile-provider/</guid>
		<description><![CDATA[Last night, I gave a 90 minute presentation on how to use ExtJS with ASP.NET serving up the data at the San Francisco Microsoft Office to what seemed to be between 50 and 100 people.&#160; I started out with just a basic overview of ExtJS, starting with a hello world app, then, finally building it [...]]]></description>
			<content:encoded><![CDATA[<p>Last night, I gave a <a href="http://peterkellner.net/2009/04/20/speaking-aspnet-extjs-microsoft-sanfrancisco-high-perf-javascript/">90 minute presentation</a> on how to use ExtJS with ASP.NET serving up the data at the <a href="http://www.baynetug.org/DesktopModules/DetailXEvents.aspx?ItemID=378&amp;mid=49">San Francisco Microsoft Office</a> to what seemed to be between 50 and 100 people.&#160; I started out with just a basic overview of <a href="http://extjs.com/">ExtJS</a>, starting with a hello world app, then, finally building it into a full blown paging, updating, inserting and deleting Membership Management editor.&#160; The final application is actually here if you want to see how it runs:</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/MyExtJSPresentationatMicrosoftsOfficeinS_AA13/PeterKellnerMSPodium.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="PeterKellnerMSPodium" border="0" alt="PeterKellnerMSPodium" src="http://peterkellner.net/FilesForWebDownload/MyExtJSPresentationatMicrosoftsOfficeinS_AA13/PeterKellnerMSPodium_thumb.jpg" width="244" height="184" /></a></p>
<p> <span id="more-313"></span>
<p><a title="http://aspnetextjsdemo.peterkellner.net/ExtJSProfileEditorEAddDeleteToolbar.html" href="http://aspnetextjsdemo.peterkellner.net/ExtJSProfileEditorEAddDeleteToolbar.html">http://aspnetextjsdemo.peterkellner.net/ExtJSProfileEditorEAddDeleteToolbar.html</a></p>
<p><a href="http://peterkellner.net/FilesForWebDownload/MyExtJSPresentationatMicrosoftsOfficeinS_AA13/pagingextjs.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="pagingextjs" border="0" alt="pagingextjs" src="http://peterkellner.net/FilesForWebDownload/MyExtJSPresentationatMicrosoftsOfficeinS_AA13/pagingextjs_thumb.png" width="226" height="244" /></a></p>
<p>For me, it was a long day.&#160; I flew home from Chicago in the morning, went to work in the afternoon, and did the presentation that night.&#160; I decided to upgrade the source to the prelease V3 on the airplane which turned out to be a mistake because some of the demos did not quit work as I expected.&#160; That, combined with I had forgotten to plug my notebook in before the presentation and when I realized that (by almost running out of battery), I plugged my computer in and it immediately blue screened.&#160; Arg. Not what you really want when you have all your windows open and in demo mode.&#160; At least that was the end of m powerpoint screen.&#160; Who needs that anyhow.</p>
<p>Several people asked for the example code I showed.&#160; It’s not that well organized and it’s using a pre-release of ExtJS version 3.0. With those excuses pre-made, here is the code:</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:fb3a1972-4489-4e52-abe7-25a00bb07fdf:c118b673-0e48-459a-9dc2-c92101f4e5f1" class="wlWriterSmartContent">
<p><a href="http://peterkellner.net/FilesForWebDownload/MyExtJSPresentationatMicrosoftsOfficeinS_AA13/BayNetExtJSPresentationWebProject.zip" target="_blank">Bay.Net Presentation Visual Studio Project</a></p>
</p></div>
<p>Finally, some more pictures…</p>
<p><a href="http://peterkellner.net/FilesForWebDownload/MyExtJSPresentationatMicrosoftsOfficeinS_AA13/IThoughtTheyCameToSeeMe.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="IThoughtTheyCameToSeeMe" border="0" alt="IThoughtTheyCameToSeeMe" src="http://peterkellner.net/FilesForWebDownload/MyExtJSPresentationatMicrosoftsOfficeinS_AA13/IThoughtTheyCameToSeeMe_thumb.jpg" width="244" height="184" /></a> <a href="http://peterkellner.net/FilesForWebDownload/MyExtJSPresentationatMicrosoftsOfficeinS_AA13/KimGreenleeMSPodium.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="KimGreenleeMSPodium" border="0" alt="KimGreenleeMSPodium" src="http://peterkellner.net/FilesForWebDownload/MyExtJSPresentationatMicrosoftsOfficeinS_AA13/KimGreenleeMSPodium_thumb.jpg" width="244" height="184" /></a></p>
<p><a href="http://peterkellner.net/FilesForWebDownload/MyExtJSPresentationatMicrosoftsOfficeinS_AA13/BayNetPresentationPartOfCrowd.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="BayNetPresentationPartOfCrowd" border="0" alt="BayNetPresentationPartOfCrowd" src="http://peterkellner.net/FilesForWebDownload/MyExtJSPresentationatMicrosoftsOfficeinS_AA13/BayNetPresentationPartOfCrowd_thumb.jpg" width="244" height="184" /></a> <a href="http://peterkellner.net/FilesForWebDownload/MyExtJSPresentationatMicrosoftsOfficeinS_AA13/BrunoInSetupMode.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="BrunoInSetupMode" border="0" alt="BrunoInSetupMode" src="http://peterkellner.net/FilesForWebDownload/MyExtJSPresentationatMicrosoftsOfficeinS_AA13/BrunoInSetupMode_thumb.jpg" width="244" height="184" /></a></p>
<p>Thanks to <a href="http://www.baynetug.org/DesktopDefault.aspx">Bay.Net</a> locally lead by Kim Greenlee for sponsoring the event, Thanks to <a href="http://www.jetbrains.com/">JetBrains</a> for providing free copies of IDEA for doing Great JavaScript editing, Thanks to the authors of “<a href="http://www.amazon.com/exec/obidos/ASIN/1847195148/petkelsblo-20">Learning ExtJS</a>” for donating a couple free books, and thanks to <a href="http://extjs.com/">ExtJS</a> for giving a free developer license.</p>
]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2009/05/21/baydotnet-presentation-extjs-aspnet-membership-profile-provider/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)
Database Caching 31/36 queries in 0.022 seconds using disk: basic
Content Delivery Network via Amazon Web Services: S3: PetersBlogCDN.s3.amazonaws.com

Served from: peterkellner.net @ 2012-05-22 09:33:55 -->
