<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Guy Burstein : ASP.Net MVC</title><link>http://blogs.msdn.com/bursteg/archive/tags/ASP.Net+MVC/default.aspx</link><description>Tags: ASP.Net MVC</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Getting Started with jQuery in Visual Studio 2008</title><link>http://blogs.msdn.com/bursteg/archive/2009/06/05/getting-started-with-jquery-in-visual-studio-2008.aspx</link><pubDate>Fri, 05 Jun 2009 19:16:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9701557</guid><dc:creator>Guy Burstein</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/bursteg/comments/9701557.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bursteg/commentrss.aspx?PostID=9701557</wfw:commentRss><wfw:comment>http://blogs.msdn.com/bursteg/rsscomments.aspx?PostID=9701557</wfw:comment><description>&lt;h1&gt;Getting Started with jQuery in Visual Studio 2008&lt;/h1&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="jQuery IntellSense in Visual Studio 2008" border="0" alt="jQuery IntellSense in Visual Studio 2008" align="right" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/GettingStartedwithjQueryinVisualStudio20_F0A6/jQuery_c4e63ba1-bcde-4f12-bfe7-1f9bdb19641a.png" width="230" height="80" /&gt;&lt;/p&gt;  &lt;p&gt;In this post I’ll talk about adding &lt;strong&gt;jQuery IntellSense in Visual Studio 2008&lt;/strong&gt;, and how to add jQuery to a simple Web Application inside Visual Studio 2008.&lt;/p&gt;  &lt;h3&gt;jQuery IntelliSense in Visual Studio 2008 - KB946581&lt;/h3&gt;  &lt;p&gt;In order to use &lt;strong&gt;jQuery&lt;/strong&gt; &lt;strong&gt;in Visual Studio 2008 with IntelliSence&lt;/strong&gt; a &lt;a href="http://blogs.msdn.com/webdevtools/archive/2008/02/09/downloadable-hotfix-performance-and-editor-fixes-for-microsoft-visual-studio-2008-and-visual-web-developer-express-2008.aspx"&gt;hotfix&lt;/a&gt; for Visual Studio 2008 must be installed:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;a href="https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=10826"&gt;Download the hotfix from Connect&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;Run the executable and extract its contents to a folder in your hard drive. &lt;/li&gt;    &lt;li&gt;Make sure all instances of Visual Studio 2008 are closed, and run &lt;strong&gt;VS90-KB946581.exe&lt;/strong&gt; from the above folder. &lt;/li&gt; &lt;/ol&gt;  &lt;h3&gt;Download the Latest jQuery Library + Documentation&lt;/h3&gt;  &lt;p&gt;To use &lt;strong&gt;jQuery in Visual Studio 2008&lt;/strong&gt;, and enjoy its IntelliSense, you should download 2 javascript files. One contains the actual jQuery library, and the second contains the library with documentation for &lt;strong&gt;Visual Studio 2008&lt;/strong&gt; to display its &lt;strong&gt;IntelliSense&lt;/strong&gt;.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Go to &lt;a href="http://docs.jquery.com/Downloading_jQuery#Download_jQuery"&gt;jQuery Official Download Page&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;Scroll down and find the &lt;strong&gt;Current Release&lt;/strong&gt; section. &lt;/li&gt;    &lt;li&gt;Download the &lt;strong&gt;Uncompressed&lt;/strong&gt; version (&lt;em&gt;jquery-1.2.6.js&lt;/em&gt;) and the documentation for Visual Studio (&lt;em&gt;jquery-1.2.6-vsdoc.js&lt;/em&gt;). &lt;/li&gt; &lt;/ol&gt;  &lt;h3&gt;Using jQuery in a Visual Studio 2008 Web Application&lt;/h3&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="jQuery IntelliSense in Visual Studio 2008 - KB946581" border="0" alt="jQuery IntelliSense in Visual Studio 2008 - KB946581" align="right" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/GettingStartedwithjQueryinVisualStudio20_F0A6/image_16d672f5-3fb2-4157-928c-7d8ab9ba564a.png" width="165" height="153" /&gt;In a new Web Application or inside an existing one, add the jQuery scripts into a certain folder.&lt;/p&gt;  &lt;p&gt;In a web page (or a master page), add a reference to the jQuery library:&lt;/p&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 11pt"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;head&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;server&amp;quot;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;title&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;jQuery Sample&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;title&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;strong&gt;&amp;#160; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;script&lt;/span&gt; &lt;span style="color: red"&gt;src&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;scripts/jquery-1.2.6.js&amp;quot;&lt;/span&gt;         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: red"&gt;type&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;text/javascript&amp;quot;&lt;/span&gt; &lt;span style="color: blue"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;script&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;head&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Then, in any javascript function you can start using &lt;strong&gt;jQuery&lt;/strong&gt; functions and enjoy the &lt;strong&gt;IntelliSense in Visual Studio 2008&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="jQuery IntelliSense in Visual Studio 2008 - KB946581" border="0" alt="jQuery IntelliSense in Visual Studio 2008 - KB946581" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/GettingStartedwithjQueryinVisualStudio20_F0A6/image_1e8bdb45-be2b-4e76-a8b9-5542092344d9.png" width="293" height="96" /&gt; &lt;/p&gt;  &lt;h3&gt;A Simple Example of Using jQuery Functions&lt;/h3&gt;  &lt;p&gt;For example, Assuming that you have a page with the following content in it:&lt;/p&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 11pt"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;form&lt;/span&gt; &lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;form1&amp;quot;&lt;/span&gt; &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;server&amp;quot;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&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;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;input&lt;/span&gt; &lt;span style="color: red"&gt;type&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;text&amp;quot;&lt;/span&gt; &lt;span style="color: red"&gt;class&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;inputs&amp;quot;&lt;/span&gt; &lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;txtName&amp;quot;&lt;/span&gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: red"&gt;value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Enter Text Here&amp;quot;&lt;/span&gt; &lt;span style="color: blue"&gt;/&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;input&lt;/span&gt; &lt;span style="color: red"&gt;type&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;button&amp;quot;&lt;/span&gt; &lt;span style="color: red"&gt;class&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;inputs&amp;quot;&lt;/span&gt; &lt;span style="color: red"&gt;id&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;btnSubmit&amp;quot;&lt;/span&gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: red"&gt;value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Click Me&amp;quot;&lt;/span&gt; &lt;span style="color: red"&gt;&lt;strong&gt;onclick&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: blue"&gt;&lt;strong&gt;=&amp;quot;handleButtonClick();&lt;/strong&gt;&amp;quot;&lt;/span&gt; &lt;span style="color: blue"&gt;/&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&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;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;form&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;This form contains a single textbox followed by a button.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="jQuery IntelliSense in Visual Studio 2008 - KB946581" border="0" alt="jQuery IntelliSense in Visual Studio 2008 - KB946581" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/GettingStartedwithjQueryinVisualStudio20_F0A6/image_4ee94ee5-29c9-4c96-8e69-9abfc7a2249e.png" width="242" height="39" /&gt; &lt;/p&gt;  &lt;p&gt;The &lt;em&gt;handleButtonClick()&lt;/em&gt; function handles the button &lt;em&gt;onclick&lt;/em&gt; event.&lt;/p&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 11pt"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;script&lt;/span&gt; &lt;span style="color: red"&gt;type&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160; &lt;span style="color: blue"&gt;function&lt;/span&gt; handleButtonClick() {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;script&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;The way jQuery works is by selecting DOM elements and then doing something with them, such as executing a function or applying some properties. For example:&lt;/p&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 11pt"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;script&lt;/span&gt; &lt;span style="color: red"&gt;type&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160; &lt;span style="color: blue"&gt;function&lt;/span&gt; handleButtonClick() {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;strong&gt;$(&lt;span style="color: #a31515"&gt;&amp;quot;#txtName&amp;quot;&lt;/span&gt;).css(&lt;span style="color: #a31515"&gt;&amp;quot;border&amp;quot;&lt;/span&gt;, &lt;span style="color: #a31515"&gt;&amp;quot;solid 2px red&amp;quot;&lt;/span&gt;);&lt;/strong&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;script&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;The above method uses the selector function &lt;strong&gt;$&lt;/strong&gt; to select DOM elements (in this case – a single element with id = txtName) and to apply a style property of a red border. Running this page and clicking the button results in this output:&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="jQuery IntelliSense in Visual Studio 2008 - KB946581" border="0" alt="jQuery IntelliSense in Visual Studio 2008 - KB946581" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/GettingStartedwithjQueryinVisualStudio20_F0A6/image_c008d991-ab24-451d-89c2-068b7c05b1f8.png" width="249" height="33" /&gt; &lt;/p&gt;  &lt;h3&gt;Summary&lt;/h3&gt;  &lt;p&gt;In this post I talked about the steps you should follow in order to use &lt;strong&gt;jQuery in Visual Studio 2008 with InstelliSense support&lt;/strong&gt;. Then, we used jQuery in a simple web application.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9701557" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/bursteg/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category><category domain="http://blogs.msdn.com/bursteg/archive/tags/ASP.Net+MVC/default.aspx">ASP.Net MVC</category><category domain="http://blogs.msdn.com/bursteg/archive/tags/ASP.Net/default.aspx">ASP.Net</category><category domain="http://blogs.msdn.com/bursteg/archive/tags/jQuery/default.aspx">jQuery</category></item><item><title>ASP.Net MVC on Windows Azure | ASP.Net MVC Web Role</title><link>http://blogs.msdn.com/bursteg/archive/2009/05/23/asp-net-mvc-on-windows-azure-asp-net-mvc-web-role.aspx</link><pubDate>Sat, 23 May 2009 16:48:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9637361</guid><dc:creator>Guy Burstein</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/bursteg/comments/9637361.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bursteg/commentrss.aspx?PostID=9637361</wfw:commentRss><wfw:comment>http://blogs.msdn.com/bursteg/rsscomments.aspx?PostID=9637361</wfw:comment><description>&lt;h1&gt;ASP.Net MVC on Windows Azure | ASP.Net MVC Web Role&lt;/h1&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px 0px 0px 20px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC Web Role Windows Azure" border="0" alt="ASP.Net MVC Web Role Windows Azure" align="right" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/Windows%20Azure_509b3e81-f8c9-4902-8f09-b23ffb37c8b7.png" width="210" height="46" /&gt;When you install &lt;strong&gt;Windows Azure&lt;/strong&gt; Tools for Visual Studio, you only get a project template for an &lt;strong&gt;ASP.Net Web Role&lt;/strong&gt;. In this post I’ll talk about how to create a new &lt;strong&gt;ASP.Net MVC Web Role&lt;/strong&gt; or move an existing &lt;strong&gt;ASP.Net MVC&lt;/strong&gt; Application to &lt;strong&gt;Windows Azure&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;There are 2 ways to do this:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;&lt;img style="border-right-width: 0px; margin: 20px 0px 20px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC Web Role Windows Azure" border="0" alt="ASP.Net MVC Web Role Windows Azure" align="right" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/ASP.Net_70989e8d-4535-4165-90b9-0063e2caf5cc.jpg" width="194" height="37" /&gt;Manually&lt;/strong&gt; adding an &lt;strong&gt;ASP.Net MVC application as a Web Role&lt;/strong&gt; (suitable both for a new ASP.Net MVC application and for an existing one). &lt;/li&gt;    &lt;li&gt;Use a &lt;strong&gt;Project Template&lt;/strong&gt; to simply create a new ASP.Net MVC Web Role (new ASP.Net MVC application only). &lt;/li&gt; &lt;/ul&gt;  &lt;h3&gt;Creating a New ASP.Net MVC Web Role&lt;/h3&gt;  &lt;p&gt;The following steps apply both for creating a new ASP.Net MVC application and to moving an existing ASP.Net MVC application to Windows Azure.&lt;/p&gt;  &lt;p&gt;1. Create an empty &lt;strong&gt;ASP.Net MVC Application&lt;/strong&gt; (with or without a test project), or make sure you have an existing ASP.Net MVC application that you want to move to the Windows Azure.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC Web Role Windows Azure" border="0" alt="ASP.Net MVC Web Role Windows Azure" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_7480b545-4684-403f-8c94-4b0fec7fcb6b.png" width="480" height="337" /&gt; &lt;/p&gt;  &lt;p&gt;2. Close this solution and create a new &lt;strong&gt;Blank Cloud Service&lt;/strong&gt;. Make sure you start &lt;strong&gt;Visual Studio as an administrator&lt;/strong&gt; because working with the &lt;strong&gt;Development Fabric&lt;/strong&gt; requires that.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC Web Role Windows Azure" border="0" alt="ASP.Net MVC Web Role Windows Azure" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_194348b3-c798-4921-b117-a6533830e3c6.png" width="480" height="350" /&gt; &lt;/p&gt;  &lt;p&gt;3. &lt;strong&gt;Add an existing project&lt;/strong&gt; to the cloud service and select the ASP.Net MVC Application you have created earlier.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC Web Role Windows Azure" border="0" alt="ASP.Net MVC Web Role Windows Azure" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_d8cd1cbb-c082-41db-9ca4-8b9742cf7d33.png" width="174" height="249" /&gt; &lt;/p&gt;  &lt;p&gt;4. &lt;strong&gt;Right click&lt;/strong&gt; the ASP.Net MVC project and select &lt;strong&gt;Unload Project&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC Web Role Windows Azure" border="0" alt="ASP.Net MVC Web Role Windows Azure" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_27de367c-f84c-4213-9765-bb4318527a0e.png" width="343" height="285" /&gt; &lt;/p&gt;  &lt;p&gt;5. When the project is unloaded, right click it and &lt;strong&gt;edit the project file&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC Web Role Windows Azure" border="0" alt="ASP.Net MVC Web Role Windows Azure" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_bfcb6249-7b5b-4c91-82b4-86797b7edae7.png" width="380" height="187" /&gt; &lt;/p&gt;  &lt;p&gt;6. The project file opens in the XML Editor. &lt;/p&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 11pt"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Project&lt;/span&gt;&lt;span style="color: blue"&gt; &lt;/span&gt;&lt;span style="color: red"&gt;ToolsVersion&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;3.5&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt; &lt;/span&gt;&lt;span style="color: red"&gt;DefaultTargets&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Build&lt;/span&gt;&amp;quot; ...&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;PropertyGroup&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Configuration&lt;/span&gt;&lt;span style="color: blue"&gt; &lt;/span&gt;&lt;span style="color: red"&gt;Condition&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt; '$(Configuration)' == '' &lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;Debug&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Configuration&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160; ...&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;PropertyGroup&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160; ...        &lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Project&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;Inside the &lt;strong&gt;PropertyGroup&lt;/strong&gt; Element, add the &lt;strong&gt;RoleType&lt;/strong&gt; element and mark this &lt;strong&gt;ASP.Net MVC project as a Web Role&lt;/strong&gt;.&lt;/p&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 11pt"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Project&lt;/span&gt;&lt;span style="color: blue"&gt; &lt;/span&gt;&lt;span style="color: red"&gt;ToolsVersion&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;3.5&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt; &lt;/span&gt;&lt;span style="color: red"&gt;DefaultTargets&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Build&lt;/span&gt;&amp;quot; ...&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;PropertyGroup&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;strong&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;RoleType&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;Web&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;RoleType&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Configuration&lt;/span&gt;&lt;span style="color: blue"&gt; &lt;/span&gt;&lt;span style="color: red"&gt;Condition&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt; '$(Configuration)' == '' &lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;Debug&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Configuration&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160; ...        &lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;PropertyGroup&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;#160; ...&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Project&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;7. Close this project file, and &lt;strong&gt;reload the project&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC Web Role Windows Azure" border="0" alt="ASP.Net MVC Web Role Windows Azure" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_b78ce925-6a89-4082-bc2e-18cc23e68df3.png" width="356" height="172" /&gt; &lt;/p&gt;  &lt;p&gt;8. Since the ASP.Net MVC now runs on the Windows Azure Service Hosting environment and will probably use its services – add a reference to &lt;strong&gt;Microsoft.ServiceHosting.ServiceRuntime.dll&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC Web Role Windows Azure" border="0" alt="ASP.Net MVC Web Role Windows Azure" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_519f5a16-0840-4178-8427-d3a9e97624c1.png" width="480" height="313" /&gt; &lt;/p&gt;  &lt;p&gt;9. &lt;strong&gt;Right click&lt;/strong&gt; the &lt;strong&gt;Roles&lt;/strong&gt; node in the project tree, and add a &lt;strong&gt;Web Role Project in the solution. &lt;/strong&gt;Select the ASP.Net MVC project from the project list.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC Web Role Windows Azure" border="0" alt="ASP.Net MVC Web Role Windows Azure" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_f701a824-9b9e-490f-99a0-3eaedc7118e8.png" width="412" height="148" /&gt; &lt;/p&gt;  &lt;p&gt;Now the &lt;strong&gt;ASP.Net MVC&lt;/strong&gt; project is shown as a &lt;strong&gt;Web Role&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC Web Role Windows Azure" border="0" alt="ASP.Net MVC Web Role Windows Azure" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_343b4c86-2ae0-41a4-9324-92f8ad13a4fa.png" width="234" height="176" /&gt; &lt;/p&gt;  &lt;p&gt;10. Since the &lt;strong&gt;Windows Azure&lt;/strong&gt; provides us only with the default .Net Framework 3.5 SP1 assemblies, we must make sure we also copy the &lt;strong&gt;ASP.Net MVC&lt;/strong&gt; Assemblies to the cloud. To do this, right click on each of the following references of the &lt;strong&gt;ASP.Net MVC&lt;/strong&gt; application, and set the &lt;strong&gt;Copy Local&lt;/strong&gt; property to &lt;strong&gt;True:&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;System.Web.Abstractions &lt;/strong&gt;&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;System.Web.Mvc &lt;/strong&gt;&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;System.Web.Routing&lt;/strong&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC Web Role Windows Azure" border="0" alt="ASP.Net MVC Web Role Windows Azure" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_9f34c473-b440-4a12-82ca-e8d8c52cfca7.png" width="251" height="255" /&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;That’s it. You can run the application to make sure that it is running on the &lt;strong&gt;Development Fabric&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC Web Role Windows Azure" border="0" alt="ASP.Net MVC Web Role Windows Azure" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_b4175024-90c5-49db-ae63-303b599985d6.png" width="480" height="309" /&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Creating an ASP.Net MVC Web Role using a Project Template&lt;/p&gt;  &lt;p&gt;Thanks to a great word done by the community, we can use a project template to do all the above steps for us. Here’s how to do this:&lt;/p&gt;  &lt;p&gt;1. Download the project template from Codeplex at &lt;a href="http://c4mvc.codeplex.com/"&gt;http://c4mvc.codeplex.com/&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC Web Role Windows Azure" border="0" alt="ASP.Net MVC Web Role Windows Azure" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_40e0ece2-06d7-49f3-878b-c800f99aaf0e.png" width="286" height="214" /&gt; &lt;/p&gt;  &lt;p&gt;2. Create a new project and select the &lt;strong&gt;Azure ASP.Net MVC&lt;/strong&gt; template in the &lt;strong&gt;Community for MVC&lt;/strong&gt; category.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC Web Role Windows Azure" border="0" alt="ASP.Net MVC Web Role Windows Azure" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_e872dc55-5843-480e-af21-5af2a468c3a1.png" width="480" height="377" /&gt; &lt;/p&gt;  &lt;p&gt;This creates a new &lt;strong&gt;Cloud Service for Windows Azure with ASP.Net MVC Application as a Web Role&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC Web Role Windows Azure" border="0" alt="ASP.Net MVC Web Role Windows Azure" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/ASP.NetMVConWindowsAzureAS.NetMVCWebRole_12C7F/image_ed99fda9-ed48-489b-8e83-fd53cc5fa24b.png" width="158" height="305" /&gt; &lt;/p&gt;  &lt;p&gt;Enjoy!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9637361" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/bursteg/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category><category domain="http://blogs.msdn.com/bursteg/archive/tags/ASP.Net+MVC/default.aspx">ASP.Net MVC</category><category domain="http://blogs.msdn.com/bursteg/archive/tags/Windows+Azure/default.aspx">Windows Azure</category></item><item><title>New Release for Oxite: An ASP.Net MVC Sample Application</title><link>http://blogs.msdn.com/bursteg/archive/2009/02/16/new-release-for-oxite-an-asp-net-mvc-sample-application.aspx</link><pubDate>Mon, 16 Feb 2009 21:20:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9426251</guid><dc:creator>Guy Burstein</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/bursteg/comments/9426251.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bursteg/commentrss.aspx?PostID=9426251</wfw:commentRss><wfw:comment>http://blogs.msdn.com/bursteg/rsscomments.aspx?PostID=9426251</wfw:comment><description>&lt;h1&gt;New Release for Oxite: An ASP.Net MVC Sample Application&lt;/h1&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px 0px 0px 15px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="oxite" border="0" alt="oxite" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/NewReleaseOxite2009.2.15_11C00/oxite_ead0d084-353c-4b7e-9f3a-6a982a7e4d35.png" width="160" height="79" /&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Oxite&lt;/strong&gt; is a sample &lt;strong&gt;ASP.Net MVC application&lt;/strong&gt;, that provides guidance, extensions and best practices for building ASP&lt;strong&gt;.Net MVC applications&lt;/strong&gt;. The famous application built using &lt;strong&gt;Oxite&lt;/strong&gt; is &lt;a href="http://visitmix.com/"&gt;MIX Online&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;The new release contains architecture improvements and new features:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;New Model, Services and Repositories &lt;/li&gt;    &lt;li&gt;Dependency Injection (Routes, Controllers, Services, Repositories, etc) &lt;/li&gt;    &lt;li&gt;ActionFilter Registry &lt;/li&gt;    &lt;li&gt;Better test coverage &lt;/li&gt;    &lt;li&gt;New validation class added &lt;/li&gt;    &lt;li&gt;Improved background services architecture &lt;/li&gt;    &lt;li&gt;Projects cleaned up and consolidated &lt;/li&gt;    &lt;li&gt;Views cleaned up &lt;/li&gt;    &lt;li&gt;No more *.cs or *.cs.designer for views in web project &lt;/li&gt;    &lt;li&gt;Now works in a sub directory &lt;/li&gt;    &lt;li&gt;New admin dashboard &lt;/li&gt;    &lt;li&gt;New and update (from last version) SQL scripts included &lt;/li&gt;    &lt;li&gt;Many other small features, improvements and bug fixes &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Download &lt;strong&gt;Oxite source code&lt;/strong&gt; from &lt;a href="http://www.codeplex.com/oxite/Release/ProjectReleases.aspx?ReleaseId=23315"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Enjoy!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9426251" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/bursteg/archive/tags/ASP.Net+MVC/default.aspx">ASP.Net MVC</category></item><item><title>Create a Strongly Typed CRUD UI With ASP.Net MVC RC</title><link>http://blogs.msdn.com/bursteg/archive/2009/02/03/create-a-strongly-typed-crud-ui-with-asp-net-mvc-rc.aspx</link><pubDate>Tue, 03 Feb 2009 10:16:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9392813</guid><dc:creator>Guy Burstein</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/bursteg/comments/9392813.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bursteg/commentrss.aspx?PostID=9392813</wfw:commentRss><wfw:comment>http://blogs.msdn.com/bursteg/rsscomments.aspx?PostID=9392813</wfw:comment><description>&lt;h1&gt;Create a Strongly Typed CRUD UI With ASP.Net MVC RC&lt;/h1&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px 0px 0px 25px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC List, Details, Create and Edit" border="0" alt="ASP.Net MVC List, Details, Create and Edit" align="right" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/CreateaStronglyTypedCRUDUIWithA.NetMVCRC_12E68/ASP.Net_ab39fab9-93f6-405f-a6d6-060579364402.jpg" width="320" height="61" /&gt;In this post I will show the tooling enhancements in ASP.Net MVC that lets you build &lt;strong&gt;CRUD&lt;/strong&gt; (&lt;strong&gt;List, Details, Create and Edit&lt;/strong&gt;) actions very fast. With a little amount of code we can create a good starting point for building a data entry application using &lt;strong&gt;ASP.Net MVC&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;1. Prepare the database. In this sample I am using the &lt;a href="http://blogs.microsoft.co.il/files/folders/220879/download.aspx"&gt;Leasing&lt;/a&gt; database, that contains 3 tables. Download the schema and create the database.&lt;/p&gt;  &lt;p&gt;2. Create a new &lt;strong&gt;ASP.Net MVC Application&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;3. Create the &lt;strong&gt;Model&lt;/strong&gt;. In this samples I am using LINQ to SQL, but you can choose any other business object representation. Add a new LINQ to SQL Data Model to the &lt;strong&gt;Model&lt;/strong&gt; folder in the MVC application project, and drag the relevant tables from the &lt;strong&gt;Server Explorer&lt;/strong&gt; into the ORM Designer. This creates classes that represent the tables and relationships in the database.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC List, Details, Create and Edit" border="0" alt="ASP.Net MVC List, Details, Create and Edit" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/CreateaStronglyTypedCRUDUIWithA.NetMVCRC_12E68/image_ca2c14c5-3c1e-47bc-9ff2-df9f706a28ae.png" width="480" height="156" /&gt; &lt;/p&gt;  &lt;p&gt;4. Create a new controller. Right click the &lt;strong&gt;Controllers&lt;/strong&gt; folder in the MVC application, choose &lt;strong&gt;Add&lt;/strong&gt; and select the &lt;strong&gt;Controller&lt;/strong&gt; item.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC List, Details, Create and Edit" border="0" alt="ASP.Net MVC List, Details, Create and Edit" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/CreateaStronglyTypedCRUDUIWithA.NetMVCRC_12E68/image_8e1eb54b-0808-48ad-b746-b6bb4bd8c41d.png" width="480" height="264" /&gt; &lt;/p&gt;  &lt;p&gt;Provide a name for the controller, check the “&lt;strong&gt;Add action methods for Create, Update and Details scenarios&lt;/strong&gt;”, and click &lt;strong&gt;Add&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC List, Details, Create and Edit" border="0" alt="ASP.Net MVC List, Details, Create and Edit" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/CreateaStronglyTypedCRUDUIWithA.NetMVCRC_12E68/image_3e7a6fe5-693a-4e10-b05d-e9b79eb7e2cc.png" width="320" height="137" /&gt; &lt;/p&gt;  &lt;p&gt;This creates a new controller, and creates the methods for the above actions. We will explore those actions as we move on.&lt;/p&gt;  &lt;p&gt;5. Add a link to the Vehicles module. Open the master page (&lt;strong&gt;Site.Master&lt;/strong&gt; under the &lt;strong&gt;Views\Shared&lt;/strong&gt; folder), and locate the links for &lt;strong&gt;Home&lt;/strong&gt; and &lt;strong&gt;About&lt;/strong&gt;.&lt;/p&gt;  &lt;div style="font-family: consolas; background: white; color: black; font-size: 12pt"&gt;   &lt;pre style="margin: 0px"&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;&amp;lt;&lt;/span&gt;%&lt;span style="color: blue"&gt;= &lt;/span&gt;&lt;span style="color: red"&gt;Html.ActionLink&lt;/span&gt;(&amp;quot;&lt;span style="color: blue"&gt;Home&lt;/span&gt;&amp;quot;,&lt;span style="color: blue"&gt; &lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Index&lt;/span&gt;&amp;quot;,&lt;span style="color: blue"&gt; &lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Home&lt;/span&gt;&amp;quot;)%&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;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&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;&amp;lt;&lt;/span&gt;%&lt;span style="color: blue"&gt;= &lt;/span&gt;&lt;span style="color: red"&gt;Html.ActionLink&lt;/span&gt;(&amp;quot;&lt;span style="color: blue"&gt;About&lt;/span&gt;&amp;quot;,&lt;span style="color: blue"&gt; &lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;About&lt;/span&gt;&amp;quot;,&lt;span style="color: blue"&gt; &lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Home&lt;/span&gt;&amp;quot;)%&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;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Add a third link to the Vehicles module:&lt;/p&gt;

&lt;div style="font-family: consolas; background: white; color: black; font-size: 12pt"&gt;
  &lt;pre style="margin: 0px"&gt;&lt;pre style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&lt;/span&gt;&lt;/pre&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;&amp;lt;&lt;/span&gt;%&lt;span style="color: blue"&gt;= &lt;/span&gt;&lt;span style="color: red"&gt;Html.ActionLink&lt;/span&gt;(&amp;quot;&lt;span style="color: blue"&gt;Vehicles&lt;/span&gt;&amp;quot;,&lt;span style="color: blue"&gt; &lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Index&lt;/span&gt;&amp;quot;,&lt;span style="color: blue"&gt; &lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;Vehicles&lt;/span&gt;&amp;quot;)%&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;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Now, If you run the application, you should see a link on the upper menu.&lt;/p&gt;

&lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC List, Details, Create and Edit" border="0" alt="ASP.Net MVC List, Details, Create and Edit" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/CreateaStronglyTypedCRUDUIWithA.NetMVCRC_12E68/image_37cf5289-af5e-471b-8ead-7947a73f15ce.png" width="480" height="360" /&gt; &lt;/p&gt;

&lt;h3&gt;Implement the List Action: Display a list of Model Items (Vehicles)&lt;/h3&gt;

&lt;p&gt;1. Create a member of type &lt;strong&gt;VehiclesDataContext&lt;/strong&gt; in the controller. We will use this context to access the database.&lt;/p&gt;

&lt;div style="font-family: consolas; background: white; color: black; font-size: 12pt"&gt;
  &lt;pre style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;VehiclesController&lt;/span&gt; : &lt;span style="color: #2b91af"&gt;Controller&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;{&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; &lt;span style="color: #2b91af"&gt;VehiclesDataContext&lt;/span&gt; db = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;VehiclesDataContext&lt;/span&gt;();&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; &lt;span style="color: green"&gt;//&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; &lt;span style="color: green"&gt;// GET: /Vehicles/&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; ...&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;2. In the &lt;strong&gt;Index&lt;/strong&gt; method, query the database for the list of vehicles using a LINQ query. Then, return a view with the results.&lt;/p&gt;

&lt;div style="font-family: consolas; background: white; color: black; font-size: 12pt"&gt;
  &lt;pre style="margin: 0px"&gt;&lt;span style="color: green"&gt;// GET: /Vehicles/&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ActionResult&lt;/span&gt; Index()&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;{&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; &lt;span style="color: blue"&gt;var&lt;/span&gt; query = &lt;span style="color: blue"&gt;from&lt;/span&gt; v &lt;span style="color: blue"&gt;in&lt;/span&gt; db.Vehicles&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;select&lt;/span&gt; v;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; &lt;span style="color: blue"&gt;return&lt;/span&gt; View(query);&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;3. Create a corresponding View. Right click the code editor somewhere inside this method and choose the &lt;strong&gt;Add View&lt;/strong&gt; context item.&lt;/p&gt;

&lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC List, Details, Create and Edit" border="0" alt="ASP.Net MVC List, Details, Create and Edit" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/CreateaStronglyTypedCRUDUIWithA.NetMVCRC_12E68/image_a18a763c-6b93-45ad-a169-d8bb726072fe.png" width="358" height="127" /&gt; &lt;/p&gt;

&lt;p&gt;This will open the &lt;strong&gt;Add View&lt;/strong&gt; dialog that lets you choose the view properties before it is generated. In this dialog, check “&lt;strong&gt;Create strongly-typed view&lt;/strong&gt;” and select the &lt;strong&gt;Vehicle&lt;/strong&gt; class from the List. Then, in the &lt;strong&gt;View content&lt;/strong&gt; field, select &lt;strong&gt;List&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC List, Details, Create and Edit" border="0" alt="ASP.Net MVC List, Details, Create and Edit" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/CreateaStronglyTypedCRUDUIWithA.NetMVCRC_12E68/image_6ae34d9f-db26-49ca-ba22-101c2f47dd1f.png" width="309" height="320" /&gt; &lt;/p&gt;

&lt;p&gt;After you click &lt;strong&gt;Add&lt;/strong&gt;, Visual Studio will generate a view that displays a table with the vehicles details.&lt;/p&gt;

&lt;p&gt;If you now run the project, and click the Vehicles link in the top menu, you should get a list of vehicles like this one:&lt;/p&gt;

&lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC List, Details, Create and Edit" border="0" alt="ASP.Net MVC List, Details, Create and Edit" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/CreateaStronglyTypedCRUDUIWithA.NetMVCRC_12E68/image_831186c3-1520-49f6-8df9-864dee5474d4.png" width="480" height="320" /&gt; &lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;h3&gt;Implement the Details Action: Display the details of a Model Item (Vehicle)&lt;/h3&gt;

&lt;p&gt;1. In the controller’s &lt;strong&gt;Details&lt;/strong&gt; method, use the id parameter to query the database for the specific vehicle. Then, return a view with the result.&lt;/p&gt;

&lt;div style="font-family: consolas; background: white; color: black; font-size: 12pt"&gt;
  &lt;pre style="margin: 0px"&gt;&lt;span style="color: green"&gt;// GET: /Vehicles/Details/5&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ActionResult&lt;/span&gt; Details(&lt;span style="color: blue"&gt;int&lt;/span&gt; id)&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;{&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; &lt;span style="color: #2b91af"&gt;Vehicle&lt;/span&gt; v = db.Vehicles.Single(vh =&amp;gt; vh.VehicleID == id);&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; &lt;span style="color: blue"&gt;return&lt;/span&gt; View(v);&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;2. Create a corresponding View. Right click the code editor, and select the &lt;strong&gt;Add View&lt;/strong&gt; option. In the dialog, make sure that it is strongly-typed and the View content is &lt;strong&gt;Details&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;3. Link from the list view to the details view. Each row in the list view had a &lt;strong&gt;Details&lt;/strong&gt; link. To pass the id of the vehicle to the details action, open the Index view (Views\Vehicles\Index.aspx) and locate the &lt;strong&gt;Details&lt;/strong&gt; and &lt;strong&gt;Edit&lt;/strong&gt; links:&lt;/p&gt;

&lt;div style="font-family: consolas; background: white; color: black; font-size: 12pt"&gt;
  &lt;pre style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;td&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt; Html.ActionLink(&amp;quot;Edit&amp;quot;, &amp;quot;Edit&amp;quot;, new { /* id=item.PrimaryKey */ }) &lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt; |&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt; Html.ActionLink(&amp;quot;Details&amp;quot;, &amp;quot;Details&amp;quot;, new { /* id=item.PrimaryKey */ })&lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;td&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Remove the comment from the third parameter of the ActionLink, and pass the vehicle ID:&lt;/p&gt;

&lt;div style="font-family: consolas; background: white; color: black; font-size: 12pt"&gt;
  &lt;pre style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;td&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt; Html.ActionLink(&amp;quot;Edit&amp;quot;, &amp;quot;Edit&amp;quot;, new {&amp;#160; id = item.VehicleID&amp;#160; }) &lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt; |&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt; Html.ActionLink(&amp;quot;Details&amp;quot;, &amp;quot;Details&amp;quot;, new { id = item.VehicleID })&lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;td&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;4. Run the application, and click the &lt;strong&gt;Vehicles&lt;/strong&gt; link to display a list of vehicles. Then click on the &lt;strong&gt;Details&lt;/strong&gt; link of the first vehicle to display its details.&lt;/p&gt;

&lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC List, Details, Create and Edit" border="0" alt="ASP.Net MVC List, Details, Create and Edit" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/CreateaStronglyTypedCRUDUIWithA.NetMVCRC_12E68/image_04c2a473-3693-4b46-b911-a1a4132c045c.png" width="480" height="376" /&gt; &lt;/p&gt;

&lt;h3&gt;Implement the Edit Action: Edit the details of a Model Item (Vehicle)&lt;/h3&gt;

&lt;p&gt;1. Notice that the controller has 2 overloads of the &lt;strong&gt;Edit&lt;/strong&gt; action:&lt;/p&gt;

&lt;div style="font-family: consolas; background: white; color: black; font-size: 12pt"&gt;
  &lt;pre style="margin: 0px"&gt;&lt;span style="color: green"&gt;// GET: /Vehicles/Edit/5&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ActionResult&lt;/span&gt; Edit(&lt;span style="color: blue"&gt;int&lt;/span&gt; id)&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;{&lt;br /&gt;  ...&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;}&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&lt;span style="color: green"&gt;// POST: /Vehicles/Edit/5&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;[&lt;span style="color: #2b91af"&gt;AcceptVerbs&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;HttpVerbs&lt;/span&gt;.Post)]&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ActionResult&lt;/span&gt; Edit(&lt;span style="color: blue"&gt;int&lt;/span&gt; id, &lt;span style="color: #2b91af"&gt;FormCollection&lt;/span&gt; collection)&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;{&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; ...&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;The first one is for getting the vehicle details in order to display then in the View. When the user clicks the submit button, a POST message will call the second overload with the form data.&lt;/p&gt;

&lt;p&gt;2. Get the details of the vehicle to display in the view. This implementation is identical to the Display action implementation.&lt;/p&gt;

&lt;div style="font-family: consolas; background: white; color: black; font-size: 12pt"&gt;
  &lt;pre style="margin: 0px"&gt;&lt;span style="color: green"&gt;// GET: /Vehicles/Edit/5&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ActionResult&lt;/span&gt; Edit(&lt;span style="color: blue"&gt;int&lt;/span&gt; id)&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;{&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; &lt;span style="color: #2b91af"&gt;Vehicle&lt;/span&gt; v = db.Vehicles.Single(vh =&amp;gt; vh.VehicleID == id);&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; &lt;span style="color: blue"&gt;return&lt;/span&gt; View(v);&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;3. Create a corresponding view, and make sure to select &lt;strong&gt;Edit&lt;/strong&gt; as the View content.&lt;/p&gt;

&lt;p&gt;4. Implement the Save action. In the second overload of the Edit method, get the data out of the &lt;strong&gt;FormCollection&lt;/strong&gt; instance, and apply it the the vehicle. Then save the changes to the DB, and display the list.&lt;/p&gt;

&lt;div style="font-family: consolas; background: white; color: black; font-size: 12pt"&gt;
  &lt;pre style="margin: 0px"&gt;&lt;span style="color: green"&gt;// POST: /Vehicles/Edit/5&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;[&lt;span style="color: #2b91af"&gt;AcceptVerbs&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;HttpVerbs&lt;/span&gt;.Post)]&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ActionResult&lt;/span&gt; Edit(&lt;span style="color: blue"&gt;int&lt;/span&gt; id, &lt;span style="color: #2b91af"&gt;FormCollection&lt;/span&gt; collection)&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;{&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; &lt;span style="color: #2b91af"&gt;Vehicle&lt;/span&gt; v = db.Vehicles.Single(vh =&amp;gt; vh.VehicleID == id);&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; v.Cargo = &lt;span style="color: blue"&gt;int&lt;/span&gt;.Parse(collection[&lt;span style="color: #a31515"&gt;&amp;quot;Cargo&amp;quot;&lt;/span&gt;]);&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; v.Category = &lt;span style="color: blue"&gt;int&lt;/span&gt;.Parse(collection[&lt;span style="color: #a31515"&gt;&amp;quot;Category&amp;quot;&lt;/span&gt;]);&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; v.MaxSpeed = &lt;span style="color: blue"&gt;int&lt;/span&gt;.Parse(collection[&lt;span style="color: #a31515"&gt;&amp;quot;MaxSpeed&amp;quot;&lt;/span&gt;]);&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; ...&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; db.SubmitChanges();&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; &lt;span style="color: blue"&gt;return&lt;/span&gt; RedirectToAction(&lt;span style="color: #a31515"&gt;&amp;quot;Index&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;5. Enable the &lt;strong&gt;Edit&lt;/strong&gt; link in the &lt;strong&gt;Details&lt;/strong&gt; View. Open the Details View (&lt;strong&gt;Views\Vehicles\Details.aspx&lt;/strong&gt;) and locate the Edit link at the bottom. Then, remove the comment from the third parameter of the ActionLink, and pass the vehicle ID:&lt;/p&gt;

&lt;div style="font-family: consolas; background: white; color: black; font-size: 12pt"&gt;
  &lt;pre style="margin: 0px"&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;Html.ActionLink(&amp;quot;Edit&amp;quot;, &amp;quot;Edit&amp;quot;, new { id = Model.VehicleID }) &lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;5. Run the application, and click the &lt;strong&gt;Vehicles&lt;/strong&gt; link to display a list of vehicles. Then, click on the &lt;strong&gt;Edit&lt;/strong&gt; link of the first vehicle to display its details for editing:&lt;/p&gt;

&lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC List, Details, Create and Edit" border="0" alt="ASP.Net MVC List, Details, Create and Edit" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/CreateaStronglyTypedCRUDUIWithA.NetMVCRC_12E68/image_d259e135-834a-4230-b2a6-7da560a84120.png" width="480" height="460" /&gt; &lt;/p&gt;

&lt;p&gt;Change the values of the vehicle and click &lt;strong&gt;Save&lt;/strong&gt;. The updated values will be displayed in the list of vehicles.&lt;/p&gt;

&lt;h3&gt;Implement the Create Action: Create a new Model Item (Vehicle)&lt;/h3&gt;

&lt;p&gt;1. Notice that the Create method has 2 overloads as well. Again, one is to do any work before the Create View is shown and the other is to respond to the POST message and insert the data to the database.&lt;/p&gt;

&lt;p&gt;2. Create the Create View using the &lt;strong&gt;Add View&lt;/strong&gt; context item in the code editor. Make sure to select &lt;strong&gt;Create&lt;/strong&gt; in the &lt;strong&gt;View content&lt;/strong&gt;. In this sample you don’t have to change the logic in the Create method, since no data is necessary for creating a new vehicle.&lt;/p&gt;

&lt;p&gt;3. Implement the second overload of the &lt;strong&gt;Create&lt;/strong&gt; method. Extract the data from the &lt;strong&gt;FormCollection&lt;/strong&gt; instance, and build a new instance of &lt;strong&gt;Vehicle&lt;/strong&gt;. Then, add it to the database, and return to the list.&lt;/p&gt;

&lt;div style="font-family: consolas; background: white; color: black; font-size: 12pt"&gt;
  &lt;pre style="margin: 0px"&gt;&lt;span style="color: green"&gt;// GET: /Vehicles/Create&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ActionResult&lt;/span&gt; Create()&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;{&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; &lt;span style="color: blue"&gt;return&lt;/span&gt; View();&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;}&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&lt;span style="color: green"&gt;// POST: /Vehicles/Create&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;[&lt;span style="color: #2b91af"&gt;AcceptVerbs&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;HttpVerbs&lt;/span&gt;.Post)]&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ActionResult&lt;/span&gt; Create(&lt;span style="color: #2b91af"&gt;FormCollection&lt;/span&gt; collection)&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;{&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; &lt;span style="color: #2b91af"&gt;Vehicle&lt;/span&gt; v = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Vehicle&lt;/span&gt;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; {&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; MaxSpeed = &lt;span style="color: blue"&gt;int&lt;/span&gt;.Parse(collection[&lt;span style="color: #a31515"&gt;&amp;quot;MaxSpeed&amp;quot;&lt;/span&gt;]),&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; Model = collection[&lt;span style="color: #a31515"&gt;&amp;quot;Model&amp;quot;&lt;/span&gt;],&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;    ...&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; };&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; db.Vehicles.InsertOnSubmit(v);&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; db.SubmitChanges();&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;&amp;#160; &lt;span style="color: blue"&gt;return&lt;/span&gt; RedirectToAction(&lt;span style="color: #a31515"&gt;&amp;quot;Index&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre style="margin: 0px"&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;4. Run the application, and click the &lt;strong&gt;Vehicles&lt;/strong&gt; link to display a list of vehicles. Then, scroll to the buttom of the page and click on the &lt;strong&gt;Create New&lt;/strong&gt; link. This will show a new form that collects the details of a vehicle.&lt;/p&gt;

&lt;p&gt;&lt;img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ASP.Net MVC List, Details, Create and Edit" border="0" alt="ASP.Net MVC List, Details, Create and Edit" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/CreateaStronglyTypedCRUDUIWithA.NetMVCRC_12E68/image_a7c8841f-86bf-4a4d-987a-fa55c72e42a2.png" width="480" height="426" /&gt; &lt;/p&gt;

&lt;p&gt;Once you filled the data, click &lt;strong&gt;Create&lt;/strong&gt;, and the new vehicle will be displayed in the list.&lt;/p&gt;

&lt;h3&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;The tooling enhancements in &lt;strong&gt;ASP.Net MVC RC&lt;/strong&gt; makes creating &lt;strong&gt;CRUD&lt;/strong&gt; (&lt;strong&gt;List, Details, Create and Edit&lt;/strong&gt;) actions very fast. With a little amount of code we have created a good starting point for building a data entry application using &lt;strong&gt;ASP.Net MVC&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9392813" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/bursteg/archive/tags/LINQ+to+SQL/default.aspx">LINQ to SQL</category><category domain="http://blogs.msdn.com/bursteg/archive/tags/ASP.Net+MVC/default.aspx">ASP.Net MVC</category></item></channel></rss>