mirror of
https://github.com/rudollee/LearningMVC.git
synced 2026-08-11 16:32:55 +00:00
Ch. 17 Controllers and Actions
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace ControllersAndActions.Infrastructure
|
||||
{
|
||||
public class CustomRedirectResult : ActionResult
|
||||
{
|
||||
public string Url { get; set; }
|
||||
|
||||
public override void ExecuteResult(ControllerContext context)
|
||||
{
|
||||
string fullUrl = UrlHelper.GenerateContentUrl(Url, context.HttpContext);
|
||||
context.HttpContext.Response.Redirect(fullUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user