Redirect from a view to another view

后端 未结 3 363
悲&欢浪女
悲&欢浪女 2020-12-16 10:02

Hi I am trying to redirect from a view to a different view but I get a red squigly in visual studio.How can I redirect from inside a view to another view.This is what I have

3条回答
  •  北荒
    北荒 (楼主)
    2020-12-16 10:27

    Purpose of view is displaying model. You should use controller to redirect request before creating model and passing it to view. Use Controller.RedirectToAction method for this.

提交回复
热议问题