asp.net mvc - MVC Create method data flow -
i think know of basics of mvc there's 1 thing don't understand yet.
in view create generated automatically when set project, how data sent controller? i'm used seeing actionlinks parameters here there's no actionlink can't understand how data travel view controller.
could explain me please?
as know, in view, first line (usually) tells view, model being used within view. like:
@model models.carviewmodel
lets suppose, have form on view, , posted action called edit. must have edit action, expecting parameter of type used model in view. like:
[httppost] public actionresult(carviewmodel model) { //logic }
this convention known strongly typed view. suppose have textbox property name of model as:
@html.textboxfor(x => x.name)
when form posted edit action, variable model in parameter of edit action holding respective values. i.e, model.name
Comments
Post a Comment