⬆️ ⬇️

ASP.NET MVC Preview 5 released

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:



')

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.

Source: https://habr.com/ru/post/38457/



All Articles