2008-05-29

ASP MVC preview 3 released

I'm trying to upgrade from Preview 2 to Preview 3. I think the idea of having each action return an ActionResult was a good one, so far it has actually made my code slightly smaller.

What I don't understand though is why Html.Select seems to have disappeared...

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1501: No overload for method 'Select' takes '5' arguments

Source Error:

Line 8: Product
Line 9:
Line 10: <%= Html.Select("SoftwareID", (object)ViewData["SoftwareList"], "Name", "ID", (object)ViewData["SoftwareID"]) %>
Line 11:
Line 12:


When I go into the APX and type Html. there is no Select method listed along with the other options! Where is it?

4 comments:

Dmitriy Nagirnyak said...

I think Html.Select is an extension method available from MvcContrib.

You can try to use DropDownList instead.
In controller:
ViewData["SoftwareList"] = new SelectList(
PassListOfSoftwareHere(),
"ID",
"Name");

The view is very simple:
<%= Html.DropDownList("SoftwareList") %>

Dmitriy Nagirnyak said...

Pete, have a look at this forum post.
It really has been replaced with DropDownList and ListBox.

Anonymous said...

That was my post :-)

Thanks for making sure I didn't miss it!


Pete

IC said...

thanks brother