text: .
  ASP.NET MVC 3 “Preview 1” includes a bunch of view-specific improvements.
  :
  With these first two changes the above Browse template will be able to be written as simply:
  The above template syntax will be supported in a future preview refresh. Full colorization and code-intellisense will be provided within the editor.
  ASP.NET MVC 3 “Preview 1” includes several nice controller-specific enhancements..
  ASP.NET MVC 3 provides better support for applying Dependency Injection (DI) and integrating with Dependency Injection/IOC containers.
  In “Preview 1”, we’ve added support for dependency injection in the following places:
  For future previews we are investigating adding dependency injection support for::
  Click here to download a simple ASP.NET MVC 3 example that demonstrates how to use the popular Ninject Dependency Injection Container with ASP.NET MVC 3.
  P.S. In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu
  Great...this will go miles ahead.
  Awesome!, great work.
  Mike
  Hi Scott! Kudos to all the team! Great work, it seems delicious! Is the roadmap already known?
  Ok. It's time to learn about ASP.NET MVC. Very good work.
  The changes all look great, Scott. But do you need Visual Studio 2010 for MVC3 or will it work in 2008?
  Great....nice to hear
  Cool! It is really getting better!
  This is great! Love the new view engine.
  Has someone verified whether this works under Mono on Linux?
  Thanks!
  Will you be fixing [ValidateInput(false)] to work with the new ASP.NET 4 input validation pipeline? Currently ValidateInput(false) is broken unless you set <httpRuntime requestValidationMode="2.0" /> in the config.
  Are you guys on meth?? MVC is just rocking!!
  Scott, will future previews include improvments around Doughnut & Doughnut Hole caching?
  I'm glad it's backwards compatible. These releases are coming really quickly.
  Love the JSON binding!
  Awesome, Scott!
  One question: how about source codes of MVC3 P1?
  I see @RenderBody, but is there a way to render arbitralely code blocks?
  For instance, a certain view might need a specific javascript include, which should appear in the head of the html.
  // Ryan
  Awesome set of improvements. Really like the JSON binding and DI improvements. Thanks!
  Well done! Hope the final version will be out there sooner than March 2011?!?
  It's very cool. Love new View engines and Dynamic ViewModel property.
  Love most everything. Hate the dynamic ViewModel (at least so far). There's no type checking, so why make the syntax look like there is?
  Maybe NotFound() helper method will be better? Ex.: return NotFound();
  Any chance of sneaking a SkipFilter attribute in there?
  Great job! Awesome job! A couple of questions, Scott: 1) Is there any intention of adding syntax highlight and intellisense for Razor on the IDE? 2) How can do the tooling aware of the view engines I have "installed" on my computer?
  Congratulations on the release of MVC3. Looking forward to the final product.
  Scott, these are great improvements! I really love how Microsoft keeps coming out with timely, incremental updates!
  Now, if only the MVC library properly supported the DLR languages, IronPython & IronRuby...).
  Thanks Scott,
  DBML support here? If e goes EDMX..
  @Alan, Version 3.0 will sell more "Professional ASP.NET MVC 3" books by Guthrie et al. It should be 2.5 at most.
  @Dan,
  >>>>>>>>>>> The changes all look great, Scott. But do you need Visual Studio 2010 for MVC3 or will it work in 2008?
  ASP.NET MVC 3 takes a dependency on .NET 4 (for a lot of the features I listed above), so you do need VS 2010 since that is the only version of VS that works with .NET 4. You can though use Visual Web Developer 2010 Express (which is free) if you don't have VS 2010 installed.
  @Anon,
  >>>>>>>>> Has someone verified whether this works under Mono on Linux?
  It should work. I don't know of someone who has tried it yet - but it should work.
  @korggy,
  >>>>>>>>> Will you be fixing [ValidateInput(false)] to work with the new ASP.NET 4 input validation pipeline? Currently ValidateInput(false) is broken unless you set <httpRuntime requestValidationMode="2.0" /> in the config.
  Thanks for the suggestion - I'll forward it along to the team.
  Thanks,
  @lynn,
  >>>>>>>>>>> Scott, will future previews include improvments around Doughnut & Doughnut Hole caching?
  That is something we'll be looking at. Better caching helpers are on the list to make better.
  @Vladimir,
  >>>>>>>>>> One question: how about source codes of MVC3 P1?
  I'm not sure whether it is available for download today - but it is definitely coming soon.
  Great work !
  Can't wait for the colorization. The views looks so ... naked :-)
  I can't get the Ninject sample to work though.
  In NinjectServiceLocator.cs -> GetInstance(Type serviceType, string key) I get the following exception.
  Error activating IControllerFactory
  No matching bindings are available, and the type is not self-bindable.
  Am I missing something obvious here ?
  Linda
  Really like that ViewData now makes use of the dynamic type.
  @Ryan,
  >>>>>>>> I see @RenderBody, but is there a way to render arbitralely code blocks? For instance, a certain view might need a specific javascript include, which should appear in the head of the html.
  You can provide optional overrides and use the @RenderSection() helper to fill in other regions of the page. You could this approach to accomplish this I think.
  @John,
  >>>>>>>> Any chance of sneaking a SkipFilter attribute in there?
  Can you send me email (scottgu@microsoft.com) with more details about this suggestion? I can then forward it onto the team.
  @Allan,
  >>>>>>>> Great job! Awesome job! A couple of questions, Scott: 1) Is there any intention of adding syntax highlight and intellisense for Razor on the IDE?
  Yes - full code intellisense and colorization support will be provided in VS wit the next preview refresh.
  >>>>>>>> 2) How can do the tooling aware of the view engines I have "installed" on my computer?
  View engines can add appropriate templates into a specific folder which will cause them to show up within the Add->View dialog.
  @Alan,
  >>>>>>>>>).
  We have even more features coming - today's refresh was just the first preview. :)
  Hi Scott,
  Would it be possible to include also into dialog for create controller the template choosing? so that we could have our own templates like crud template, complicated crud template, empty controller template and such?
  Also, do you have plans to make better the current display and editor templates (e.g. include a dropdownlist template which takes data from viewdata, and selects the current item from viewdata model)?
  Vladan Strigo
  Good Job!
  the developer story continues to be one of the best stories comming from microsoft these days. We just transitioned our app to MVC2 and its paid off in spades. The razor engine and the next version of MVC look to improve what we have already.
  Thanks Scott, been waiting for this release!
  If you want HTML colorization with .cshtml files in VS2010. Try these steps:
  1. Open Tools menu.
  2. Choose Options.
  3. Go to Text Editor, and third choice; File Extension.
  4. Enter cshtml as Extension and choose HTML Editor in the dropdown.
  5. Click Add and OK. Now try to open a .cshtml file – you should get HTML colorization.
  It sure helps on the eyes!.
  Cheers
  In the view engine dropdown, one of the options is ASPX (C#).
  Does that mean that there is no support for ASPX (VB)?
  Can you define client side validation for IValidatableObject like you would for custom validation attributes?
  Nice to see HTML5 doctype, but I would prefer lowercase version <!doctype html>
  @Vladan,
  >>>>>>>> Would it be possible to include also into dialog for create controller the template choosing? so that we could have our own templates like crud template, complicated crud template, empty controller template and such?
  That is definitely something we'd like to do - although we aren't sure just yet where it fits on the schedule.
  >>>>>>> Also, do you have plans to make better the current display and editor templates (e.g. include a dropdownlist template which takes data from viewdata, and selects the current item from viewdata model)?
  I'll kick off a thread with the team on that - I agree it would be great to try and make that easier.
  @Andreas
  >>>>>> If you want HTML colorization with .cshtml files in VS2010. Try these steps:
  Good tip!
  @dicoo,
  >>>>>>>.
  I'll definitely be blogging more about some cool WebForms features in the weeks ahead as well. Stay tuned.
  @Socrates470BC
  >>>>>>>>> In the view engine dropdown, one of the options is ASPX (C#). Does that mean that there is no support for ASPX (VB)?
  The project I was in was a C# project - which was why only C# options showed up by default in the Add->View dialog. If you create a VB ASP.NET MVC project then you'll see the VB templates show up in place of the C# ones. VB is definitely supported for both .aspx and Razor templates.
  Are there any plans for having a class attribute that dictates which request it is bound from? For example, a search/maintenance form scenario, I might search by name (all get requests), I edit a record and the name of the posted record is now populating my search state object, even though the search state is still in the get request.
  Regards,
  Andrew
  Great update. Congratulations.
  Can't get the JSON binding to work, though? Is there some sample code anywhere?
  Great to see you are keeping up the momentum!
  Any news on the RESTful web services support that was trialled in MVC Futures? Also, what about razor supportting intellisense against an arbitary schema, not just HTML/CSS/JavaScript?
  Piers
  Just spotted the comment regarding HTML Colorization in VS2010... using the "XML (Text) Editor" would give me what I want in terms of defining a schema... but what would be really cool would be if a Power Tool update for VS2010 allowed you to enter Extensions into that Tool/Options/Text Editor/File Extension dialog of the form xml.cshtml. Unfort. it doesn't like the additional period :-(
  Will razor be available for mvc 2.0? Or only 3.0?
  As said by Chris Scott I also not able to get the JSON binding to work. Do you have some sample?.
  Wonderfull! ASP.NET MVC 2 is great, but with Razor and other features is Very Great!
  Nice Work! the new view engine it's fantastic! and more easy to work with.
  When are you going to support intellisense on razor views?
  Tuesday, July 27, 2010 8:57 PM by Gene
  ----------------------------------------------------------
  Will there be any final release of any of the new features (especially Razor) before 3.0?
  Amazing stuff btw, keep it up!
  "oh no" - damn, another newer release haunts another...
  it's pretty hard to keep up with new technology changes in asp.net and around it (including mvc, wcf, linq, entity framework, odata and so on and on) if you (still) have to implement big web applications and have to realize new ordered projects.
  nowadays i think it could be a full time job itself just to keep up with all the new .net technologies by reading only a few .net team members blogs like yours, scott.
  hopefully the more evolving "convention over configuration" principle will make a lot of it easier very soon, including new APIs, versions, technologies and libraries.
  do you have any plans on finishing with your mvc 2 blog series: weblogs.asp.net/.../asp-net-mvc-2.aspx ?
  you really should improve this website/blog - at least:
  - people should find blog series (MVC2; ASP.NET 4.0; ASP.NET 3.5; 3.5 SP1; Linq ...) more easyly ("categorie/blog series" links or something like that - the tag cloud isn't working very well for this)
  - add a published-date to every post
  thanks for blogging, tobi
  Firstly, Thanks for the update and great work from you and your team.
  Had an issue getting the new JSON binding to work. Had to register JsonValueProviderFactory manually within global.asax...
  ValueProviderFactories.Factories.Add(new JsonValueProviderFactory());
  I may have missed something but this works.
  Thanks.
  do you know when the ASP.NET MVC 3.0 Final Release will be available?
  Thanks.
  Luigi
  MVC 3.0 introduced already and it's been less than a year and half since MVC 1.0 was released!! Does this mean I have to upgrade my website again? MVC team I appreciate all that you guys are doing and these features look awesome... but can you give the community a chance to come to grips with all the features of one version before bringing out a major version upgrade? Every time it happens it makes a lot of our code obsolete!!
  Is there any way of using a razor view from an HttpHandler instead of a controller action? I am working on a web application which needs some needs to send several rendered templates sequentially on the same HTTP Response (in a multipart/x-mixed-replace stream). Currently, I am using Spark to do this and I would like to switch to razor if I can.
  Is there any way i can do this?
  Thank you,
  George Steel
  What about "@name" type of content? For example, throughout these comments, participants are saying stuff to each other using "@username" as notation, which is content. Will we have to use @"@"username or some other lame workaround? I suppose this would really be a corner case scenario since usually such content is data-driven / dynamic, not static.
  Thanks for sharing such an awsome article on MVC .I am happy to download and install that immeditely.
  I am about to release another version of NDjango editor extension with better intellisense support for strongly typed models. You made me think that it might make sense to provide an integration with ASP.NET MVC 3. I will need some information though - i.e. how can I have my template wizard access the model name selected in add view dialog. Any advice on where to get such information?
  @Scott
  >>>>>>>>View engines can add appropriate templates into a specific folder which will cause them to show up within the Add->View dialog.
  What folder would be that?
  Scott,
  Great article, as always. Between the dynamic viewdata, Razor view engine, improved DI support, and global action filters, this is starting to feel like the best parts of Rails + the best parts of .NET rolled tidily into one.
  One thing that felt a bit off & out of place to me is the PermanentRedirectXXX methods the team added to controllers. The permanentRedirectResult is a very useful result to have, in certain niche scenarios. It doesn't strike me as something that's as commonly useful as ViewResult, JsonResult, or regular RedirectResults. Since it's not likely to be as commonly used, it feels like you're bloating the controller w/ methods for no good reason, especially when you could accomplish the same thing by just adding a default parameter onto the existing redirect methods, something like isPermanent=false (since you're already dependant on 4.0...)
  Anyway, just my nitpick. Looks great!
  Good work! A few notes through.
  1. Adding global namespaces to pages through web.config (<pages><namespaces><add namespace="Web.UI.Helpers" />), don't seem to be honored. I have to use @using in each view instead.
  2. Is global filters better then just using a base controller with all the filters on it?
  Wonderful to see Asp .Net MVC 3 Preview 1 and Razor in action.
  Scott, please please please do not forget to include the ability to return multiple views in mvc3 - I am hoping this will come in a future release? Without it, everything that mvc stands for is taken away. Thanks.
  Great article.
  Thank you.
  Coool :)
  I am still trying to learn MVC2 but MVC3 is already out....
  Scott take Vacation.......)
  Wow... good job man..
  MVC3 will be just .NET4 ?
  Am i missing something? where is the source code?
  Hey Scott,
  How about a few inbuilt filters for helping users implement PRG pattern? I am sure it would be appreciate quite a lot (ViewData -> TempData and back... or any other recommended way)
  Karan
  I vote for the donut caching and solid support for binding of non-consecutive collection indexes (not the hidden field with .index) for the next version..
  Is there any plans to integrate the subcontroller concept into MVC 3.0? This was an MVCContrib addon for 1.0, wasn't available in 2.0 and isn't available in 3.0 either. I'm sorry, but Areas and Partial Views are just not the same thing.
  I know there's debates about whether a partial view is the same as a user control or not, but the surely it's a common requirement to share view AND controller logic across several different parent controllers?
  I hope that it will support MEF as an option for DI. I realize it doesnt do things like a typical IoC would do, but there is some real potential for setting up the pieces to be as imports, and we simply setup our versions as Exports and if set a setting on the Global Code to tell it to use MEF, it simply pulls in the exports. Thoughts?
  Looks very much similar to Classic ASP, can this be integrated with VS 2008 ?
  Great stuff Scott. Any chance of posting this in VB for those of us who prefer a language syntax that doesn't resemble pig latin?
  I have seen one of you video in which u said that ASP.net MVC is like Bike while
  ASP.net webforms can be considered as CAR. Diffference depends upon requirements
  of project and size perhaps.
  So, i basically wants to know that with this release of MVC , does it comes somewhat
  more closer to web forms in terms of capabilities.
  May be little awkward question but i think i cant get exact words to elaborate what
  really i want to ask.But i hope u got what i m trying to ask? :)
  I know you've tried hard to gives the "dynamic" View (in the page) and ViewModel (in the controller action) the same name, but I think you should try harder. The disparity in names between "View" and "ViewModel" is a bit misleading and confusing, why not go with "ViewModel" in action and view.
  That's my only complaint after seeing all the cool stuff you've done. Can't wait to play with preview2
  I think you should integrate T4MVC in asp.net mvc.
  Good. My team is studing MVC2, I think it is significant to us to understand our direction.
  Any plans to beef up test automation for mvc 3? its one area that rails still has the edge.
  gr8 work.
  Scott, you develop faster than I can learn - I haven't finished Steve Sanderson's MVC 2 book yet! Actually I'm only reading that to concrete up my experience so keep it up and BRING IT ON!
  I would ask that the display and editor templates are improved upon in MVC3. These have the potential to be really useful, but they're not really ready for the big time in MVC2 in my opinion. E.g. Better support for dropdowns in the editor, better support for editing complex objects.
  What no Xml Action Result? I probably missed something, and I'm newish to it but in MVC2 I can auotgenerate JSON from a LINQ expression but not XML ?
  This is looking great. I like the built-in JSON binding. This will definitely make my work easier in the future.
  Thank you for the great preview.
  I would ask for ways to write controller logic without having hard dependency on the Httpcontext(May be with help of Dependency Injection). This will help to write clean controllers without any dependency on the httpContext, and helps in which in turn helps in writing more testable controllers.
  I like these enhancements, I live MVC, but I still like ASP.NET WebForms.
  What I really want is a mix.... I want to be able to create pages where:
  1. I have complete control over the markup and my markup could be literal javascript objects if that's what I want or standard html markup.
  2. Controls to produce markup or at least a framework that allows me to create them.
  3. I'm NOT tied to the FORMS model.
  4. Testability like MVC has.
  5. Friendly urls.
  6. Access to the same HttpContext across threads.
  7. Designer support.
  8. The ability to embed and use views (pages, user controls) from external assemblies (built into the framework).
  Good work, please keep it up and don't forget, enhancing the end developers ability to be productive AND in control is what really adds value to the .NET web technologies platform. After all, this was the premise of ASP.NET WebForms. Unfortunately, the constraints that were eventually evident were not fixed, we were just given yet another technology to learn with MVC but there is still something missing in my opinion.
  Really it looks very much exciting. Razor will rock.
  Love the Razor engine. However, when used with Areas, VS2010 errors out when choosing the view engine. Also, how do you solve the situation below? I want the output to display num0, num1, & num2.
  @{
  for (var i = 0; i < 3; i++)
  {
  <p>num@i</p>
  }
  }
  I figured it out.
  <p>num@(@i)</p>
  Hopefully you guys will manage to include intellisense support for razor in preview 2 :)
  Cool new features!! I also like the new model validation options. It would be perfect if the annotations, inter atribute and inter object rules could be defined in a consistent way in the designer and then generated to code. Or even dynamically evalute linq expressions or wwf rules.
  good stuff!!
  Hi, Will you be fixing [ValidateInput(false)] to work with the new ASP.NET 4 input validation pipeline? Currently ValidateInput(false) is broken unless you set <httpRuntime requestValidationMode="2.0" />
  Great job. Razor and MVC3 appears it will be a great.
  Hello, I really like the new Razor engine, but I have a question, how can I import a namespace from inside a view??.
  I'll probably be doing a blog post about getting my app upgraded. Until then ping me if you get these errors:
  No parameterless constructor defined for this object.
  Downloading the source to both Ninject and Ninject.Web.Mvc, upgrading them to .NET 4.0 and then recompiling is what worked for me. I couldn't get the NinjectServiceLocator in the sample provided to work. So I stuck with inheriting NinjectHttpApplication in global.asax.cs
  @Christopher,
  >>>>>>>.
  You shouldn't have had to-do much to upgrade your application. What issue are you seeing?
  For future reference, you can use this tool to upgrade apps automatically: weblogs.asp.net/.../migrating-asp-net-mvc-2-applications-to-asp-net-mvc-3-preview-1.aspx
  We'll have better upgrade support built-into the box with later previews.
  I recently came across something weird when trying to globalize an asp.net mvc 3 preview 1 application. Does this version not support Data Annotations from .NET 4.0? It seems like the DisplayAttribute is not being localized properly ( only using english resource file ). See further information here
  stackoverflow.com/.../localizing-the-fields-attributes-on-the-accountmodel-for-asp-net-mvc
  will there be a future package like there was for ASP.NET MVC 2 whereas you could do:
  ModelMetadataProviders.Current = new DataAnnotations4ModelMetadataProvider();
  DataAnnotations4ModelValidatorProvider.RegisterProvider();
  To solve that problem?
  Thanks
  Hi Scott,
  I wonder what is the reason to not to have REST URL?
  Instead of: /Store/UpdateProduct/ post
  This: /store/product put
  I'm having issue after using the converter. My strongly typed views beleive their models are of type object and not the class passed in. Getting
  'object' does not contain a definition for ...
  Anyone else?
  Any plan to add support for localization (similar to implicit localization in WebForm)/globalization, and theme?
  Any plan to add support for localization (similar to implicit localization in WebForm)/globalization and theme?
  Does the integrated DI support result in an abstraction of HttpContext (such as Request, Session, and Form )from the Controller?
  This all looks really great! My most desired feature here, is to please allow the razor view engine to receive multiple variables, instead of just one called "Model". So, for example, in my controller I could say:
  List<Category> cats = Categories.find(all);
  List<Product> prods = Products.find(all);
  Then, in the view, I would have two variables, cat & prod, that could be referenced like so:
  @cats List<Category>
  @prods List<Product>
  Not being able to access variables in the view that are created in the model creates a feeling of isolation inside the view, as though its not an actual part of the app, but rather an add-on. Maybe this could be accomplished through some metadata in the controller that would mark variables as being available in the view like so:
  [ViewAccessible]
  Then, the variables wouldn't even need to be re-declared in the view, but they would just be directly accessible by name.
  @Tyler,
  >>>>>>> This all looks really great! My most desired feature here, is to please allow the razor view engine to receive multiple variables, instead of just one called "Model".
  Unfortunately this is a little hard to do - since C#/VB doesn't currently allow dynamic properties except by referencing a variable of type dynamic. That is why you can do @View.Cats and @View.Prods within the razor view template, but not just @Cats and @Prods.
  Sorry!
  >> his all looks really great! My most desired feature here, is to please allow the razor view engine to receive multiple variables, instead of just one called "Model".
  Yeah, I second that. In ASP.NET WebForms you can easily pass several variables to the view.
  Here we have to create an enormous amount of ViewModels. Please implement this feature of multi variable passing!
  Great post Scott, I'm really excited about this release.
  It would be great to see an examples of loading Razor templates from a database or separate assembly and also using the Razor parser independently - currently we are using NVelocity and object dictionaries to generate email templates - to swap this out for Razor and a dynamic view model would be sweet.
  Hello Scott, and thank you so much for this exciting stuff!!
  I get an error when I try to run your sample files. The error is random and usually occurs when i run it the first time. The error message is: "Unable to complete operation. The supplied SqlConnection does not specify an initial catalog" I use VWD Express 2010. Any thoughts?
  Awesome work ! I've just upgraded my socialnetwork lifebrixx from MVC 1.0 to 3.0, only small tweak I had to do was remove some of the page imports I'd done as it wouldn't compile.
  All up and running tho, converted any ViewData stuff to use the new dynamic ViewModel.
  Look forward to getting to grips with razor.
  I am asking you - which software do you use to OPEN FILES on a website made in ASPX .CS MVC FRAMEWORK?
  Exciting! Astonishingly good! MVC3 crosses five big items off my wish list. Thank you.
  Does this release address the clunkiness of the master pages? When I say that, I the fact that you have to go around your elbow to have common code in your master page and to pass that data from the db to the master page and not have to do it in every single controller action.
  Looks great!
  Question for you: Currently there is an issue if I have defined a custom validation attribute and I set AllowMultiple = true. This allows me to use the same attribute (with different parameter values) for server-side validation. But the client-side validation code isn't generated properly. Only one entry (the last of the ones defined for a Field) is sent to the client (in the "Fields" array as part of the mvcClientValidationMetadata array).
  I'm hoping this gets fixed in MVC 3 (or before).
  Hi, Is there any plan to come up with a sample Multi Tenant application using MVC3?
  How about this Scott -->
  Introduce a convention for adding extra .css and .js files to a view.
  whereby you would just do something like this at the top of your View.
  @Css.Add("jquery-ui.smoothness","tiny-mce");
  @Js.Add("jquery-ui","editor/tiny-mce");
  Then these extra files could be dynamically inserted at the bottom of the head section without having to create an extra ContentPlaceHolder in the head section of the master template or implement custom code to manage these extra additions. The convention would have to be where the css and Javascript is located in the directory structure similar to the Views convention.
  Great Work so far -> good to see all the new improvements coming in to play.
  I think certain htmlhelpers could do with improving. Definitely dropdownlists - these take too long to set up at the moment for what they are as the IEnumerable<SelectListItem> needs setting up first which can get out of hand for lots of dropdowns. Also an easier way of handling checkboxlists would be good.
  Hi, I dont know if some1 asked before, but what im looking forward the most is Caching, cos Caching in mvc 2 is VERY weak.
  I can't seem to find any information on what's in the MVC 3 futures dll, anyone know?