Class ErrorController

A generic Error Display class that can be used to display standalone error messages with a single line of code.

Depends on a Error.cshtml view which is passed an ErrorViewModel as a parameter

System.Object
  System.Web.Mvc.ControllerBase
    System.Web.Mvc.Controller
      Westwind.Web.Mvc.BaseController
        Westwind.Web.Mvc.ErrorController
public class ErrorController : BaseController

Class Members

MemberDescription

Constructor

CauseError

public ActionResult CauseError()

ShowError

Displays a generic error message

public ActionResult ShowError(string title,     string message,     string redirectTo,     bool isHtml)

ShowErrorFromModel

Displays a generic error message but allows passing a view model directly for additional flexibility

public ActionResult ShowErrorFromModel(ErrorViewModel errorModel)

ShowErrorPage

Static method that can be called from outside of MVC requests (like in Application_Error) to display an error View.

public static void ShowErrorPage(string title,     string message,     string redirectTo)

public static void ShowErrorPage(ErrorViewModel errorModel)

ShowErrorPageFromView

Allows you to display an arbitrary view and pass an optional ErrorViewModel for it. In short it's a shortcut way to just execute a custom view.

public static void ShowErrorPageFromView(string viewPage,     ErrorViewModel errorModel)

ShowErrorPageResult

Static method that can be called from outside of MVC requests (like in Application_Error) to display an error View.

public static ActionResult ShowErrorPageResult(string title,     string message,     string redirectTo,     bool isHtml)

public static ActionResult ShowErrorPageResult(ErrorViewModel errorModel)

ShowErrorViewPage

This method allows displaying an error page you specify and pass an optional ErrorViewModel as a parameter

public ActionResult ShowErrorViewPage(string viewPage,     ErrorViewModel errorModel)

ShowMessage

public ActionResult ShowMessage(string title,     string message,     string redirectTo,     bool isHtml)

ShowMessagePageResult

Static method that can be called from outside of MVC requests (like in Application_Error) to display an error View.

public static ActionResult ShowMessagePageResult(string title,     string message,     string redirectTo,     bool isHtml)

public static ActionResult ShowMessagePageResult(ErrorViewModel errorModel)

Requirements

Namespace: Westwind.Web.Mvc
Assembly: westwind.web.mvc.dll

© West Wind Technologies, 1996-2016 • Updated: 12/12/15
Comment or report problem with topic