Sunday, 18 August 2013

mvc 3 Edit action signature with tabs (multiple id's)

mvc 3 Edit action signature with tabs (multiple id's)

The page consists of several tabs (client tabs made of divs). So, I can
have several edit forms which are the same, and are distinguished by id's.
Each form element (dropdown, textbox) has a differnet Id. I would like to
have the edit form in the same view I have the select form. How should an
edit action signature look like? Should I pass the model as a variable, or
maybe each field individually? Then in the view - should I use TextBoxFor,
DropDownListFor?
The view "ClientDetails" which presents the fields consists of code like
the following:
@Html.TextBoxFor(m => m.ClientName, new { id = "ClientName" +
i.ToString(), @class = "input-large" })
whereas i is an index I pass in the viewbag object and represents the tab
I am working on (the view "ClientDetails" is dedicated for a single tab).

No comments:

Post a Comment