/// <summary>
        /// Generates the link to view.
        /// </summary>
        /// <param name="path">The path.</param>
        /// <param name="fullPath">The full path.</param>
        /// <returns></returns>
        private string GenerateLinkToView(string path, string fullPath)
        {
            // generate url + args
            string hrefArgs = string.Format("{0}?RootFolder={1}&View={2}",
                                            SPSTools.GetCurrentPageBaseUrl(Page),
                                            SPHttpUtility.UrlKeyValueEncode(fullPath),
                                            SPHttpUtility.UrlKeyValueEncode(GetView().ID));

            //  onclick
            string onclick = string.Format("javascript:EnterFolder('{0}');javascript: return false;", hrefArgs);

            string href;

            // different html if we are in list context
            if (IsListContext)
            {
                href = string.Format("<a href=\"{0}\">{1}</a>", hrefArgs, path);
            }
            else
            {
                href = string.Format("<a href=\"{0}\" onclick=\"{1}\">{2}</a>", hrefArgs, onclick, path);
            }

            return(href);
        }
        /// <summary>
        /// Generates the link to view.
        /// </summary>
        /// <param name="path">The path.</param>
        /// <param name="fullPath">The full path.</param>
        /// <returns></returns>
        private string GenerateLinkToView(string path, string fullPath)
        {
            // generate url + args
            string hrefArgs = string.Format("{0}?RootFolder={1}&View={2}",
                                            SPSTools.GetCurrentPageBaseUrl(Page),
                                            //SPHttpUtility.UrlKeyValueEncode(path),
                                            //FIX: 2.8 Ivalid characters
                                            SPHttpUtility.EcmaScriptStringLiteralEncode(
                                                SPHttpUtility.UrlPathEncode(fullPath, false, true)),
                                            SPHttpUtility.UrlKeyValueEncode(GetView().ID));

            //  onclick
            string onclick = string.Format("javascript:EnterFolder('{0}');javascript: return false;", hrefArgs);

            string href;

            // different html if we are in list context

            //if (IsListContext)
            //{
            //    href = string.Format("<a href=\"{0}\">{1}</a>", hrefArgs, path);
            //}
            //else
            {
                href = string.Format("<a href=\"\" onclick=\"{1}\">{2}</a>", hrefArgs, onclick, path);
            }

            return(href);
        }
Beispiel #3
0
        /// <summary>
        /// Generates the link to view.
        /// </summary>
        /// <param name="path">The path.</param>
        /// <returns>
        /// The current page url with the selected folder and view (javascript :EnterFolder)
        /// </returns>
        protected virtual string GenerateLinkToView(string path)
        {
            string hrefArgs = string.Format("{0}?RootFolder={1}&View={2}",
                                            SPSTools.GetCurrentPageBaseUrl(Page),
                                            SPHttpUtility.UrlKeyValueEncode(path),
                                            SPHttpUtility.UrlKeyValueEncode(GetView().ID));

            string url = string.Format("javascript:EnterFolder('{0}');", hrefArgs);

            return(url);
        }
Beispiel #4
0
        /// <summary>
        /// Generates the link to view.
        /// </summary>
        /// <param name="path">The path.</param>
        /// <returns>
        /// The current page url with the selected folder and view (javascript :EnterFolder)
        /// </returns>
        protected virtual string GenerateLinkToView(string path)
        {
            string hrefArgs = string.Format("{0}?RootFolder={1}&View={2}",
                                            SPSTools.GetCurrentPageBaseUrl(Page),
                                            //SPHttpUtility.UrlKeyValueEncode(path),
                                            //FIX: 2.8 Ivalid characters
                                            SPHttpUtility.EcmaScriptStringLiteralEncode(
                                                SPHttpUtility.UrlPathEncode(path, false, true)),
                                            SPHttpUtility.UrlKeyValueEncode(GetView().ID));

            string url = string.Format("javascript:EnterFolder('{0}');", hrefArgs);

            return(url);
        }