How to return a view for HttpNotFound() in ASP.Net MVC 3?

前端 未结 6 1052
忘掉有多难
忘掉有多难 2020-11-28 22:47

Is there a way to return the same view every time a HttpNotFoundResult is returned from a controller? How do you specify this view? I\'m guessing configuring a 404 page in

6条回答
  •  情话喂你
    2020-11-28 23:16

    Please follow this if you want httpnotfound Error in your controller

      public ActionResult Contact()
        {
    
            return HttpNotFound();
        }
    

提交回复
热议问题