what happens behind model passing in ASP MVC4

后端 未结 2 1268
闹比i
闹比i 2021-01-25 20:50

Learning the ASP MVC now, just my 3rd week on MVC

I did some tests on modeling pass, basically the controller just get the model, and pass into the view without doing an

2条回答
  •  囚心锁ツ
    2021-01-25 21:07

    You are showing us the POST-version of the method. Usually, the post action method would take the model, do some kind of processing (input validation, save to db, call a service, etc.), then if success, redirect to a different page.

    You would usually only call the view from the POST action method if you have any problems with the inputs that require the user to fix.

提交回复
热议问题