<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Sayed Ibrahim Hashimi - MSBuild, Web Deploy (MSDeploy), ASP.NET - ASP.NET MVC</title>
    <link>http://sedodream.com/</link>
    <description>MSBuild, C#, Visual Studio and more</description>
    <language>en-us</language>
    <copyright>Sayed Ibrahim Hashimi</copyright>
    <lastBuildDate>Tue, 20 Apr 2010 04:10:14 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.3.9074.18820</generator>
    <managingEditor>sayed.hashimi@gmail.com</managingEditor>
    <webMaster>sayed.hashimi@gmail.com</webMaster>
    <item>
      <trackback:ping>http://sedodream.com/Trackback.aspx?guid=47388dd7-92bb-4984-b8d9-e55568342230</trackback:ping>
      <pingback:server>http://sedodream.com/pingback.aspx</pingback:server>
      <pingback:target>http://sedodream.com/PermaLink,guid,47388dd7-92bb-4984-b8d9-e55568342230.aspx</pingback:target>
      <dc:creator>Ibrahim</dc:creator>
      <wfw:comment>http://sedodream.com/CommentView,guid,47388dd7-92bb-4984-b8d9-e55568342230.aspx</wfw:comment>
      <wfw:commentRss>http://sedodream.com/SyndicationService.asmx/GetEntryCommentsRss?guid=47388dd7-92bb-4984-b8d9-e55568342230</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">The other day I was working on a site which
required a pager, so I searched around a bit and I a <a href="http://weblogs.asp.net/gunnarpeipman/archive/2010/02/21/simple-pager-for-asp-net-mvc.aspx">pager</a>by <a href="http://weblogs.asp.net/gunnarpeipman/">Gunnar
Peipman</a> that looked promising. I found a few others but decided against them.
Some of them loaded all of the data into memory and then paged from there, and others
just flat out didn't work! In any case I had a good experience with Gunnar's. I wanted
to take what Gunnar had and create a view helper using my <a href="http://mvcviewhelpers.codeplex.com/">custom
view helpers</a>. Along the way I found myself writing some code using the <a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.tagbuilder.aspx">TagBuilder</a>class
that just didn't sit well with me. Take a look at the snippet below which. <pre class="brush: csharp;">
TagBuilder startTag = new TagBuilder("a");
startTag.Attributes.Add("href", string.Format("{0}/{1}", this.UrlPrefix, 1));
startTag.SetInnerText("&lt;&lt;");
startTag.Attributes.Add("title", "first page");
httpResponse.Write(startTag.ToString(TagRenderMode.Normal));

TagBuilder previous = new TagBuilder("a");
previous.Attributes.Add("href", string.Format("{0}/{1}", this.UrlPrefix, this.CurrentPage - 1));
previous.SetInnerText("&lt;");
previous.Attributes.Add("title", "previous page");
httpResponse.Write(previous.ToString(TagRenderMode.Normal));
</pre>
I didn't like the fact that I had to make a bunch of calls to the tag builder to build
the HTML for me, it was just uglier than what I wanted. So I decided to create a new
tag builder which places an <a href="http://en.wikipedia.org/wiki/Fluent_interface">Fluent
interface</a> on top of it (ok, maybe its just <a href="http://en.wikipedia.org/wiki/Method_chaining">method
chaining</a>). The end result was the <a href="FluentTagBuilder">FluentTagBuilder</a>class.
I couldn't extend <a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.tagbuilder.aspx">TagBuilder</a>because
I wanted to change the return types, so instead I created the class to just contain
one and to just pass the calls through to it. What I did was to declare all the same
properties and methods that the TagBuilder had, but just change the ones who returned
void to return the same object itself. So for example I created methods like. <pre class="brush: csharp;">
public FluentTagBuilder AddCssClass(string value)
{
    this.TagBuilder.AddCssClass(value);
    return this;
}

public FluentTagBuilder SetInnerHtml(string innerHtml)
{
    this.TagBuilder.InnerHtml = innerHtml;
    return this;
}
</pre>
With this I can chain different method calls together and create code which looks
better. If you've used <a href="http://jquery.com/">jQuery</a>then you are used to
this. With this in place I was able to convert the snippet above into the following. <pre class="brush: csharp;">
FluentTagBuilder startTag =
    new FluentTagBuilder("a")
    .AddAttribute("href", string.Format("{0}/{1}", this.UrlPrefix, 1))
    .SetInnerText("&lt;&lt;")
    .AddAttribute("title", "first page");

httpResponse.Write(startTag.ToString(TagRenderMode.Normal));

FluentTagBuilder previous =
    new FluentTagBuilder("a")
    .AddAttribute("href", string.Format("{0}/{1}", this.UrlPrefix, this.CurrentPage - 1))
    .SetInnerText("&lt;")
    .AddAttribute("title", "previous page");

httpResponse.Write(previous.ToString(TagRenderMode.Normal));
</pre>
To me this is a lot easier to read, and to create. If you agree you can grab the class
and include it in your projects. Links to full source files are below. 
<ol><li><a href="http://sedotech.com/Content/files/FluentTagBuilder.cs.txt">FluentTagBuilder.cs</a></li><li><a href="http://sedotech.com/Content/files/Pager.cs.txt">Pager.cs</a></li></ol>
Sayed Ibrahim Hashimi</body>
      <title>ASP.NET MVC a better TagBuilder</title>
      <guid isPermaLink="false">http://sedodream.com/PermaLink,guid,47388dd7-92bb-4984-b8d9-e55568342230.aspx</guid>
      <link>http://sedodream.com/2010/04/20/ASPNETMVCABetterTagBuilder.aspx</link>
      <pubDate>Tue, 20 Apr 2010 04:10:14 GMT</pubDate>
      <description>The other day I was working on a site which required a pager, so I searched around a bit and I a &lt;a href="http://weblogs.asp.net/gunnarpeipman/archive/2010/02/21/simple-pager-for-asp-net-mvc.aspx"&gt;pager&lt;/a&gt;by &lt;a href="http://weblogs.asp.net/gunnarpeipman/"&gt;Gunnar
Peipman&lt;/a&gt; that looked promising. I found a few others but decided against them.
Some of them loaded all of the data into memory and then paged from there, and others
just flat out didn't work! In any case I had a good experience with Gunnar's. I wanted
to take what Gunnar had and create a view helper using my &lt;a href="http://mvcviewhelpers.codeplex.com/"&gt;custom
view helpers&lt;/a&gt;. Along the way I found myself writing some code using the &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.tagbuilder.aspx"&gt;TagBuilder&lt;/a&gt;class
that just didn't sit well with me. Take a look at the snippet below which. &lt;pre class="brush: csharp;"&gt;
TagBuilder startTag = new TagBuilder(&amp;quot;a&amp;quot;);
startTag.Attributes.Add(&amp;quot;href&amp;quot;, string.Format(&amp;quot;{0}/{1}&amp;quot;, this.UrlPrefix, 1));
startTag.SetInnerText(&amp;quot;&amp;lt;&amp;lt;&amp;quot;);
startTag.Attributes.Add(&amp;quot;title&amp;quot;, &amp;quot;first page&amp;quot;);
httpResponse.Write(startTag.ToString(TagRenderMode.Normal));

TagBuilder previous = new TagBuilder(&amp;quot;a&amp;quot;);
previous.Attributes.Add(&amp;quot;href&amp;quot;, string.Format(&amp;quot;{0}/{1}&amp;quot;, this.UrlPrefix, this.CurrentPage - 1));
previous.SetInnerText(&amp;quot;&amp;lt;&amp;quot;);
previous.Attributes.Add(&amp;quot;title&amp;quot;, &amp;quot;previous page&amp;quot;);
httpResponse.Write(previous.ToString(TagRenderMode.Normal));
&lt;/pre&gt;
I didn't like the fact that I had to make a bunch of calls to the tag builder to build
the HTML for me, it was just uglier than what I wanted. So I decided to create a new
tag builder which places an &lt;a href="http://en.wikipedia.org/wiki/Fluent_interface"&gt;Fluent
interface&lt;/a&gt; on top of it (ok, maybe its just &lt;a href="http://en.wikipedia.org/wiki/Method_chaining"&gt;method
chaining&lt;/a&gt;). The end result was the &lt;a href="FluentTagBuilder"&gt;FluentTagBuilder&lt;/a&gt;class.
I couldn't extend &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.tagbuilder.aspx"&gt;TagBuilder&lt;/a&gt;because
I wanted to change the return types, so instead I created the class to just contain
one and to just pass the calls through to it. What I did was to declare all the same
properties and methods that the TagBuilder had, but just change the ones who returned
void to return the same object itself. So for example I created methods like. &lt;pre class="brush: csharp;"&gt;
public FluentTagBuilder AddCssClass(string value)
{
    this.TagBuilder.AddCssClass(value);
    return this;
}

public FluentTagBuilder SetInnerHtml(string innerHtml)
{
    this.TagBuilder.InnerHtml = innerHtml;
    return this;
}
&lt;/pre&gt;
With this I can chain different method calls together and create code which looks
better. If you've used &lt;a href="http://jquery.com/"&gt;jQuery&lt;/a&gt;then you are used to
this. With this in place I was able to convert the snippet above into the following. &lt;pre class="brush: csharp;"&gt;
FluentTagBuilder startTag =
    new FluentTagBuilder(&amp;quot;a&amp;quot;)
    .AddAttribute(&amp;quot;href&amp;quot;, string.Format(&amp;quot;{0}/{1}&amp;quot;, this.UrlPrefix, 1))
    .SetInnerText(&amp;quot;&amp;lt;&amp;lt;&amp;quot;)
    .AddAttribute(&amp;quot;title&amp;quot;, &amp;quot;first page&amp;quot;);

httpResponse.Write(startTag.ToString(TagRenderMode.Normal));

FluentTagBuilder previous =
    new FluentTagBuilder(&amp;quot;a&amp;quot;)
    .AddAttribute(&amp;quot;href&amp;quot;, string.Format(&amp;quot;{0}/{1}&amp;quot;, this.UrlPrefix, this.CurrentPage - 1))
    .SetInnerText(&amp;quot;&amp;lt;&amp;quot;)
    .AddAttribute(&amp;quot;title&amp;quot;, &amp;quot;previous page&amp;quot;);

httpResponse.Write(previous.ToString(TagRenderMode.Normal));
&lt;/pre&gt;
To me this is a lot easier to read, and to create. If you agree you can grab the class
and include it in your projects. Links to full source files are below. 
&lt;ol&gt;
&lt;li&gt;
&lt;a href="http://sedotech.com/Content/files/FluentTagBuilder.cs.txt"&gt;FluentTagBuilder.cs&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://sedotech.com/Content/files/Pager.cs.txt"&gt;Pager.cs&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

Sayed Ibrahim Hashimi</description>
      <comments>http://sedodream.com/CommentView,guid,47388dd7-92bb-4984-b8d9-e55568342230.aspx</comments>
      <category>ASP.NET MVC</category>
      <category>Fluent interface</category>
      <category>View helpers</category>
    </item>
    <item>
      <trackback:ping>http://sedodream.com/Trackback.aspx?guid=beb40727-c878-440d-bb2d-80501bb77312</trackback:ping>
      <pingback:server>http://sedodream.com/pingback.aspx</pingback:server>
      <pingback:target>http://sedodream.com/PermaLink,guid,beb40727-c878-440d-bb2d-80501bb77312.aspx</pingback:target>
      <dc:creator>Ibrahim</dc:creator>
      <wfw:comment>http://sedodream.com/CommentView,guid,beb40727-c878-440d-bb2d-80501bb77312.aspx</wfw:comment>
      <wfw:commentRss>http://sedodream.com/SyndicationService.asmx/GetEntryCommentsRss?guid=beb40727-c878-440d-bb2d-80501bb77312</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
The story around <a href="http://msdn.microsoft.com/en-us/library/cc668201%28VS.100%29.aspx">routing</a> in
ASP.NET MVC is pretty good. When a resource is requested the action that it is routed
to is determined and the parameters to the action are initialized. Counter to that
when you build a link you specify the argument values and it creates the url for you.
So if your routes happen to change your application shouldn’t be bothered by that.
One area which can be problematic for this is if you are making any ajax requests.
What I’ve done to minimize the impact of route changes to Ajax requests is to have
the script make a call to determine the correct route. In the most trivial case this
is extremely easy. You call an action, which has a known route, passing into it the
name of the action and controller. It returns to you the url for the route. This works
really good, but the problem is when your routes have parameters, how do you handle
those?
</p>
        <p>
First let’s take a look at the Javascript and then the definition of the action method
which it calls.
</p>
        <pre class="brush: js;">// wire up the event for the enter button
$("#searchText").keypress(function (event) {
    if (event.keyCode == 13) {
        // grab the text that is inside the box
        var text = $("#searchText").val();

        var routData = {
            controllerName: 'Search',
            actionName: 'Search',
            paramValues: "{ criteria: '" + text + "' }"
        };

        $.ajax({
            url: "/Home/MapRoute",
            data: routData,
            success: function (data) {
                window.location.href = data;
            },
            error: function (data) {
                alert('there was a failure on the internets');
            }
        });

    }
});</pre>
        <p>
Here I am building a Javascript object named routeData. This is declared in <a href="http://json.org/">JSON</a>.
One thing to pay attention to is the fact that the value for <em><strong>paramValues</strong></em> is
a string containing JSON. This is passed to the controller action.
</p>
        <p>
I’m using <a href="http://jquery.com/">jQuery</a> to make an Ajax request to <em>/Home/MapRoute</em>.
This maps to the method shown below.
</p>
        <pre class="brush: csharp;">public JsonResult MapRoute(string actionName, string controllerName, string paramValues)
{
    JavaScriptSerializer jss = new JavaScriptSerializer();

    Dictionary&lt;string, string&gt; parameters = jss.Deserialize&lt;Dictionary&lt;string, string&gt;&gt;(paramValues);

    RouteValueDictionary rd = new RouteValueDictionary();
    foreach (string key in parameters.Keys)
    {
        rd.Add(key, parameters[key]);
    }

    UrlHelper urlHelper = new UrlHelper(this.Request.RequestContext);
    string url = urlHelper.Action(actionName, controllerName, rd);

    return Json(url, JsonRequestBehavior.AllowGet);
}</pre>
        <p>
Here I’m using the <a href="http://msdn.microsoft.com/en-us/library/system.web.script.serialization.javascriptserializer.aspx">JavaScriptSerializer</a> to
convert the JSON string into a dictionary, with string as key and value. I use that
dictionary to create a <a href="http://msdn.microsoft.com/en-us/library/system.web.routing.routevaluedictionary.aspx">RouteValueDictionary</a> which
is passed, along with other parameters, into the <a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.urlhelper.aspx">UrlHelper</a> to
generate the url. When you return the Json result you must specify <a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.jsonrequestbehavior%28VS.100%29.aspx">JsonRequestBehavior</a>.AllowGet,
otherwise a <strong><em>500 internal service error</em></strong> will be returned.
I think this is new with ASP.NET 2.
</p>
        <p>
When the action method returns, you can use that url. The drawback to this approach
is that you will make an extra request to determine the url, but you will be sure
that those urls are correct. Also you could cache the results with <a href="http://www.asp.net/learn/mvc/tutorial-15-cs.aspx">Output
Caching</a> since the routes won’t change.
</p>
        <p>
Sayed Ibrahim Hashimi
</p>
      </body>
      <title>ASP.NET MVC Route + Ajax + jQuery</title>
      <guid isPermaLink="false">http://sedodream.com/PermaLink,guid,beb40727-c878-440d-bb2d-80501bb77312.aspx</guid>
      <link>http://sedodream.com/2010/04/02/ASPNETMVCRouteAjaxJQuery.aspx</link>
      <pubDate>Fri, 02 Apr 2010 05:24:30 GMT</pubDate>
      <description>&lt;p&gt;
The story around &lt;a href="http://msdn.microsoft.com/en-us/library/cc668201%28VS.100%29.aspx"&gt;routing&lt;/a&gt; in
ASP.NET MVC is pretty good. When a resource is requested the action that it is routed
to is determined and the parameters to the action are initialized. Counter to that
when you build a link you specify the argument values and it creates the url for you.
So if your routes happen to change your application shouldn’t be bothered by that.
One area which can be problematic for this is if you are making any ajax requests.
What I’ve done to minimize the impact of route changes to Ajax requests is to have
the script make a call to determine the correct route. In the most trivial case this
is extremely easy. You call an action, which has a known route, passing into it the
name of the action and controller. It returns to you the url for the route. This works
really good, but the problem is when your routes have parameters, how do you handle
those?
&lt;/p&gt;
&lt;p&gt;
First let’s take a look at the Javascript and then the definition of the action method
which it calls.
&lt;/p&gt;
&lt;pre class="brush: js;"&gt;// wire up the event for the enter button
$(&amp;quot;#searchText&amp;quot;).keypress(function (event) {
    if (event.keyCode == 13) {
        // grab the text that is inside the box
        var text = $(&amp;quot;#searchText&amp;quot;).val();

        var routData = {
            controllerName: 'Search',
            actionName: 'Search',
            paramValues: &amp;quot;{ criteria: '&amp;quot; + text + &amp;quot;' }&amp;quot;
        };

        $.ajax({
            url: &amp;quot;/Home/MapRoute&amp;quot;,
            data: routData,
            success: function (data) {
                window.location.href = data;
            },
            error: function (data) {
                alert('there was a failure on the internets');
            }
        });

    }
});&lt;/pre&gt;
&lt;p&gt;
Here I am building a Javascript object named routeData. This is declared in &lt;a href="http://json.org/"&gt;JSON&lt;/a&gt;.
One thing to pay attention to is the fact that the value for &lt;em&gt;&lt;strong&gt;paramValues&lt;/strong&gt;&lt;/em&gt; is
a string containing JSON. This is passed to the controller action.
&lt;/p&gt;
&lt;p&gt;
I’m using &lt;a href="http://jquery.com/"&gt;jQuery&lt;/a&gt; to make an Ajax request to &lt;em&gt;/Home/MapRoute&lt;/em&gt;.
This maps to the method shown below.
&lt;/p&gt;
&lt;pre class="brush: csharp;"&gt;public JsonResult MapRoute(string actionName, string controllerName, string paramValues)
{
    JavaScriptSerializer jss = new JavaScriptSerializer();

    Dictionary&amp;lt;string, string&amp;gt; parameters = jss.Deserialize&amp;lt;Dictionary&amp;lt;string, string&amp;gt;&amp;gt;(paramValues);

    RouteValueDictionary rd = new RouteValueDictionary();
    foreach (string key in parameters.Keys)
    {
        rd.Add(key, parameters[key]);
    }

    UrlHelper urlHelper = new UrlHelper(this.Request.RequestContext);
    string url = urlHelper.Action(actionName, controllerName, rd);

    return Json(url, JsonRequestBehavior.AllowGet);
}&lt;/pre&gt;
&lt;p&gt;
Here I’m using the &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.script.serialization.javascriptserializer.aspx"&gt;JavaScriptSerializer&lt;/a&gt; to
convert the JSON string into a dictionary, with string as key and value. I use that
dictionary to create a &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.routing.routevaluedictionary.aspx"&gt;RouteValueDictionary&lt;/a&gt; which
is passed, along with other parameters, into the &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.urlhelper.aspx"&gt;UrlHelper&lt;/a&gt; to
generate the url. When you return the Json result you must specify &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.jsonrequestbehavior%28VS.100%29.aspx"&gt;JsonRequestBehavior&lt;/a&gt;.AllowGet,
otherwise a &lt;strong&gt;&lt;em&gt;500 internal service error&lt;/em&gt;&lt;/strong&gt; will be returned.
I think this is new with ASP.NET 2.
&lt;/p&gt;
&lt;p&gt;
When the action method returns, you can use that url. The drawback to this approach
is that you will make an extra request to determine the url, but you will be sure
that those urls are correct. Also you could cache the results with &lt;a href="http://www.asp.net/learn/mvc/tutorial-15-cs.aspx"&gt;Output
Caching&lt;/a&gt; since the routes won’t change.
&lt;/p&gt;
&lt;p&gt;
Sayed Ibrahim Hashimi
&lt;/p&gt;</description>
      <comments>http://sedodream.com/CommentView,guid,beb40727-c878-440d-bb2d-80501bb77312.aspx</comments>
      <category>ASP.NET MVC</category>
      <category>Javascript</category>
      <category>jQuery</category>
      <category>routing</category>
    </item>
    <item>
      <trackback:ping>http://sedodream.com/Trackback.aspx?guid=b3a497b2-916f-4190-a13f-8120a06b3eea</trackback:ping>
      <pingback:server>http://sedodream.com/pingback.aspx</pingback:server>
      <pingback:target>http://sedodream.com/PermaLink,guid,b3a497b2-916f-4190-a13f-8120a06b3eea.aspx</pingback:target>
      <dc:creator>Ibrahim</dc:creator>
      <wfw:comment>http://sedodream.com/CommentView,guid,b3a497b2-916f-4190-a13f-8120a06b3eea.aspx</wfw:comment>
      <wfw:commentRss>http://sedodream.com/SyndicationService.asmx/GetEntryCommentsRss?guid=b3a497b2-916f-4190-a13f-8120a06b3eea</wfw:commentRss>
      <title>Unit testing and ASP.NET MVC Comments</title>
      <guid isPermaLink="false">http://sedodream.com/PermaLink,guid,b3a497b2-916f-4190-a13f-8120a06b3eea.aspx</guid>
      <link>http://sedodream.com/2009/12/09/UnitTestingAndASPNETMVCComments.aspx</link>
      <pubDate>Wed, 09 Dec 2009 06:37:17 GMT</pubDate>
      <description>&lt;p&gt;
&lt;a href="http://en.wikipedia.org/wiki/Unit_testing"&gt;Unit testing&lt;/a&gt; has been around
for quite a while and a lot of developers have created their own unit tests. Even
being a simple concept and having been around for some time I still think that unit
tests are misunderstood, poorly written and don't follow best practices by a majority
of developers. I'm not a unit testing expert but there are some guidelines that I
try to follow when I create unit tests some of those are listed below (&lt;em&gt;in no particular
order&lt;/em&gt;). 
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Make them small 
&lt;li&gt;
Make them self contained 
&lt;li&gt;
Make the names describe what the test case tests (&lt;em&gt;at the price of a long name&lt;/em&gt;) 
&lt;li&gt;
Follow the arrange/act/assert pattern, i.e. don't do something like arrange/act/assert/act/assert,
etc. 
&lt;li&gt;
Don't make database calls! 
&lt;li&gt;
Use mocks when necessary to ensure that you test the correct piece of code 
&lt;li&gt;
Consider making methods/properties to be internal instead of private. You can use
the &lt;a href="http://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.internalsvisibletoattribute.aspx"&gt;InternalsVisibleTo&lt;/a&gt; attribute
to allow testing of internal items. 
&lt;li&gt;
Don't have app.config for your unit tests. Unit test should "arrange" the configuration
in code. 
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
If you make your unit tests too long and to test more than one item then they will
become a pain to maintain, which leads to them being ignored and eventually to a complete
breakdown to your testing effort in general. 
&lt;/p&gt;
&lt;p&gt;
I have recently been thinking more about how unit tests are being used throughout
software development. Also I've been reading &lt;a href="http://www.amazon.com/gp/product/1933988622?ie=UTF8&amp;amp;tag=sedodream-20&amp;amp;linkCode=xm2&amp;amp;camp=1789&amp;amp;creativeASIN=1933988622"&gt;ASP.NET
MVC in Action&lt;/a&gt; which coincidently puts a lot of emphasis on unit testing. I found
a few quotes in Chapter 3 of that book, which covers Controllers, and thought that
I would share them here because I agree with statements whole heartedly. Text in &lt;em&gt;italics&lt;/em&gt; are
my own comments. 
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Unit tests run fast because they do not call out of process (i.e. no database calls,
no web service calls, etc)&lt;em&gt; &lt;/em&gt; 
&lt;li&gt;
It is very difficult to test poorly designed code. &lt;em&gt;(Do you ever have a set of
code and think to yourself, "I can't write unit tests for this, it's impossible",
at this point you should consider to refactor it because this is a red flag for bad
code!) &lt;/em&gt; 
&lt;li&gt;
&lt;em&gt;(While discussing mocking)&lt;/em&gt;… unit testing becomes easy and soon becomes a
repetitive pattern of faking dependencies and writing assertions. Over time, if you
employ this technique, you will see a marked improvement in the quality of your code. 
&lt;li&gt;
A good controller unit test runs fast. We are talking 2000 unit tests all running
within 10 seconds. 
&lt;li&gt;
It's nearly impossible to test-drive code that ends up with a bad design. &lt;em&gt;(Once
again bad code is hard to test)&lt;/em&gt; 
&lt;li&gt;
Pay attention to pain. If your tests become painful to maintain, there's something
wrong. 
&lt;li&gt;
Correctly managed design and tests enable sustained speed of development whereas poor
testing techniques cause development to slow down to a point where testing is abandoned. 
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Some of the key take aways: use mocks, and testing should be helpful to your development
process not a hindrance. 
&lt;/p&gt;
&lt;p&gt;
Don't write unit tests just to write them or just to get the necessary coverage. Make
sure that you write the test cases with a specific intent and that they are written
well so that you will continue to maintain and execute them as a part of your &lt;a href="http://www.martinfowler.com/articles/continuousIntegration.html"&gt;CI&lt;/a&gt; build
process. 
&lt;/p&gt;
&lt;p&gt;
Here are some unit tests that I've recently written that I'd like to use to show some
concrete cases. 
&lt;/p&gt;
&lt;div style="BORDER-BOTTOM: windowtext 1pt solid; BORDER-LEFT: windowtext 1pt solid; PADDING-BOTTOM: 1pt; PADDING-LEFT: 4pt; PADDING-RIGHT: 4pt; BACKGROUND: #d9d9d9; BORDER-TOP: windowtext 1pt solid; BORDER-RIGHT: windowtext 1pt solid; PADDING-TOP: 1pt; mso-element: para-border-div; mso-border-alt: solid windowtext .5pt; mso-background-themecolor: background1; mso-background-themeshade: 217"&gt;
&lt;p style="MARGIN: 10pt 0in 0pt" class=Code-BlockCxSpFirst&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;[Test]&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;public void TestGetConfigValue_ValueExistsRequiredTrue()&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;{&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000&gt;&lt;font face=Consolas&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;string
key = "83F216CD-1B3E-4fc1-9DA5-4A7D506AF7E8";&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000&gt;&lt;font face=Consolas&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;string
expectedValue = "C2D4E7CA-BE6B-4976-BFA9-50F5223C603A";&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000&gt;&lt;font face=Consolas&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;ConfigurationManager.AppSettings[key]
= expectedValue;&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:p&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000&gt;&lt;font face=Consolas&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;string
actualValue = ServiceConfigHelper.Instance.GetConfigValue(key, true);&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000&gt;&lt;font face=Consolas&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Assert.AreEqual(expectedValue,
actualValue);&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;}&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;o:p&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;[Test]&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;public void TestGetConfigValue_ValueExistsRequiredFalse()&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;{&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000&gt;&lt;font face=Consolas&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;string
key = "0601AB1F-C78C-4c72-8648-B140D50BDDEC";&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000&gt;&lt;font face=Consolas&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;string
expectedValue = "92DCADBC-9618-49f3-A412-5C90A945903D";&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000&gt;&lt;font face=Consolas&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;ConfigurationManager.AppSettings[key]
= expectedValue;&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;o:p&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000&gt;&lt;font face=Consolas&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;string
actualValue = ServiceConfigHelper.Instance.GetConfigValue(key, false);&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000&gt;&lt;font face=Consolas&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Assert.AreEqual(expectedValue,
actualValue);&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;}&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;o:p&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;[Test]&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;public void TestGetConfigValue_ValueDoesntExistRequiredFalse()&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;{&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000&gt;&lt;font face=Consolas&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;string
key = "2D4B5C66-BA37-4ab8-9B51-3F17CF348E6D";&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;o:p&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000&gt;&lt;font face=Consolas&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;string
actualValue = ServiceConfigHelper.Instance.GetConfigValue(key, false);&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000&gt;&lt;font face=Consolas&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Assert.IsNull(actualValue);&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;}&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;o:p&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;[ExpectedException(typeof(ConfigurationErrorsException))]&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;[Test]&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;public void TestGetConfigValue_ValueDoesntExistRequiredTrue()&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;{&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000&gt;&lt;font face=Consolas&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;string
key = "0511216E-3AA6-4b80-B215-E980A459466D";&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;o:p&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000&gt;&lt;font face=Consolas&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;//
ConfigurationErrorsException here&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000&gt;&lt;font face=Consolas&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;string
actualValue = ServiceConfigHelper.Instance.GetConfigValue(key, true);&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;}&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;o:p&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;[ExpectedException(typeof(ArgumentNullException))]&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;[Test]&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;public void TestGetConfigValue_KeyIsNull_RequiredFalse()&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;{&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000&gt;&lt;font face=Consolas&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;string
actualValue = ServiceConfigHelper.Instance.GetConfigValue(null, false);&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;}&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;o:p&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;[ExpectedException(typeof(ArgumentNullException))]&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;[Test]&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;public void TestGetConfigValue_KeyIsNull_RequiredTrue()&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;{&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000&gt;&lt;font face=Consolas&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;string
actualValue = ServiceConfigHelper.Instance.GetConfigValue(null, true);&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;}&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;o:p&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;// Setup method here&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;[SetUp]&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;public void Reset()&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;{&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000&gt;&lt;font face=Consolas&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;ServiceConfigHelper.Instance.Reset();&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000&gt;&lt;font face=Consolas&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;if
(ConfigurationManager.AppSettings.HasKeys())&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000&gt;&lt;font face=Consolas&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000&gt;&lt;font face=Consolas&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;List&amp;lt;string&amp;gt;
allKeys = new List&amp;lt;string&amp;gt;();&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000&gt;&lt;font face=Consolas&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;foreach
(string key in ConfigurationManager.AppSettings.Keys)&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000&gt;&lt;font face=Consolas&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000&gt;&lt;font face=Consolas&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;allKeys.Add(key);&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000&gt;&lt;font face=Consolas&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;o:p&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;&amp;nbsp;&lt;/font&gt;&lt;/strong&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000&gt;&lt;font face=Consolas&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;foreach
(string key in allKeys)&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000&gt;&lt;font face=Consolas&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000&gt;&lt;font face=Consolas&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;ConfigurationManager.AppSettings[key]
= string.Empty;&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000&gt;&lt;font face=Consolas&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class=Code-BlockCxSpMiddle&gt;
&lt;strong&gt;&lt;font color=#008000&gt;&lt;font face=Consolas&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 10pt" class=Code-BlockCxSpLast&gt;
&lt;strong&gt;&lt;font color=#008000 face=Consolas&gt;}&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;
Notice that each of these has a very descriptive name, if you saw the name of the
test in the list of failed test cases you immediately know what to work on; you don't
even have to look at the test. Notice that all of the tests are pretty small, and
that each test case tests a very specific piece of functionality. Also you might have
noticed that I use Guids in test cases I like to do this just to make sure that I
have random data and that test cases don't conflict with each other. 
&lt;/p&gt;
&lt;p&gt;
Also I'd like to note that in the &lt;a href="http://www.amazon.com/gp/product/1933988622?ie=UTF8&amp;amp;tag=sedodream-20&amp;amp;linkCode=xm2&amp;amp;camp=1789&amp;amp;creativeASIN=1933988622"&gt;book&lt;/a&gt; the
guys recommend reading &lt;a href="http://www.amazon.com/gp/product/0131177052?ie=UTF8&amp;amp;tag=sedodream-20&amp;amp;linkCode=xm2&amp;amp;camp=1789&amp;amp;creativeASIN=0131177052"&gt;Working
Effectively with Legacy Code&lt;/a&gt; for good coverage of unit testing, I haven't read
it but I might grab a copy. 
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
Sayed Ibrahim Hashimi 
&lt;/p&gt;</description>
      <comments>http://sedodream.com/CommentView,guid,b3a497b2-916f-4190-a13f-8120a06b3eea.aspx</comments>
      <category>ASP.NET MVC</category>
      <category>unit testing</category>
    </item>
    <item>
      <trackback:ping>http://sedodream.com/Trackback.aspx?guid=b36e82bc-aa9b-4da9-8355-5037a615fc64</trackback:ping>
      <pingback:server>http://sedodream.com/pingback.aspx</pingback:server>
      <pingback:target>http://sedodream.com/PermaLink,guid,b36e82bc-aa9b-4da9-8355-5037a615fc64.aspx</pingback:target>
      <dc:creator>Ibrahim</dc:creator>
      <wfw:comment>http://sedodream.com/CommentView,guid,b36e82bc-aa9b-4da9-8355-5037a615fc64.aspx</wfw:comment>
      <wfw:commentRss>http://sedodream.com/SyndicationService.asmx/GetEntryCommentsRss?guid=b36e82bc-aa9b-4da9-8355-5037a615fc64</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
A while back I had a session on MSDeploy where I demonstrated deploying an ASP.NET
MVC Sudoku solver that I wrote a while back. A few people asked me to publish it,
so I did you can get it at <a href="http://sudokumvc.codeplex.com/">http://sudokumvc.codeplex.com/</a></p>
        <p>
        </p>
        <p>
Sayed Ibrahim Hashimi
</p>
      </body>
      <title>ASP.NET MVC Sudoku Solver</title>
      <guid isPermaLink="false">http://sedodream.com/PermaLink,guid,b36e82bc-aa9b-4da9-8355-5037a615fc64.aspx</guid>
      <link>http://sedodream.com/2009/11/07/ASPNETMVCSudokuSolver.aspx</link>
      <pubDate>Sat, 07 Nov 2009 09:51:27 GMT</pubDate>
      <description>&lt;p&gt;
A while back I had a session on MSDeploy where I demonstrated deploying an ASP.NET
MVC Sudoku solver that I wrote a while back. A few people asked me to publish it,
so I did you can get it at &lt;a href="http://sudokumvc.codeplex.com/"&gt;http://sudokumvc.codeplex.com/&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
Sayed Ibrahim Hashimi
&lt;/p&gt;</description>
      <comments>http://sedodream.com/CommentView,guid,b36e82bc-aa9b-4da9-8355-5037a615fc64.aspx</comments>
      <category>ASP.NET MVC</category>
      <category>Codeplex</category>
    </item>
    <item>
      <trackback:ping>http://sedodream.com/Trackback.aspx?guid=937da028-8966-4431-aad9-80a211248169</trackback:ping>
      <pingback:server>http://sedodream.com/pingback.aspx</pingback:server>
      <pingback:target>http://sedodream.com/PermaLink,guid,937da028-8966-4431-aad9-80a211248169.aspx</pingback:target>
      <dc:creator>Ibrahim</dc:creator>
      <wfw:comment>http://sedodream.com/CommentView,guid,937da028-8966-4431-aad9-80a211248169.aspx</wfw:comment>
      <wfw:commentRss>http://sedodream.com/SyndicationService.asmx/GetEntryCommentsRss?guid=937da028-8966-4431-aad9-80a211248169</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Are you using <a href="http://www.asp.net/mvc/">ASP.NET MVC</a>? If so you may be
interested in an article that I've just made available on <a href="http://www.codeplex.com/">Codeplex</a> published
to <a href="http://mvcviewhelpers.codeplex.com/">ASP.NET MVC Custom View Helpers</a>.
View helpers are usages of extension methods to insert markup into your pages. For
example <span style="font-family:Courier New; font-size:10pt"><span style="background-color:yellow">&lt;%</span><span style="color:blue">=</span> Html.TextBox(<span style="color:#a31515">"username"</span>) <span style="background-color:yellow">%&gt;</span></span>and <span style="font-family:Courier New; font-size:10pt"><span style="background-color:yellow">&lt;%</span><span style="color:blue">=</span> Html.ValidationMessage(<span style="color:#a31515">"username"</span>) <span style="background-color:yellow">%&gt;</span></span> are
both using view helpers. These are really just extension methods on the <a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.htmlhelper.aspx">HtmlHelper</a> class.
There are a few different ways that you can create your own custom view helpers. I
examine the different approaches, discuss the current implementation of the view helpers
shipped with ASP.NET MVC itself, and I provide some helper classes for you to create
your own custom view helpers. 
<br /><br /><a href="http://mvcviewhelpers.codeplex.com/">ASP.NET MVC Custom View Helpers</a></p>
        <p>
Sayed Ibrahim Hashimi<span style="font-family:Courier New; font-size:10pt"></span></p>
        <p>
        </p>
        <p>
          <span style="font-family:Courier New; font-size:10pt">
          </span>
        </p>
      </body>
      <title>ASP.NET MVC View Helpers</title>
      <guid isPermaLink="false">http://sedodream.com/PermaLink,guid,937da028-8966-4431-aad9-80a211248169.aspx</guid>
      <link>http://sedodream.com/2009/11/07/ASPNETMVCViewHelpers.aspx</link>
      <pubDate>Sat, 07 Nov 2009 08:55:15 GMT</pubDate>
      <description>&lt;p&gt;
Are you using &lt;a href="http://www.asp.net/mvc/"&gt;ASP.NET MVC&lt;/a&gt;? If so you may be
interested in an article that I've just made available on &lt;a href="http://www.codeplex.com/"&gt;Codeplex&lt;/a&gt; published
to &lt;a href="http://mvcviewhelpers.codeplex.com/"&gt;ASP.NET MVC Custom View Helpers&lt;/a&gt;.
View helpers are usages of extension methods to insert markup into your pages. For
example &lt;span style="font-family:Courier New; font-size:10pt"&gt;&lt;span style="background-color:yellow"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt; Html.TextBox(&lt;span style="color:#a31515"&gt;"username"&lt;/span&gt;) &lt;span style="background-color:yellow"&gt;%&amp;gt;&lt;/span&gt; &lt;/span&gt;and &lt;span style="font-family:Courier New; font-size:10pt"&gt;&lt;span style="background-color:yellow"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt; Html.ValidationMessage(&lt;span style="color:#a31515"&gt;"username"&lt;/span&gt;) &lt;span style="background-color:yellow"&gt;%&amp;gt;&lt;/span&gt;&lt;/span&gt; are
both using view helpers. These are really just extension methods on the &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.htmlhelper.aspx"&gt;HtmlHelper&lt;/a&gt; class.
There are a few different ways that you can create your own custom view helpers. I
examine the different approaches, discuss the current implementation of the view helpers
shipped with ASP.NET MVC itself, and I provide some helper classes for you to create
your own custom view helpers. 
&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://mvcviewhelpers.codeplex.com/"&gt;ASP.NET MVC Custom View Helpers&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
Sayed Ibrahim Hashimi&lt;span style="font-family:Courier New; font-size:10pt"&gt; &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="font-family:Courier New; font-size:10pt"&gt; &lt;/span&gt; 
&lt;/p&gt;</description>
      <comments>http://sedodream.com/CommentView,guid,937da028-8966-4431-aad9-80a211248169.aspx</comments>
      <category>ASP.NET MVC</category>
      <category>Codeplex</category>
      <category>Writing</category>
    </item>
    <item>
      <trackback:ping>http://sedodream.com/Trackback.aspx?guid=558135c9-c6c7-4cff-89f7-c8ec550cbd4c</trackback:ping>
      <pingback:server>http://sedodream.com/pingback.aspx</pingback:server>
      <pingback:target>http://sedodream.com/PermaLink,guid,558135c9-c6c7-4cff-89f7-c8ec550cbd4c.aspx</pingback:target>
      <dc:creator>Ibrahim</dc:creator>
      <wfw:comment>http://sedodream.com/CommentView,guid,558135c9-c6c7-4cff-89f7-c8ec550cbd4c.aspx</wfw:comment>
      <wfw:commentRss>http://sedodream.com/SyndicationService.asmx/GetEntryCommentsRss?guid=558135c9-c6c7-4cff-89f7-c8ec550cbd4c</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
If you are using ASP.NET MVC you might have noticed that you will not be alerted of
build errors that exist in your views until you navigate to those pages. When you
do so you'll get a runtime error <span style="font-family:Wingdings">L</span> Thankfully
there is a very easy way to change this. All you have to do is open the project file
and change the value for the <strong>MvcBuildViews</strong> property to true. To do
this, follow these steps. 
</p>
        <ol>
          <li>
Right-click on the MVC project and select 'Unload Project' 
</li>
          <li>
Right-click on the unloaded MVC project and select 'Edit …'. This will open up the
project file itself, which of course is an <a href="http://msdn.microsoft.com/en-us/library/0k6kkbsd.aspx">MSBuild</a> file. 
</li>
          <li>
Look for the MvcBuildView property and set its value to true. It should be <span style="font-family:Courier New; font-size:10pt"><span style="color:blue">&lt;</span><span style="color:#a31515">MvcBuildViews</span><span style="color:blue">&gt;</span>true<span style="color:blue">&lt;/</span><span style="color:#a31515">MvcBuildViews</span><span style="color:blue">&gt;</span></span></li>
          <li>
Save the project file, right-click on the MVC project again and select 'Reload project' 
</li>
        </ol>
        <p>
After this if you introduce any build errors into the views then you will be notified
when the project is built. 
</p>
        <p>
Sayed Ibrahim Hashimi
</p>
      </body>
      <title>ASP.NET MVC: Build Views</title>
      <guid isPermaLink="false">http://sedodream.com/PermaLink,guid,558135c9-c6c7-4cff-89f7-c8ec550cbd4c.aspx</guid>
      <link>http://sedodream.com/2009/09/14/ASPNETMVCBuildViews.aspx</link>
      <pubDate>Mon, 14 Sep 2009 04:37:16 GMT</pubDate>
      <description>&lt;p&gt;
If you are using ASP.NET MVC you might have noticed that you will not be alerted of
build errors that exist in your views until you navigate to those pages. When you
do so you'll get a runtime error &lt;span style="font-family:Wingdings"&gt;L&lt;/span&gt; Thankfully
there is a very easy way to change this. All you have to do is open the project file
and change the value for the &lt;strong&gt;MvcBuildViews&lt;/strong&gt; property to true. To do
this, follow these steps. 
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Right-click on the MVC project and select 'Unload Project' 
&lt;/li&gt;
&lt;li&gt;
Right-click on the unloaded MVC project and select 'Edit …'. This will open up the
project file itself, which of course is an &lt;a href="http://msdn.microsoft.com/en-us/library/0k6kkbsd.aspx"&gt;MSBuild&lt;/a&gt; file. 
&lt;/li&gt;
&lt;li&gt;
Look for the MvcBuildView property and set its value to true. It should be &lt;span style="font-family:Courier New; font-size:10pt"&gt;&lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;MvcBuildViews&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;true&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;MvcBuildViews&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt; 
&lt;/li&gt;
&lt;li&gt;
Save the project file, right-click on the MVC project again and select 'Reload project' 
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
After this if you introduce any build errors into the views then you will be notified
when the project is built. 
&lt;/p&gt;
&lt;p&gt;
Sayed Ibrahim Hashimi
&lt;/p&gt;</description>
      <comments>http://sedodream.com/CommentView,guid,558135c9-c6c7-4cff-89f7-c8ec550cbd4c.aspx</comments>
      <category>ASP.NET MVC</category>
      <category>msbuild</category>
    </item>
    <item>
      <trackback:ping>http://sedodream.com/Trackback.aspx?guid=6052c665-ae2c-48b1-8cda-f94272698a97</trackback:ping>
      <pingback:server>http://sedodream.com/pingback.aspx</pingback:server>
      <pingback:target>http://sedodream.com/PermaLink,guid,6052c665-ae2c-48b1-8cda-f94272698a97.aspx</pingback:target>
      <dc:creator>Ibrahim</dc:creator>
      <wfw:comment>http://sedodream.com/CommentView,guid,6052c665-ae2c-48b1-8cda-f94272698a97.aspx</wfw:comment>
      <wfw:commentRss>http://sedodream.com/SyndicationService.asmx/GetEntryCommentsRss?guid=6052c665-ae2c-48b1-8cda-f94272698a97</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
This weekend I will be speaking at the <a href="http://www.tallycodecamp.org/2009/">Tallahassee
Code Camp</a> on Saturday September 5, 2009. I will be presenting two sessions which
are: 
</p>
        <h2>ASP.NET Custom View Helpers 
</h2>
        <blockquote>
          <p>
If you have been using ASP.NET MVC then you certainly have been using some of the
built in<br />
view helper methods that are available, you know those expressions like<span style="color: green; font-family: Consolas;"><br />
Html.TextBox("textBoxName")</span> and <span style="color: green; font-family: Consolas;">Html.ValidationMessage("Required")</span>.<br />
View helpers are nothing more than extension methods which create HTML that is injected
into<br />
your views based on the method and its parameters. Creating your own view helpers
is very<br />
simple and can be extremely beneficial. By writing your own custom view helpers you
will<br />
benefit in at least the following ways 
</p>
        </blockquote>
        <blockquote>
          <blockquote>
            <ul>
              <li>
Simplifies Your Views 
</li>
              <li>
Easies Rehydrating HTML Elements with ModelState Values 
</li>
              <li>
Standardizes the Creation of Common HTML <em>Components</em></li>
              <li>
Helps you Implement the DRY (Don't Repeat Yourself) Principal 
</li>
            </ul>
          </blockquote>
        </blockquote>
        <blockquote>
          <p>
We will take an in depth look at how you can easily and effectively create your own
view helpers. We will also discuss how the default view helpers were created and the
benefits that they provide. 
</p>
        </blockquote>
        <h2>Utilizing Web Deployment Projects 
</h2>
        <p>
          <span style="font-family: Times New Roman; font-size: 12pt;">In this session we will
take a look at how Web Deployment Projects can be used to assist in the deployment
of web sites and web applications; including ASP.NET Web Applications and ASP.NET
MVC Web Applications. We will give an overview of what Web Deployment Projects are
and the functionality that is available out of the box. A Web Deployment Project is
a wrapper for the aspnet_compiler.exe tool in the form of an MSBuild project and adds
value to using the tool itself. Because they are MSBuild files we are able to customize
and extend the process. We will discuss how we can customize the process to perform
common steps such as </span>
        </p>
        <ol style="margin-left: 108pt;">
          <li>
            <span style="font-family: Times New Roman; font-size: 12pt;">Creating Virtual Directories </span>
          </li>
          <li>
            <span style="font-family: Times New Roman; font-size: 12pt;">Updating values in the
web.config file </span>
          </li>
          <li>
            <span style="font-family: Times New Roman; font-size: 12pt;">Encrypting the web.config
file </span>
          </li>
          <li>
            <span style="font-family: Times New Roman; font-size: 12pt;">Minimizing JavaScript
files </span>
          </li>
          <li>
            <span style="font-family: Times New Roman; font-size: 12pt;">Versioning the Assemblies </span>
          </li>
        </ol>
        <p>
 
</p>
        <p>
If you are in the area and interested in these topics make sure to drop in! 
</p>
        <p>
Sayed Ibrahim Hashimi
</p>
      </body>
      <title>Speaking at Tallahassee Code Camp</title>
      <guid isPermaLink="false">http://sedodream.com/PermaLink,guid,6052c665-ae2c-48b1-8cda-f94272698a97.aspx</guid>
      <link>http://sedodream.com/2009/09/04/SpeakingAtTallahasseeCodeCamp.aspx</link>
      <pubDate>Fri, 04 Sep 2009 04:40:20 GMT</pubDate>
      <description>&lt;p&gt;
This weekend I will be speaking at the &lt;a href="http://www.tallycodecamp.org/2009/"&gt;Tallahassee
Code Camp&lt;/a&gt; on Saturday September 5, 2009. I will be presenting two sessions which
are: 
&lt;/p&gt;
&lt;h2&gt;ASP.NET Custom View Helpers 
&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;
If you have been using ASP.NET MVC then you certainly have been using some of the
built in&lt;br&gt;
view helper methods that are available, you know those expressions like&lt;span style="color: green; font-family: Consolas;"&gt;
&lt;br&gt;
Html.TextBox("textBoxName")&lt;/span&gt; and &lt;span style="color: green; font-family: Consolas;"&gt;Html.ValidationMessage("Required")&lt;/span&gt;.&lt;br&gt;
View helpers are nothing more than extension methods which create HTML that is injected
into&lt;br&gt;
your views based on the method and its parameters. Creating your own view helpers
is very&lt;br&gt;
simple and can be extremely beneficial. By writing your own custom view helpers you
will&lt;br&gt;
benefit in at least the following ways 
&lt;/p&gt;
&lt;/blockquote&gt;&lt;blockquote&gt;&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;
Simplifies Your Views 
&lt;/li&gt;
&lt;li&gt;
Easies Rehydrating HTML Elements with ModelState Values 
&lt;/li&gt;
&lt;li&gt;
Standardizes the Creation of Common HTML &lt;em&gt;Components&lt;/em&gt; 
&lt;/li&gt;
&lt;li&gt;
Helps you Implement the DRY (Don't Repeat Yourself) Principal 
&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;
&lt;p&gt;
We will take an in depth look at how you can easily and effectively create your own
view helpers. We will also discuss how the default view helpers were created and the
benefits that they provide. 
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;Utilizing Web Deployment Projects 
&lt;/h2&gt;
&lt;p&gt;
&lt;span style="font-family: Times New Roman; font-size: 12pt;"&gt;In this session we will
take a look at how Web Deployment Projects can be used to assist in the deployment
of web sites and web applications; including ASP.NET Web Applications and ASP.NET
MVC Web Applications. We will give an overview of what Web Deployment Projects are
and the functionality that is available out of the box. A Web Deployment Project is
a wrapper for the aspnet_compiler.exe tool in the form of an MSBuild project and adds
value to using the tool itself. Because they are MSBuild files we are able to customize
and extend the process. We will discuss how we can customize the process to perform
common steps such as &lt;/span&gt;
&lt;/p&gt;
&lt;ol style="margin-left: 108pt;"&gt;
&lt;li&gt;
&lt;span style="font-family: Times New Roman; font-size: 12pt;"&gt;Creating Virtual Directories &lt;/span&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;span style="font-family: Times New Roman; font-size: 12pt;"&gt;Updating values in the
web.config file &lt;/span&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;span style="font-family: Times New Roman; font-size: 12pt;"&gt;Encrypting the web.config
file &lt;/span&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;span style="font-family: Times New Roman; font-size: 12pt;"&gt;Minimizing JavaScript
files &lt;/span&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;span style="font-family: Times New Roman; font-size: 12pt;"&gt;Versioning the Assemblies &lt;/span&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
If you are in the area and interested in these topics make sure to drop in! 
&lt;/p&gt;
&lt;p&gt;
Sayed Ibrahim Hashimi
&lt;/p&gt;</description>
      <comments>http://sedodream.com/CommentView,guid,6052c665-ae2c-48b1-8cda-f94272698a97.aspx</comments>
      <category>ASP.NET MVC</category>
      <category>msbuild</category>
      <category>speaking</category>
      <category>Web Deployment Projects</category>
    </item>
    <item>
      <trackback:ping>http://sedodream.com/Trackback.aspx?guid=438a2a53-c1c4-4ae1-9b04-6e3cab056022</trackback:ping>
      <pingback:server>http://sedodream.com/pingback.aspx</pingback:server>
      <pingback:target>http://sedodream.com/PermaLink,guid,438a2a53-c1c4-4ae1-9b04-6e3cab056022.aspx</pingback:target>
      <dc:creator>Ibrahim</dc:creator>
      <wfw:comment>http://sedodream.com/CommentView,guid,438a2a53-c1c4-4ae1-9b04-6e3cab056022.aspx</wfw:comment>
      <wfw:commentRss>http://sedodream.com/SyndicationService.asmx/GetEntryCommentsRss?guid=438a2a53-c1c4-4ae1-9b04-6e3cab056022</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
This coming Wednesday I will be at the <a href="http://jaxdug.com/">Jacksonville Developer
User Group</a>. The topic title is "<em>Leveraging Web Deployment Projects</em>".
I am still thinking about a new title, I'm not extremely happy about that one. Here
is the description about the talk. 
</p>
        <blockquote>
          <p>
In this session we will take a look at how Web Deployment Projects can be used to
assist in the deployment of web sites and web applications; including ASP.NET Web
Applications and ASP.NET MVC Web Applications. We will give an overview of what Web
Deployment Projects are and the functionality that is available out of the box. A
Web Deployment Project is a wrapper for the aspnet_compiler.exe tool in the form of
an MSBuild project and adds value to using the tool itself. Because they are MSBuild
files we are able to customize and extend the process. We will discuss how we can
customize the process to perform common steps such as 
</p>
          <blockquote>
            <ol>
              <li>
Creating Virtual Directories 
</li>
              <li>
Updating values in the web.config file 
</li>
              <li>
Encrypting the web.config file 
</li>
              <li>
Minimizing JavaScript files 
</li>
              <li>
Versioning the Assemblies 
</li>
            </ol>
          </blockquote>
        </blockquote>
        <p>
In this session we will not be covering MSBuild itself, so I will not go into too
much detail about MSBuild specifics. More to be discussed is how you can take advantage
of <a href="http://www.microsoft.com/downloads/details.aspx?familyId=0AA30AE8-C73B-4BDD-BB1B-FE697256C459&amp;displaylang=en">Web
Deployment Projects</a> and how that build process can be extended and customized. 
</p>
        <p>
        </p>
        <p>
Sayed Ibrahim Hashimi
</p>
      </body>
      <title>Speaking at Jaxdug Wednesday June 3, 2009</title>
      <guid isPermaLink="false">http://sedodream.com/PermaLink,guid,438a2a53-c1c4-4ae1-9b04-6e3cab056022.aspx</guid>
      <link>http://sedodream.com/2009/06/02/SpeakingAtJaxdugWednesdayJune32009.aspx</link>
      <pubDate>Tue, 02 Jun 2009 03:25:06 GMT</pubDate>
      <description>
		&lt;p&gt;
This coming Wednesday I will be at the &lt;a href="http://jaxdug.com/"&gt;Jacksonville Developer
User Group&lt;/a&gt;. The topic title is "&lt;em&gt;Leveraging Web Deployment Projects&lt;/em&gt;".
I am still thinking about a new title, I'm not extremely happy about that one. Here
is the description about the talk. 
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
In this session we will take a look at how Web Deployment Projects can be used to
assist in the deployment of web sites and web applications; including ASP.NET Web
Applications and ASP.NET MVC Web Applications. We will give an overview of what Web
Deployment Projects are and the functionality that is available out of the box. A
Web Deployment Project is a wrapper for the aspnet_compiler.exe tool in the form of
an MSBuild project and adds value to using the tool itself. Because they are MSBuild
files we are able to customize and extend the process. We will discuss how we can
customize the process to perform common steps such as 
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;ol&gt;
&lt;li&gt;
Creating Virtual Directories 
&lt;/li&gt;
&lt;li&gt;
Updating values in the web.config file 
&lt;/li&gt;
&lt;li&gt;
Encrypting the web.config file 
&lt;/li&gt;
&lt;li&gt;
Minimizing JavaScript files 
&lt;/li&gt;
&lt;li&gt;
Versioning the Assemblies 
&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt; &lt;/blockquote&gt; 
&lt;p&gt;
In this session we will not be covering MSBuild itself, so I will not go into too
much detail about MSBuild specifics. More to be discussed is how you can take advantage
of &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyId=0AA30AE8-C73B-4BDD-BB1B-FE697256C459&amp;amp;displaylang=en"&gt;Web
Deployment Projects&lt;/a&gt; and how that build process can be extended and customized. 
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
Sayed Ibrahim Hashimi
&lt;/p&gt;
</description>
      <comments>http://sedodream.com/CommentView,guid,438a2a53-c1c4-4ae1-9b04-6e3cab056022.aspx</comments>
      <category>ASP.NET MVC</category>
      <category>MSBuild</category>
      <category>Visual Studio 2008</category>
      <category>speaking</category>
    </item>
    <item>
      <trackback:ping>http://sedodream.com/Trackback.aspx?guid=0f3c658d-2a83-41e8-9847-618df6591688</trackback:ping>
      <pingback:server>http://sedodream.com/pingback.aspx</pingback:server>
      <pingback:target>http://sedodream.com/PermaLink,guid,0f3c658d-2a83-41e8-9847-618df6591688.aspx</pingback:target>
      <dc:creator>Ibrahim</dc:creator>
      <wfw:comment>http://sedodream.com/CommentView,guid,0f3c658d-2a83-41e8-9847-618df6591688.aspx</wfw:comment>
      <wfw:commentRss>http://sedodream.com/SyndicationService.asmx/GetEntryCommentsRss?guid=0f3c658d-2a83-41e8-9847-618df6591688</wfw:commentRss>
      <title>ASP.NET MVC: Validation Error ‘A value is required.’</title>
      <guid isPermaLink="false">http://sedodream.com/PermaLink,guid,0f3c658d-2a83-41e8-9847-618df6591688.aspx</guid>
      <link>http://sedodream.com/2009/05/18/ASPNETMVCValidationErrorAValueIsRequired.aspx</link>
      <pubDate>Mon, 18 May 2009 03:24:19 GMT</pubDate>
      <description>
		&lt;p&gt;
If you are using the &lt;a href="http://www.asp.net/mvc/"&gt;ASP.NET MVC&lt;/a&gt; DefaultModelBinder
to manage the creating complex types from your views' form data, as well as the validation
summary helper provided with ASP.NET MVC then you may have run into the situation
I did. I created a simple form, in a dummy app, to create a new contact. The page
is named AddContactClassic.aspx, the contents are shown below. 
&lt;/p&gt;
&lt;span style="FONT-FAMILY: Courier New; FONT-SIZE: 10pt"&gt; 
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; BACKGROUND: yellow; FONT-SIZE: 10pt; mso-no-proof: yes; mso-highlight: yellow"&gt; &lt;font color="#000000"&gt;&amp;lt;%&lt;/font&gt; &lt;/span&gt; &lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;@&lt;/span&gt; &lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;span style="COLOR: #a31515"&gt;Page&lt;/span&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;span style="COLOR: red"&gt;Title&lt;/span&gt; &lt;span style="COLOR: blue"&gt;=""&lt;/span&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;span style="COLOR: red"&gt;Language&lt;/span&gt; &lt;span style="COLOR: blue"&gt;="C#"&lt;/span&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;span style="COLOR: red"&gt;MasterPageFile&lt;/span&gt; &lt;span style="COLOR: blue"&gt;="~/Views/Shared/Site.Master"&lt;/span&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;span style="COLOR: red"&gt;Inherits&lt;/span&gt; &lt;span style="COLOR: blue"&gt;="System.Web.Mvc.ViewPage"&lt;/span&gt; &lt;font color="#000000"&gt; &lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?&gt;%&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; &lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; BACKGROUND: yellow; FONT-SIZE: 10pt; mso-no-proof: yes; mso-highlight: yellow"&gt; 
&lt;o:p&gt;
&lt;font color="#000000"&gt;&lt;/font&gt; 
&lt;/o:p&gt;
&lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; BACKGROUND: yellow; FONT-SIZE: 10pt; mso-no-proof: yes; mso-highlight: yellow"&gt; &lt;font color="#000000"&gt;&amp;lt;%&lt;/font&gt; &lt;/span&gt; &lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;@&lt;/span&gt; &lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;span style="COLOR: #a31515"&gt;Import&lt;/span&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;span style="COLOR: red"&gt;Namespace&lt;/span&gt; &lt;span style="COLOR: blue"&gt;="Sedodream.Web.Common.Contact"&lt;/span&gt; &lt;font color="#000000"&gt; &lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;%&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; &lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; BACKGROUND: yellow; FONT-SIZE: 10pt; mso-no-proof: yes; mso-highlight: yellow"&gt; 
&lt;o:p&gt;
&lt;font color="#000000"&gt;&lt;/font&gt; 
&lt;/o:p&gt;
&lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&amp;lt;&lt;/span&gt; &lt;span style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;asp&lt;/span&gt; &lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;:&lt;/span&gt; &lt;span style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;Content&lt;/span&gt; &lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;span style="COLOR: red"&gt;ID&lt;/span&gt; &lt;span style="COLOR: blue"&gt;="Content1"&lt;/span&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;span style="COLOR: red"&gt;ContentPlaceHolderID&lt;/span&gt; &lt;span style="COLOR: blue"&gt;="TitleContent"&lt;/span&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;span style="COLOR: red"&gt;runat&lt;/span&gt; &lt;span style="COLOR: blue"&gt;="server"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;font color="#000000"&gt; &lt;span style="mso-tab-count: 1"&gt; &lt;/span&gt;Add
Contact Classic&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&amp;lt;/&lt;/span&gt; &lt;span style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;asp&lt;/span&gt; &lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;:&lt;/span&gt; &lt;span style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;Content&lt;/span&gt; &lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&amp;lt;&lt;/span&gt; &lt;span style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;asp&lt;/span&gt; &lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;:&lt;/span&gt; &lt;span style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;Content&lt;/span&gt; &lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;span style="COLOR: red"&gt;ID&lt;/span&gt; &lt;span style="COLOR: blue"&gt;="Content2"&lt;/span&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;span style="COLOR: red"&gt;ContentPlaceHolderID&lt;/span&gt; &lt;span style="COLOR: blue"&gt;="MainContent"&lt;/span&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;span style="COLOR: red"&gt;runat&lt;/span&gt; &lt;span style="COLOR: blue"&gt;="server"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;h2&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt; &lt;font color="#000000"&gt;Add
Contact Classic&lt;/font&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;h2&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;font color="#000000"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;font color="#000000"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt; &lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;&amp;lt;%&lt;/span&gt; &lt;/font&gt; &lt;span style="COLOR: blue"&gt;=&lt;/span&gt; &lt;font color="#000000"&gt; Html.ValidationSummary(&lt;/font&gt; &lt;span style="COLOR: #a31515"&gt;"Errors
exist"&lt;/span&gt; &lt;font color="#000000"&gt;) &lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;%&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;font color="#000000"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;ol&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&amp;lt;&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;li&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&amp;lt;&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;span&lt;/span&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;span style="COLOR: red"&gt;class&lt;/span&gt; &lt;span style="COLOR: blue"&gt;="success-message"&amp;gt;&lt;/span&gt; &lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt; &lt;font color="#000000"&gt;&amp;lt;%&lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;=&lt;/span&gt; &lt;font color="#000000"&gt; ViewData[&lt;/font&gt; &lt;span style="COLOR: #a31515"&gt;"SuccessMessage"&lt;/span&gt; &lt;font color="#000000"&gt;]&lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;%&amp;gt;&lt;/span&gt;&lt;/font&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;span&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&amp;lt;/&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;li&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&amp;lt;/&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;ol&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;font color="#000000"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt; &lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;&amp;lt;%&lt;/span&gt; &lt;/font&gt; &lt;span style="COLOR: blue"&gt;using&lt;/span&gt; &lt;font color="#000000"&gt; (Html.BeginForm())&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;font color="#000000"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;{ &lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;%&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;fieldset&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;legend&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt; &lt;font color="#000000"&gt;Account
Information&lt;/font&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;legend&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;ol&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;li&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;label&lt;/span&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;span style="COLOR: red"&gt;for&lt;/span&gt; &lt;span style="COLOR: blue"&gt;="FirstName"&amp;gt;&lt;/span&gt; &lt;font color="#000000"&gt;First
name&lt;/font&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;label&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;font color="#000000"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt; &lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;&amp;lt;%&lt;/span&gt; &lt;/font&gt; &lt;span style="COLOR: blue"&gt;=&lt;/span&gt; &lt;font color="#000000"&gt; Html.TextBox(&lt;/font&gt; &lt;span style="COLOR: #a31515"&gt;"FirstName"&lt;/span&gt; &lt;font color="#000000"&gt;) &lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;%&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;font color="#000000"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt; &lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;&amp;lt;%&lt;/span&gt; &lt;/font&gt; &lt;span style="COLOR: blue"&gt;=&lt;/span&gt; &lt;font color="#000000"&gt; Html.ValidationMessage(&lt;/font&gt; &lt;span style="COLOR: #a31515"&gt;"FirstName"&lt;/span&gt; &lt;font color="#000000"&gt;, &lt;/font&gt; &lt;span style="COLOR: #a31515"&gt;"*"&lt;/span&gt; &lt;font color="#000000"&gt;) &lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;%&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;li&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;li&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;label&lt;/span&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;span style="COLOR: red"&gt;for&lt;/span&gt; &lt;span style="COLOR: blue"&gt;="LastName"&amp;gt;&lt;/span&gt; &lt;font color="#000000"&gt;Last
name&lt;/font&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;label&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;font color="#000000"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt; &lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;&amp;lt;%&lt;/span&gt; &lt;/font&gt; &lt;span style="COLOR: blue"&gt;=&lt;/span&gt; &lt;font color="#000000"&gt; Html.TextBox(&lt;/font&gt; &lt;span style="COLOR: #a31515"&gt;"LastName"&lt;/span&gt; &lt;font color="#000000"&gt;) &lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;%&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;font color="#000000"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt; &lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;&amp;lt;%&lt;/span&gt; &lt;/font&gt; &lt;span style="COLOR: blue"&gt;=&lt;/span&gt; &lt;font color="#000000"&gt; Html.ValidationMessage(&lt;/font&gt; &lt;span style="COLOR: #a31515"&gt;"LastName"&lt;/span&gt; &lt;font color="#000000"&gt;, &lt;/font&gt; &lt;span style="COLOR: #a31515"&gt;"*"&lt;/span&gt; &lt;font color="#000000"&gt;) &lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;%&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;li&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;li&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;label&lt;/span&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;span style="COLOR: red"&gt;for&lt;/span&gt; &lt;span style="COLOR: blue"&gt;="Email"&amp;gt;&lt;/span&gt; &lt;font color="#000000"&gt;Email&lt;/font&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;label&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;font color="#000000"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt; &lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;&amp;lt;%&lt;/span&gt; &lt;/font&gt; &lt;span style="COLOR: blue"&gt;=&lt;/span&gt; &lt;font color="#000000"&gt; Html.TextBox(&lt;/font&gt; &lt;span style="COLOR: #a31515"&gt;"Email"&lt;/span&gt; &lt;font color="#000000"&gt;)&lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;%&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;font color="#000000"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt; &lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;&amp;lt;%&lt;/span&gt; &lt;/font&gt; &lt;span style="COLOR: blue"&gt;=&lt;/span&gt; &lt;font color="#000000"&gt; Html.ValidationMessage(&lt;/font&gt; &lt;span style="COLOR: #a31515"&gt;"Email"&lt;/span&gt; &lt;font color="#000000"&gt;, &lt;/font&gt; &lt;span style="COLOR: #a31515"&gt;"*"&lt;/span&gt; &lt;font color="#000000"&gt;)&lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;%&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;li&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;li&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;label&lt;/span&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;span style="COLOR: red"&gt;for&lt;/span&gt; &lt;span style="COLOR: blue"&gt;="Phone"&amp;gt;&lt;/span&gt; &lt;font color="#000000"&gt;Phone&lt;/font&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;label&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;font color="#000000"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt; &lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;&amp;lt;%&lt;/span&gt; &lt;/font&gt; &lt;span style="COLOR: blue"&gt;=&lt;/span&gt; &lt;font color="#000000"&gt; Html.TextBox(&lt;/font&gt; &lt;span style="COLOR: #a31515"&gt;"Phone"&lt;/span&gt; &lt;font color="#000000"&gt;)&lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;%&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;font color="#000000"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt; &lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;&amp;lt;%&lt;/span&gt; &lt;/font&gt; &lt;span style="COLOR: blue"&gt;=&lt;/span&gt; &lt;font color="#000000"&gt; Html.ValidationMessage(&lt;/font&gt; &lt;span style="COLOR: #a31515"&gt;"Phone"&lt;/span&gt; &lt;font color="#000000"&gt;, &lt;/font&gt; &lt;span style="COLOR: #a31515"&gt;"*"&lt;/span&gt; &lt;font color="#000000"&gt;)&lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;%&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;li&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;li&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;div&lt;/span&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;span style="COLOR: red"&gt;class&lt;/span&gt; &lt;span style="COLOR: blue"&gt;="option-group"&lt;/span&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;span style="COLOR: red"&gt;id&lt;/span&gt; &lt;span style="COLOR: blue"&gt;="Gender"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;font color="#000000"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt; &lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;&amp;lt;%&lt;/span&gt; &lt;/font&gt; &lt;span style="COLOR: blue"&gt;=&lt;/span&gt; &lt;font color="#000000"&gt; Html.RadioButton(&lt;/font&gt; &lt;span style="COLOR: #a31515"&gt;"Gender"&lt;/span&gt; &lt;font color="#000000"&gt;, &lt;/font&gt; &lt;span style="COLOR: #2b91af"&gt;Gender&lt;/span&gt; &lt;font color="#000000"&gt;.Male.ToString())&lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;%&amp;gt;&lt;/span&gt;&lt;/font&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;span&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt; &lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt; &lt;font color="#000000"&gt;&amp;lt;%&lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;=&lt;/span&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;span style="COLOR: #2b91af"&gt;Gender&lt;/span&gt; &lt;font color="#000000"&gt;.Male.ToString() &lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;%&amp;gt;&lt;/span&gt;&lt;/font&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;span&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;font color="#000000"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt; &lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;&amp;lt;%&lt;/span&gt; &lt;/font&gt; &lt;span style="COLOR: blue"&gt;=&lt;/span&gt; &lt;font color="#000000"&gt; Html.RadioButton(&lt;/font&gt; &lt;span style="COLOR: #a31515"&gt;"Gender"&lt;/span&gt; &lt;font color="#000000"&gt;, &lt;/font&gt; &lt;span style="COLOR: #2b91af"&gt;Gender&lt;/span&gt; &lt;font color="#000000"&gt;.Female.ToString())&lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;%&amp;gt;&lt;/span&gt;&lt;/font&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;span&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt; &lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt; &lt;font color="#000000"&gt;&amp;lt;%&lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;=&lt;/span&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;span style="COLOR: #2b91af"&gt;Gender&lt;/span&gt; &lt;font color="#000000"&gt;.Female.ToString() &lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;%&amp;gt;&lt;/span&gt;&lt;/font&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;span&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;div&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;li&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt; &lt;font color="#000000"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;li&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;input&lt;/span&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;span style="COLOR: red"&gt;type&lt;/span&gt; &lt;span style="COLOR: blue"&gt;="submit"&lt;/span&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;span style="COLOR: red"&gt;value&lt;/span&gt; &lt;span style="COLOR: blue"&gt;="Add
contact"&lt;/span&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;li&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;ol&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;fieldset&lt;/span&gt; &lt;span style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;font color="#000000"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt; &lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;&amp;lt;%&lt;/span&gt; } &lt;span style="BACKGROUND: yellow; mso-highlight: yellow"&gt;%&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; BACKGROUND: yellow; FONT-SIZE: 10pt; mso-no-proof: yes; mso-highlight: yellow"&gt; 
&lt;o:p&gt;
&lt;font color="#000000"&gt;&lt;/font&gt; 
&lt;/o:p&gt;
&lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 10pt" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&amp;lt;/&lt;/span&gt; &lt;span style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;asp&lt;/span&gt; &lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;:&lt;/span&gt; &lt;span style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;Content&lt;/span&gt; &lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&amp;gt;&lt;/span&gt; 
&lt;/p&gt;
&lt;/span&gt; 
&lt;p&gt;
In my &lt;span style="COLOR: #00b050"&gt;&lt;strong&gt;ContactController&lt;/strong&gt;&lt;/span&gt; class
the following methods are defined. 
&lt;/p&gt;
&lt;span style="FONT-FAMILY: Courier New; FONT-SIZE: 10pt"&gt; &lt;span style="COLOR: blue"&gt; 
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;public&lt;/span&gt; &lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;span style="COLOR: #2b91af"&gt;ActionResult&lt;/span&gt; &lt;font color="#000000"&gt; AddContactClassic()&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;font color="#000000"&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;return&lt;/span&gt; &lt;font color="#000000"&gt; View();&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;font color="#000000"&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;font color="#000000"&gt;[&lt;/font&gt; &lt;span style="COLOR: #2b91af"&gt;AcceptVerbs&lt;/span&gt; &lt;font color="#000000"&gt;(&lt;/font&gt; &lt;span style="COLOR: #2b91af"&gt;HttpVerbs&lt;/span&gt; &lt;font color="#000000"&gt;.Post)]&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;public&lt;/span&gt; &lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;span style="COLOR: #2b91af"&gt;ActionResult&lt;/span&gt; &lt;font color="#000000"&gt; AddContactClassic(&lt;/font&gt; &lt;span style="COLOR: #2b91af"&gt;Contact&lt;/span&gt; &lt;font color="#000000"&gt; contact)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;font color="#000000"&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;if&lt;/span&gt; &lt;font color="#000000"&gt; (contact
== &lt;/font&gt; &lt;span style="COLOR: blue"&gt;null&lt;/span&gt; &lt;font color="#000000"&gt;) { &lt;/font&gt; &lt;span style="COLOR: blue"&gt;throw&lt;/span&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;span style="COLOR: #2b91af"&gt;ArgumentNullException&lt;/span&gt; &lt;font color="#000000"&gt;(&lt;/font&gt; &lt;span style="COLOR: #a31515"&gt;"contact"&lt;/span&gt; &lt;font color="#000000"&gt;);
}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; 
&lt;o:p&gt;
&lt;font color="#000000"&gt;&lt;/font&gt; 
&lt;/o:p&gt;
&lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;font color="#000000"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;InternalAddContact(contact);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; 
&lt;o:p&gt;
&lt;font color="#000000"&gt;&lt;/font&gt; 
&lt;/o:p&gt;
&lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;return&lt;/span&gt; &lt;font color="#000000"&gt; View();&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-fareast; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt; &lt;font color="#000000"&gt;}&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;/span&gt; &lt;/span&gt; 
&lt;p&gt;
When I ran the app and filled in all the values on the AddContactClassic page I was
a bit surprised to see an error simply stating &lt;em&gt;"A value is required."&lt;/em&gt; Here
is a screen shot. 
&lt;/p&gt;
&lt;p&gt;
&lt;img alt="" src="http://www.sedodream.com/content/binary/070609_0324_ASPNETMVCVa1.png" /&gt; 
&lt;/p&gt;
&lt;p&gt;
So I assumed that I must have misspelled one of the names of the fields that were
passed to the &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.html.inputextensions.textbox.aspx"&gt;Html.TextBox&lt;/a&gt; method.
Obviously this was not the issue, so then I remembered that the Contact class that
I defined had another property, Id, which I was not contained in a field on the form.
This is the case because this page is supposed to create a new Contact, so its Id
will not be set. I changed the AddContactClassic(Contact) method to ignore the Id
property when binding was occurring. Here is the new method. 
&lt;/p&gt;
&lt;span style="FONT-FAMILY: Courier New; FONT-SIZE: 10pt"&gt; 
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;font color="#000000"&gt;[&lt;/font&gt; &lt;span style="COLOR: #2b91af"&gt;AcceptVerbs&lt;/span&gt; &lt;font color="#000000"&gt;(&lt;/font&gt; &lt;span style="COLOR: #2b91af"&gt;HttpVerbs&lt;/span&gt; &lt;font color="#000000"&gt;.Post)]&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;public&lt;/span&gt; &lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;span style="COLOR: #2b91af"&gt;ActionResult&lt;/span&gt; &lt;font color="#000000"&gt; AddContactClassic(&lt;/font&gt; &lt;span style="BACKGROUND: yellow"&gt; &lt;font color="#000000"&gt;[&lt;/font&gt; &lt;span style="COLOR: #2b91af"&gt;Bind&lt;/span&gt; &lt;font color="#000000"&gt;(Exclude=&lt;/font&gt; &lt;span style="COLOR: #a31515"&gt;"Id"&lt;/span&gt; &lt;font color="#000000"&gt;)]&lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Contact&lt;/span&gt; &lt;font color="#000000"&gt; contact)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;font color="#000000"&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;if&lt;/span&gt; &lt;font color="#000000"&gt; (contact
== &lt;/font&gt; &lt;span style="COLOR: blue"&gt;null&lt;/span&gt; &lt;font color="#000000"&gt;) { &lt;/font&gt; &lt;span style="COLOR: blue"&gt;throw&lt;/span&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;span style="COLOR: #2b91af"&gt;ArgumentNullException&lt;/span&gt; &lt;font color="#000000"&gt;(&lt;/font&gt; &lt;span style="COLOR: #a31515"&gt;"contact"&lt;/span&gt; &lt;font color="#000000"&gt;);
}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; 
&lt;o:p&gt;
&lt;font color="#000000"&gt;&lt;/font&gt; 
&lt;/o:p&gt;
&lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;font color="#000000"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;InternalAddContact(contact);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; 
&lt;o:p&gt;
&lt;font color="#000000"&gt;&lt;/font&gt; 
&lt;/o:p&gt;
&lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;span style="mso-spacerun: yes"&gt; &lt;font color="#000000"&gt; &lt;/font&gt; &lt;/span&gt; &lt;span style="COLOR: blue"&gt;return&lt;/span&gt; &lt;font color="#000000"&gt; View();&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-fareast; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt; &lt;font color="#000000"&gt;}&lt;/font&gt; &lt;/span&gt; 
&lt;/p&gt;
&lt;/span&gt; 
&lt;p&gt;
By using the &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.mvc.bindattribute.aspx"&gt;Bind
attribute&lt;/a&gt; I was able to let the &lt;a href="DefaultModelBinder"&gt;DefaultModelBinder&lt;/a&gt; know
that I was not interested in getting the value for that field. Once I made this change
everything worked fine. 
&lt;/p&gt;
&lt;p&gt;
In the Contact class I had incorrectly defined the Id property to be &lt;span style="COLOR: #00b050"&gt;&lt;strong&gt;Guid &lt;/strong&gt;&lt;/span&gt;instead
of &lt;span style="COLOR: #00b050"&gt;&lt;strong&gt;Guid?&lt;/strong&gt;&lt;/span&gt; which is better. If
I had correctly declared that then the &lt;a href="DefaultModelBinder"&gt;DefaultModelBinder&lt;/a&gt; would
have known that it was not a required field and it would not have complained. But
if you are using the &lt;a href="http://msdn.microsoft.com/en-us/library/aa697427(VS.80).aspx"&gt;Entity
Framework&lt;/a&gt;, you may still have this issue anyway because it does not always create
nullable fields for all nullable columns in my experience. Even after changing the
Contact class to use Guid? I have purposefully left the &lt;span style="COLOR: #00b050"&gt;&lt;strong&gt;Bind(Exclude="Id")&lt;/strong&gt;&lt;/span&gt; on
the method in case something changes in the implementation of the Contact class. 
&lt;/p&gt;
&lt;p&gt;
Sayed Ibrahim Hashimi
&lt;/p&gt;
</description>
      <comments>http://sedodream.com/CommentView,guid,0f3c658d-2a83-41e8-9847-618df6591688.aspx</comments>
      <category>ASP.NET MVC</category>
    </item>
    <item>
      <trackback:ping>http://sedodream.com/Trackback.aspx?guid=a5c97d2f-f989-467e-924a-0f5da20aefe8</trackback:ping>
      <pingback:server>http://sedodream.com/pingback.aspx</pingback:server>
      <pingback:target>http://sedodream.com/PermaLink,guid,a5c97d2f-f989-467e-924a-0f5da20aefe8.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://sedodream.com/CommentView,guid,a5c97d2f-f989-467e-924a-0f5da20aefe8.aspx</wfw:comment>
      <wfw:commentRss>http://sedodream.com/SyndicationService.asmx/GetEntryCommentsRss?guid=a5c97d2f-f989-467e-924a-0f5da20aefe8</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
If you are you using <a href="http://www.asp.net/mvc">ASP.NET MVC</a> and the <a href="http://msdn.microsoft.com/en-us/library/aa697427%28VS.80%29.aspx">Entity
Framework</a> then odds are that you will want to use some of your entity object inside
of your views. If you've tried this you may have run into the following exception: <em>"CS0234:
The type or namespace name 'Entity' does not exist in the namespace 'System.Data'
(are you missing an assembly reference?)"</em>. 
<br /></p>
        <p>
          <img src="http://www.sedodream.com/content/binary/042309_1818_ASPNETMVCUs1.png" />
          <br />
        </p>
        <p>
        </p>
        <p>
So the first guess is to add a reference to System.Data.Entity assembly in the MVC
project. I did that then ran my app again, and I encountered the same error. After
some poking around I figured out that you need to manually add the assembly to the
web.config file. So in your web.config file you need to add the element 
</p>
        <p>
          <span style="font-family: Courier New; font-size: 10pt;">
            <span style="color: blue;">&lt;</span>
            <span style="color: rgb(163, 21, 21);">add</span>
            <span style="color: blue;">
            </span>
            <span style="color: red;">assembly</span>
            <span style="color: blue;">=</span>"<span style="color: blue;">System.Data.Entity,
Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</span>"<span style="color: blue;"> /&gt;</span></span>
        </p>
        <p>
Under the compiliation\assembiles node, here it is: 
</p>
        <p>
          <img src="http://www.sedodream.com/content/binary/042309_1818_ASPNETMVCUs2.png" alt="" />
        </p>
        <p>
Once you've done this you should be able to run your app with no problems. 
</p>
        <p>
 
</p>
        <p>
Sayed Ibrahim Hashimi
</p>
      </body>
      <title>ASP.NET MVC: Using Entity Objects in Views</title>
      <guid isPermaLink="false">http://sedodream.com/PermaLink,guid,a5c97d2f-f989-467e-924a-0f5da20aefe8.aspx</guid>
      <link>http://sedodream.com/2009/04/23/ASPNETMVCUsingEntityObjectsInViews.aspx</link>
      <pubDate>Thu, 23 Apr 2009 18:18:20 GMT</pubDate>
      <description>&lt;p&gt;
If you are you using &lt;a href="http://www.asp.net/mvc"&gt;ASP.NET MVC&lt;/a&gt; and the &lt;a href="http://msdn.microsoft.com/en-us/library/aa697427%28VS.80%29.aspx"&gt;Entity
Framework&lt;/a&gt; then odds are that you will want to use some of your entity object inside
of your views. If you've tried this you may have run into the following exception: &lt;em&gt;"CS0234:
The type or namespace name 'Entity' does not exist in the namespace 'System.Data'
(are you missing an assembly reference?)"&lt;/em&gt;. 
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://www.sedodream.com/content/binary/042309_1818_ASPNETMVCUs1.png"&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
So the first guess is to add a reference to System.Data.Entity assembly in the MVC
project. I did that then ran my app again, and I encountered the same error. After
some poking around I figured out that you need to manually add the assembly to the
web.config file. So in your web.config file you need to add the element 
&lt;/p&gt;
&lt;p&gt;
&lt;span style="font-family: Courier New; font-size: 10pt;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;add&lt;/span&gt;&lt;span style="color: blue;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;assembly&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;System.Data.Entity,
Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&lt;/span&gt;"&lt;span style="color: blue;"&gt; /&amp;gt;&lt;/span&gt;&lt;/span&gt; 
&lt;/p&gt;
&lt;p&gt;
Under the compiliation\assembiles node, here it is: 
&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://www.sedodream.com/content/binary/042309_1818_ASPNETMVCUs2.png" alt=""&gt; 
&lt;/p&gt;
&lt;p&gt;
Once you've done this you should be able to run your app with no problems. 
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
Sayed Ibrahim Hashimi
&lt;/p&gt;</description>
      <comments>http://sedodream.com/CommentView,guid,a5c97d2f-f989-467e-924a-0f5da20aefe8.aspx</comments>
      <category>ASP.NET MVC</category>
      <category>Entity Framework</category>
    </item>
  </channel>
</rss>