Popular Posts
javax.net.ssl.SSLHandshakeException: Connection closed by peer in Android 5.0 Lollipop Recently, there is a error occurs when access website via ssl connection like below although it worked fine several days ago. // Enable SSL... Close window without confirm (I.E only) window.opener=null; window.open('','_self'); window.close(); focus on validating function focusOnInvalidControl() {     for (var i = 0; i < Page_Validators.length; i++) {         if (!Page_Validators[i].isvalid) {     ...
Stats
Action results
  • ActionResult

    Encapsulates the result of an action method and is used to perform a framework-level operation on behalf of the action method.
    public ActionResult Index()
    {
        return Show();
    }
    
    public ActionResult Show()
    {
        return View();
    }
    
  • ContentResult

    Represents a user-defined content type that is the result of an action method.
    public ActionResult Index()
    {
        return Content("Represents a user-defined content type that is the result of an action method.", "text/plain", System.Text.Encoding.UTF8);
    }
  • EmptyResult

    Represents a result that does nothing, such as a controller action method that returns nothing.
    public ActionResult Index()
    {
        return new EmptyResult();
    }
  • FileContentResult

    Sends the contents of a binary file to the response.
    public ActionResult Index()
    {
        //return new FileContentResult(Buffer, "application/pdf");
        return File(Buffer, "application/pdf");
    }
  • FilePathResult

    Sends the contents of a file to the response.
    public ActionResult Index()
    {
        return File(Server.MapPath("~/doc/sample.pdf"), "application/pdf");
    }
  • FileStreamResult

    Sends binary content to the response by using a Stream instance.
    public ActionResult Index()
    {
        using (var ms = new System.IO.MemoryStream())
        {
            TempImage.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
            //return new FileStreamResult(ms, "image/png") { FileDownloadName = "logo.png" };
            return File(ms, "image/png", "logo.png");
        }
    }
  • HttpNotFoundResult

    Defines an object that is used to indicate that the requested resource was not found.
    public ActionResult Index()
    {
        return HttpNotFound("Page not fould");
    }
  • HttpStatusCodeResult

    Provides a way to return an action result with a specific HTTP response status code and description.
    public ActionResult Index()
    {
        return new HttpStatusCodeResult(System.Net.HttpStatusCode.Unauthorized);
    }
  • HttpUnauthorizedResult

    Represents the result of an unauthorized HTTP request.
    public ActionResult Index()
    {
        return new HttpUnauthorizedResult("Please sign in");
    }
  • JavaScriptResult

    Sends JavaScript content to the response.
    public ActionResult Index()
    {
        return JavaScript("alert(new Date());");
    }
  • JsonResult

    Represents a class that is used to send JSON-formatted content to the response.
    public ActionResult Index()
    {
        return Json(new { Message = "Represents a class that is used to send JSON-formatted content to the response." });
    }
  • PartialViewResult

    Represents a base class that is used to send a partial view to the response.
    public ActionResult Index()
    {
        return PartialView();
    }
  • RedirectResult

    Controls the processing of application actions by redirecting to a specified URI.
    public ActionResult Index()
    {
        //return Redirect("/Product");  // 302
        return RedirectPermanent("/Product");  // 301
    }
    Redirect and RedirectPermanent
  • RedirectToRouteResult

    Represents a result that performs a redirection by using the specified route values dictionary.
    public ActionResult Index()
    {
        //return RedirectToAction("Show");
        //return RedirectToActionPermanent("Show");
        //return RedirectToRoute(new { action = "Show" });
        return RedirectToRoute(new { action = "Show" });
    }
  • ViewResult

    Represents a class that is used to render a view by using an IView instance that is returned by an IViewEngine object.
    public ActionResult Index()
    {
        return View();
    }