That night came the next Preview ASP.NET MVC at number 5.
Who is impatient, goes to download with
Codeplex release itself.
And to whom it is interesting, reads changes under a habrakat.
UPD: So Scott Guthrie unsubscribed:
ASP.NET MVC Preview 5 and Form Posting Scenarios . The post covers more changes related to sending data to the server, validation, updating data. He himself is healthy, he just went on vacation for a month and a half :)
According to Phil Haack, this Preview was not planned to be released, but the project made some significant changes, therefore, expect feedback from developers and run-in. The next release will be the official Beta, which is good news.
So far they give for a test drive what they have and predict about possible changes in the API and their improvement in the Beta version. The names of the classes have settled down, it already pleases.
In the Release Notes themselves write the following:
- Added global registration mappings. Now the controller is not responsible for this, but if you wish, you can return it from the ViewResult method to draw the desired display.
- The IViewEngine interface has been changed to render partial views. Now you can call the <% Html.RenderPartial (...) method from the helper; %>. This method does not return a string, but draws a display using a TextWriter.
- In the DropDown List, you can specify the item that will be selected by default.
- ASP.NET AJAX methods are placed in a separate namespace.
- Added helper methods for RadioButton and TextArea. Some other methods were also changed, some were added to overloads, some of them were superfluous, and some conflicts were eliminated.
- Action methods can now take arrays as parameters.
- Removed the ActionMethod property from the action filter object
- Now it is possible to transfer complex types to Action methods, marking them with a special attribute.
- The controller is no longer directly connected to the ControllerActionInvoker class, instead it now operates on the IActionInvoker interface, which will add extensibility to our applications.
- The UpdateMode method has been added to the controller, which can be used to update our model object with the data obtained from the query for example.
- Changes have been made to HandleErrorAttribute, which allow us to see the usual ASP.NET page with errors (“yellow page of death”, as it was called :)), at the design stage. This gives us much more useful information than the error page that is shown to the end user.
')
Intersnyh changes we can see in our Action-methods. First, we can specify the name of our action through the [ActionName (“MyAction”)] attribute, which may differ from the actual method name. Now we can call our methods more extensively and understandably for developers, but leaving them short and understandable for URLs. It should be noted that the code now will have to write the name that we specified in the attribute, and not really the name of the method. For example:
<% = Url.Action ("[name given in attribute]")%>
Added another attribute AcceptVerb. Now we can have, for example, two overloaded methods (Action), the first of which will receive parameters via GET, and the second will be overloaded and receive parameters via POST. It is implemented like this:
[AcceptVerbs ( "GET" )]
public ActionResult Edit ( string id)
{
return View ();
}
[AcceptVerbs ( "POST" )]
public ActionResult Edit ( string id, FormCollection form)
{
// Save the item and redirect ...
}
* This source code was highlighted with Source Code Highlighter .
Everything is written on the
Phil Haack blog and
CodePlex website. We are still waiting for the post from Scott Guthrie in his
blog . I myself have not yet set, only after the weekend I will do it.
Ps. Articles on ASP.NET MVC were hampered for personal reasons and working circumstances (partly changing jobs). The site from the example has already been written and works, as free time appears, I will definitely share my experience and write on this topic.