Telerik.Web.Mvc.UI.GridUrlBuilder.Url C# (CSharp) Метод

Url() публичный Метод

public Url ( INavigatable navigatable ) : string
navigatable INavigatable
Результат string
        public string Url(INavigatable navigatable)
        {
            RouteValueDictionary routeValues = PrepareRouteValues(navigatable.RouteValues);

            return navigatable.GenerateUrl(grid.ViewContext, grid.UrlGenerator, routeValues);
        }

Same methods

GridUrlBuilder::Url ( INavigatable navigatable, Action configurator ) : string
GridUrlBuilder::Url ( INavigatable navigatable, string key, object value ) : string
GridUrlBuilder::Url ( RouteValueDictionary routeValues ) : string

Usage Example

        public void SerializeTo(string key, IClientSideObjectWriter writer)
        {
            if (Enabled)
            {
                Func<string,string> encoder = (string url) => grid.IsSelfInitialized ? HttpUtility.UrlDecode(url) : url;

                var urlBuilder = new GridUrlBuilder(grid);

                var urls = new Dictionary<string, string>();

                urls["selectUrl"] = encoder(urlBuilder.Url(Select));

                if (Insert.HasValue())
                {
                    urls["insertUrl"] = encoder(urlBuilder.Url(Insert));
                }

                if (Update.HasValue())
                {
                    urls["updateUrl"] = encoder(urlBuilder.Url(Update));
                }

                if (Delete.HasValue())
                {
                    urls["deleteUrl"] = encoder(urlBuilder.Url(Delete));
                }

                writer.AppendObject(key, urls);
            }
        }