/// <summary> /// Closes the connection and sets the status code to Unauthorized /// </summary> /// <param name="filterContext">The AuthorizationContext</param> private void ShowMessage(AuthorizationContext filterContext) { HttpResponseBase response = filterContext.HttpContext.Response; if (ShowAtCurrentPage) { throw new ForbiddenExceptionOnCurrentPage(); } else if (ShowInPopup) { Message msg = new Message(MessageConstants.E0002, MessageType.Info); response.Write(msg.ToString()); response.Flush(); response.End(); } else { throw new ForbiddenException(); } }
public ForbiddenExceptionOnCurrentPage() { Message msg = new Message(MessageConstants.E0002, MessageType.Info); this._errorCode = MessageConstants.E0002; this._errorMsg = msg.ToString(); }