mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-11-01 08:22:35 +01:00
5220de5c66
New: Existing series will be lazy loaded on Add Series page
26 lines
955 B
C#
26 lines
955 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.Mvc;
|
|
using System.Web.Mvc.Ajax;
|
|
|
|
namespace NzbDrone.Web.Helpers
|
|
{
|
|
public static class RenderActionHelper
|
|
{
|
|
public static MvcHtmlString RenderAction(this AjaxHelper helper, string actionName, string controllerName, object routeValues, AjaxOptions ajaxOptions)
|
|
{
|
|
var urlHelper = new UrlHelper(helper.ViewContext.RequestContext);
|
|
|
|
var url = urlHelper.Action(actionName, controllerName, routeValues);
|
|
|
|
var tagBuilder = new TagBuilder("div");
|
|
if (ajaxOptions != null) tagBuilder.MergeAttributes<string, object>(ajaxOptions.ToUnobtrusiveHtmlAttributes());
|
|
tagBuilder.MergeAttribute("data-ajax-action-link", "true");
|
|
tagBuilder.MergeAttribute("data-href", url);
|
|
|
|
return new MvcHtmlString(tagBuilder.ToString(TagRenderMode.Normal));
|
|
}
|
|
}
|
|
} |