Update: Support Ajax and Form Post for Finance
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
|
||||
namespace Disco.Web.Extensions
|
||||
{
|
||||
public static class ControllerExtensions
|
||||
{
|
||||
|
||||
public static ActionResult RedirectToAction(this Controller controller, ActionResult result, string urlFragment)
|
||||
{
|
||||
var callInfo = result.GetT4MVCResult();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(urlFragment))
|
||||
{
|
||||
var url = UrlHelper.GenerateUrl(null, null, null, callInfo.RouteValueDictionary, RouteTable.Routes, controller.HttpContext.Request.RequestContext, false);
|
||||
|
||||
url = string.Concat(url, "#", urlFragment);
|
||||
|
||||
return new RedirectResult(url, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
return new RedirectToRouteResult(callInfo.RouteValueDictionary);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -77,7 +77,7 @@ namespace Disco.Web
|
||||
|
||||
public static MvcHtmlString ToMultilineString(this string s)
|
||||
{
|
||||
return new MvcHtmlString(HttpUtility.HtmlEncode(s).Replace("\n", "<br />").Replace(Environment.NewLine, "<br />"));
|
||||
return new MvcHtmlString(HttpUtility.HtmlEncode(s).Replace(Environment.NewLine, "<br />").Replace("\n", "<br />").Replace("\r", "<br />"));
|
||||
}
|
||||
|
||||
public static List<Tuple<string, ActionResult>> ToBreadcrumb(this HtmlHelper htmlHelper, string title1, ActionResult link1, string title2 = null, ActionResult link2 = null, string title3 = null, ActionResult link3 = null, string title4 = null, ActionResult link4 = null, string title5 = null, ActionResult link5 = null)
|
||||
|
||||
Reference in New Issue
Block a user