Success message from Controller to View

前端 未结 6 1435
情歌与酒
情歌与酒 2020-12-30 05:05

The goal

I want to display in my view some message when some user is added.

The problem

When something goes wrong in our model, there is a method

6条回答
  •  青春惊慌失措
    2020-12-30 05:09

    Conceptually, I think the answer still holds. If the message is an integral part of the view, it should be part of the ViewModel. TempData is a shortcut for passing data without modifying the ViewModel definition, which some people frown upon.

提交回复
热议问题