当前位置: 首页>>代码示例>>C#>>正文


C# NameValueCollection.ToUrlParameterList方法代码示例

本文整理汇总了C#中System.Collections.Specialized.NameValueCollection.ToUrlParameterList方法的典型用法代码示例。如果您正苦于以下问题:C# NameValueCollection.ToUrlParameterList方法的具体用法?C# NameValueCollection.ToUrlParameterList怎么用?C# NameValueCollection.ToUrlParameterList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Collections.Specialized.NameValueCollection的用法示例。


在下文中一共展示了NameValueCollection.ToUrlParameterList方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnPreRender

        protected override void OnPreRender(EventArgs e)
        {
            var parameters = new NameValueCollection();
            parameters.Add("itemId", Request.QueryString["id"]);
            parameters.Add("frame", gridEditorFrame.ClientID);
            parameters.Add("hiddenId", hiddenValue.ClientID);
            parameters.Add("fieldName", FieldName);
            parameters.Add("layoutClass", LayoutClass);

            if (ValidateLayout())
                gridEditorFrame.Attributes.Add("src", "/handlers/GridEditorHandler.aspx?" + parameters.ToUrlParameterList());
            else
                gridEditorFrame.Attributes.Add("src", "/handlers/FixGridLayoutHandler.aspx?" + parameters.ToUrlParameterList());

            base.OnPreRender(e);
        }
开发者ID:jeppe-andreasen,项目名称:Umbraco-Public,代码行数:16,代码来源:LayoutGridWrapper.ascx.cs

示例2: ReplaceUrlParameters

        public static string ReplaceUrlParameters(Dictionary<QueryStringKey, string> replacements)
        {
            var result = CmsService.Instance.CurrentUrl != null ? CmsService.Instance.CurrentUrl.LocalPath : string.Empty;

            var collection = new NameValueCollection(HttpContext.Current.Request.QueryString);
            foreach (var key in replacements.Keys)
                collection[key.ToString()] = replacements[key];
            if (collection.Count > 0)
                result += "?" + collection.ToUrlParameterList();

            return result;
        }
开发者ID:cdrewery,项目名称:Umbraco-Public,代码行数:12,代码来源:Urls.cs

示例3: ReplaceUrlParameter

        public static string ReplaceUrlParameter(QueryStringKey key, string value)
        {
            var result = CmsService.Instance.CurrentUrl != null ? CmsService.Instance.CurrentUrl.LocalPath : string.Empty;

            var collection = new NameValueCollection(HttpContext.Current.Request.QueryString);
            if (value == null)
                collection.Remove(key.ToString());
            else
                collection[key.ToString()] = value;
            if (collection.Count > 0)
                result += "?" + collection.ToUrlParameterList();

            return result;
        }
开发者ID:cdrewery,项目名称:Umbraco-Public,代码行数:14,代码来源:Urls.cs

示例4: OnSearchClicked

 protected void OnSearchClicked(object sender, EventArgs e)
 {
     var url = HttpContext.Current.Request.Url.LocalPath + "?";
     var parameters = new NameValueCollection();
     if (!string.IsNullOrEmpty(txtQuery.Text))
         parameters.Add("query", txtQuery.Text);
     if (!string.IsNullOrEmpty(txtFrom.Text))
         parameters.Add("from", txtFrom.Text);
     if (!string.IsNullOrEmpty(txtTo.Text))
         parameters.Add("to", txtTo.Text);
     if (ddlSubjects.SelectedIndex > 0)
         parameters.Add("subject", ddlSubjects.SelectedItem.Text);
     url += parameters.ToUrlParameterList();
     Response.Redirect(url);
 }
开发者ID:Psolow,项目名称:Umbraco-Public,代码行数:15,代码来源:NewsSearchFilterPart.ascx.cs

示例5: Post

 public static string Post(string url, NameValueCollection values)
 {
     return Post(url, values.ToUrlParameterList());
 }
开发者ID:jeppe-andreasen,项目名称:LinqIt-Libraries,代码行数:4,代码来源:HttpRequestUtil.cs

示例6: CreateChildControls

        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            _hiddenField = new HiddenField();
            _hiddenField.ID = "hiddenValue";
            Controls.Add(_hiddenField);

            _iframe = new HtmlGenericControl("iframe");
            _iframe.ID = "iframe";
            _iframe.Attributes.Add("frameBorder", "0");
            _iframe.Attributes.Add("style", "width:100%");
            _iframe.Attributes.Add("height", Height.ToString());
            _iframe.Attributes.Add("scrolling", "no");
            Controls.Add(_iframe);

            var parameters = new NameValueCollection();

            AddParameters(parameters);

            _iframe.Attributes.Add("src", HandlerUrl + "?" + parameters.ToUrlParameterList());
        }
开发者ID:cdrewery,项目名称:Umbraco-Public,代码行数:21,代码来源:BaseUCEditorWrapper.cs


注:本文中的System.Collections.Specialized.NameValueCollection.ToUrlParameterList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。