Пример #1
0
            internal string UrlPathEncode(string value)
            {
                if (string.IsNullOrEmpty(value))
                {
                    return(value);
                }

                // recurse in case there is a query string
                var i = value.IndexOf('?');

                if (i >= 0)
                {
                    return(UrlPathEncode(value.Substring(0, i)) + value.Substring(i));
                }

                // encode DBCS characters and spaces only
                return(HttpEncoderUtility.UrlEncodeSpaces(UrlEncodeNonAscii(value, Encoding.UTF8)));
            }
        protected internal override void Render(HtmlTextWriter output)
        {
            Page page = this.Page;

            if (page == null)
            {
                throw new HttpException(System.Web.SR.GetString("Form_Needs_Page"));
            }
            if (page.SmartNavigation)
            {
                ((IAttributeAccessor)this).SetAttribute("__smartNavEnabled", "true");
                StringBuilder builder = new StringBuilder("<IFRAME id=\"__hifSmartNav\" name=\"__hifSmartNav\" style=\"display:none\" src=\"");
                builder.Append(HttpEncoderUtility.UrlEncodeSpaces(HttpUtility.HtmlAttributeEncode(this.Page.ClientScript.GetWebResourceUrl(typeof(HtmlForm), "SmartNav.htm"))));
                builder.Append("\"></IFRAME>");
                output.WriteLine(builder.ToString());
            }
            base.Render(output);
        }
Пример #3
0
        protected internal override void Render(HtmlTextWriter output)
        {
            Page p = Page;

            if (p == null)
            {
                throw new HttpException(SR.GetString(SR.Form_Needs_Page));
            }

#pragma warning disable 0618    // To avoid deprecation warning
            if (p.SmartNavigation)
            {
#pragma warning restore 0618
                ((IAttributeAccessor)this).SetAttribute("__smartNavEnabled", "true");

                // Output the IFrame
                StringBuilder sb = new StringBuilder("<IFRAME id=\"__hifSmartNav\" name=\"__hifSmartNav\" style=\"display:none\" src=\"");
                sb.Append(HttpEncoderUtility.UrlEncodeSpaces(HttpUtility.HtmlAttributeEncode(Page.ClientScript.GetWebResourceUrl(typeof(HtmlForm), "SmartNav.htm"))));
                sb.Append("\"></IFRAME>");
                output.WriteLine(sb.ToString());
            }

            base.Render(output);
        }