Popular Posts
Enable SSL connection for Jsoup import org.jsoup.Connection; import org.jsoup.Jsoup; import javax.net.ssl.*; import java.io.IOException; import java.security.KeyManagement... LogonUser Function : impersonate a windows user // This sample demonstrates the use of the WindowsIdentity class to impersonate a user. // IMPORTANT NOTES:  // This sample can be run only ... Build an OpenVPN server on android device Preparation An android device, in this case, Sony xperia Z is used Root permission required Linux Deploy for deploy i...
Stats
Action attributes
  • AcceptVerbsAttribute

    Represents an attribute that specifies which HTTP verbs an action method will respond to.
    [AcceptVerbs(HttpVerbs.Get)]
    public ActionResult Index() { return View(); }
    [AcceptVerbs("get", "post")]
    public ActionResult Index() { return View(); }
  • ActionFilterAttribute

    Represents the base class for filter attributes.
    public class PermissionFilterAttribute : ActionFilterAttribute
    {
        public override void OnActionExecuted(ActionExecutedContext filterContext)
        {
            base.OnActionExecuted(filterContext);
        }
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            base.OnActionExecuting(filterContext);
        }
        public override void OnResultExecuted(ResultExecutedContext filterContext)
        {
            base.OnResultExecuted(filterContext);
        }
        public override void OnResultExecuting(ResultExecutingContext filterContext)
        {
            base.OnResultExecuting(filterContext);
        }
    }
  • ActionMethodSelectorAttribute

    Represents an attribute that is used to influence the selection of an action method.
    public class RequestSourceFilterAttribute : ActionMethodSelectorAttribute
    {
        public override bool IsValidForRequest(ControllerContext controllerContext, System.Reflection.MethodInfo methodInfo)
        {
            throw new NotImplementedException();
        }
    }
  • ActionNameAttribute

    Represents an attribute that is used for the name of an action.
    [ActionName("Substitute")]
    public ActionResult Index() { return View(); }
  • ActionNameSelectorAttribute

    Represents an attribute that affects the selection of an action method.
    public class RequestSourceFilterAttribute : ActionNameSelectorAttribute
    {
        public override bool IsValidName(ControllerContext controllerContext, string actionName, System.Reflection.MethodInfo methodInfo)
        {
            throw new NotImplementedException();
        }
    }
  • AllowHtmlAttribute

    Allows a request to include HTML markup during model binding by skipping request validation for the property. (It is strongly recommended that your application explicitly check all models where you disable request validation in order to prevent script exploits.)
    [AllowHtml]
    public ActionResult Index() { return View(); }
  • AsyncTimeoutAttribute

    Represents an attribute that is used to set the timeout value, in milliseconds, for an asynchronous method.
    [AsyncTimeout(1000000)] // In milliseconds.
    public ActionResult Index() { return View(); }
  • AuthorizeAttribute

    Represents an attribute that is used to restrict access by callers to an action method.
    [Authorize(Users = "Betty, Johnny", Roles = "Admin, Super User")]
    public ActionResult Index() { return View(); }
    public class ApplicationAuthorizaeAttribute : AuthorizeAttribute
    {
        protected override bool AuthorizeCore(HttpContextBase httpContext)
        {
            return base.AuthorizeCore(httpContext);
        }
        protected override void HandleUnauthorizedRequest(AuthorizationContext filterContext)
        {
            base.HandleUnauthorizedRequest(filterContext);
        }
        public override void OnAuthorization(AuthorizationContext filterContext)
        {
            base.OnAuthorization(filterContext);
        }
        protected override HttpValidationStatus OnCacheAuthorization(HttpContextBase httpContext)
        {
            return base.OnCacheAuthorization(httpContext);
        }
    }
  • ChildActionOnlyAttribute

    Represents an attribute that is used to indicate that an action method should be called only as a child action.
    [ChildActionOnly]
    public ActionResult Index() { return View(); }
    @{Html.RenderAction("Index");}
  • FilterAttribute

    Represents the base class for action and result filter attributes.
    public class BaseFileter : FilterAttribute
    {
        public override bool IsDefaultAttribute()
        {
            return base.IsDefaultAttribute();
        }
        public override bool Match(object obj)
        {
            return base.Match(obj);
        }
    }
  • HandleErrorAttribute

    Represents an attribute that is used to handle an exception that is thrown by an action method.
    [HandleError(Master = "Site", View = "Error", ExceptionType = typeof(NullReferenceException))]
    public ActionResult Index() { return View(); }
  • HttpDeleteAttribute

    Represents an attribute that is used to restrict an action method so that the method handles only HTTP DELETE requests.
    [HttpDelete]
    public ActionResult Index() { return View(); }
  • HttpGetAttribute

    Represents an attribute that is used to restrict an action method so that the method handles only HTTP GET requests.
    [HttpGet]
    public ActionResult Index() { return View(); }
  • HttpPostAttribute

    Represents an attribute that is used to restrict an action method so that the method handles only HTTP POST requests.
    [HttpPost]
    public ActionResult Index() { return View(); }
  • HttpPutAttribute

    Represents an attribute that is used to restrict an action method so that the method handles only HTTP PUT requests.
    [HttpPut]
    public ActionResult Index() { return View(); }
  • NonActionAttribute

    Represents an attribute that is used to indicate that a controller method is not an action method.
    [NonAction]  // Prevent called from url
    public void InnerCall() { Response.Write("Hello InnerCall"); Response.End(); }
  • OutputCacheAttribute

    Represents an attribute that is used to mark an action method whose output will be cached.
    [OutputCache(Duration = 60, VaryByParam = "page")]
    public ActionResult Index() { return View(); }
  • RequireHttpsAttribute

    Represents an attribute that forces an unsecured HTTP request to be re-sent over HTTPS.
    [RequireHttps]
    public ActionResult Index() { return View(); }
  • SessionStateAttribute

    Specifies the session state of the controller.
    [SessionState(System.Web.SessionState.SessionStateBehavior.Required)]
    public ActionResult Index() { return View(); }
  • ValidateInputAttribute

    Represents an attribute that is used to mark action methods whose input must be validated.
    [ValidateInput(false)]
    public ActionResult Index() { return View(); }