MVC 3 Can't pass string as a View's model?

后端 未结 7 1551
忘了有多久
忘了有多久 2021-02-03 16:46

I have a strange problem with my model passed to the View

Controller

[Authorize]
public ActionResult Sth()
{
    return View(\"~/Views/S         


        
7条回答
  •  执笔经年
    2021-02-03 17:22

    Yes you can if you are using the right overload:

    return View("~/Views/Sth/Sth.cshtml" /* view name*/, 
                null /* master name */,  
                "abc" /* model */);
    

提交回复
热议问题