Adding UrlHelper to UmbracoUserControl
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
using System;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
using System.Web.UI;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Services;
|
||||
@@ -68,5 +71,17 @@ namespace Umbraco.Web
|
||||
{
|
||||
get { return ApplicationContext.DatabaseContext; }
|
||||
}
|
||||
|
||||
private UrlHelper _url;
|
||||
/// <summary>
|
||||
/// Returns a UrlHelper
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This URL helper is created without any route data and an empty request context
|
||||
/// </remarks>
|
||||
public UrlHelper Url
|
||||
{
|
||||
get { return _url ?? (_url = new UrlHelper(new RequestContext(new HttpContextWrapper(Context), new RouteData()))); }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user