本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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);
}
示例5: Post
public static string Post(string url, NameValueCollection values)
{
return Post(url, values.ToUrlParameterList());
}
示例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());
}