Update: Plugin Web Helpers

Web Helpers included in UI Extensions and WebHandlers
This commit is contained in:
Gary Sharp
2013-10-22 13:48:25 +11:00
parent cc218a08e4
commit 0d60fb422c
7 changed files with 166 additions and 130 deletions
+11
View File
@@ -457,6 +457,17 @@ namespace Disco.Services.Plugins
return string.Format("/Plugin/{0}", HttpUtility.UrlEncode(this.Id));
}
}
public string WebActionUrl(string Action)
{
if (!HasWebHandler)
throw new NotSupportedException("This plugin doesn't have a web handler");
var url = UrlHelper.GenerateUrl("Plugin", null, null,
new RouteValueDictionary(new Dictionary<string, object>() { { "PluginId", this.Id }, { "PluginAction", Action } }),
RouteTable.Routes, HttpContext.Current.Request.RequestContext, false);
return url;
}
public Tuple<string, string> WebResourcePath(string Resource)
{