We can implement the "Edit.aspx" view page using
the following approach:
Figure 36

Note how we are using both the Html.TextBox
and Html.Select helper methods in the sample above. Both of these are
extension methods from the MVCToolkit.dll assembly.
Notice how the Html.Select helper method has
an overloaded version that allows you to specify what the selected value is in
the dropdownlist. In the snippet below I'm indicating that I want the
Category drop down item to be automatically selected based on the edit
product's current CategoryID value:
Figure 37

Lastly - notice how we are using the
Url.Action() helper method to set the <form> element's "action"
attribute:
Figure 38

Both the Url.Action and Html.ActionLink helper methods use
the ASP.NET MVC Framework's Routing Engine to generate URLs (read Part 2 for details on how URL generation works). What
this means is that if we change the routing rules for Edits in our site, we
will not need to change any of the code in our Controller or View. For
example, we could re-map our URLs to use a more RESTful URL like /Products/1/Edit
instead of /Products/Edit/1, and have the above Controller and View continue to
work unmodified.