namevaluecollection Questions

34

Solved

I've got the URI like this: https://google.com.ua/oauth/authorize?client_id=SS&response_type=code&scope=N_FULL&access_type=offline&redirect_uri=http://localhost/Callback I need a c...
Jessabell asked 27/11, 2012 at 20:11

6

Solved

ASP.NET For each appSetting I use, I want to specify a value that will be returned if the specified key isn't found in the appSettings. I was about to create a class to manage this, but I'm thinki...

8

Solved

I have a NameValueCollection, and want to iterate through the values. Currently, I’m doing this, but it seems like there should be a neater way to do it: NameValueCollection nvc = new NameValueCol...
Wry asked 21/2, 2011 at 12:30

12

I know i can do this var nv = HttpUtility.ParseQueryString(req.RawUrl); But is there a way to convert this back to a url? var newUrl = HttpUtility.Something("/page", nv);
Quire asked 5/10, 2010 at 17:4

7

Solved

Very simple I'm sure, but driving me up the wall! There is a component that I use in my web application that identifies itself during a web request by adding the header "XYZComponent=true" - the pr...

4

Solved

I tried: NameValueCollection Data = new NameValueCollection(); Data.Add("foo","baa"); string json = new JavaScriptSerializer().Serialize(Data); it returns: ["foo"] I expected {"foo" : "baa"} ...
Thermotensile asked 9/8, 2011 at 22:19

12

Solved

Is there a quick and simple way to check if a key exists in a NameValueCollection without looping through it? Looking for something like Dictionary.ContainsKey() or similar. There are many ways t...
Edea asked 26/3, 2012 at 8:18

1

Solved

I am developing an ASP.Net Web API project. In my project, I am trying to return JSON from action in this format. { "Apple": null, "Microsoft": null, "Google": 'htt...
Estrella asked 11/12, 2016 at 15:27

3

Solved

I’m trying to help my son upgrade a web site I built for him last year. He wants to implement Amazon Simple Pay. I’m SO close to getting it, but have an error that I don’t know how to address. It’s...
Jesher asked 24/4, 2013 at 20:54

0

I'm using .Net Standard 1.5 and want to read some values out of my config. However the following line ConfigurationManager.AppSettings["Foo"] gives me the following compile time error: CS7069...

7

Solved

Trying to copy values from an existing NameValueCollection object to a Dictionary. I have the following code below to do that but seems the Add does not accept that my keys and values are as String...
Mcwhorter asked 14/5, 2013 at 17:57

7

Solved

How to make NameValueCollection accessible to LINQ query operator such as where, join, groupby? I tried the below: private NameValueCollection RequestFields() { NameValueCollection nvc = new Nam...
Alben asked 24/12, 2008 at 8:28

7

Solved

I have the following code: string Keys = string.Join(",",FormValues.AllKeys); I was trying to play around with the get: string Values = string.Join(",", FormValues.AllKeys.GetValue()); But of...
Mellie asked 6/8, 2011 at 13:38

5

Solved

.Net's System.Web.HttpUtility class defines the following function to parse a query string into a NameValueCollection: public static NameValueCollection ParseQueryString(string query); Is there ...
Tabernacle asked 9/4, 2010 at 5:30

4

Solved

Suppose I have an anonymous class instance var foo = new { A = 1, B = 2}; Is there a quick way to generate a NameValueCollection? I would like to achieve the same result as the code below, witho...
Breadthways asked 15/5, 2010 at 0:18

2

Solved

How to key all values from NameValueCollection as a single string, Now I am using following method to get it: public static string GetAllReasons(NameValueCollection valueCollection) { string _all...
Flong asked 29/1, 2014 at 13:21

3

Solved

How can I convert a Dictionary<string, string> to a NameValueCollection? The existing functionality of our project returns an old-fashioned NameValueCollection which I modify with LINQ. The ...
Gudrin asked 29/8, 2011 at 12:56

6

Solved

What kind of collection I should use to convert NameValue collection to be bindable to GridView? When doing directly it didn't work. Code in aspx.cs private void BindList(NameValueCollection nvp...
Soundless asked 20/10, 2008 at 2:13

2

Solved

I want to have the following structure in my config: <MySection> <add key="1" value="one" /> <add key="2" value="two" /> <add key="3" value="three" /> </MySection&...
Rarefy asked 19/9, 2011 at 12:52

2

Solved

How do I sort a namevaluecollection in alphabetical order? Do I have to cast it to another list first like the sorted list or Ilist or something? If then how do I do that? right now I have all my s...
Barberabarberry asked 4/11, 2010 at 20:40

3

Solved

Possible Duplicate: IDictionary<string, string> or NameValueCollection Any reason I should use Dictionary<string,string> instead of NameValueCollection? (in C# / .NET Framew...
Sihonn asked 8/6, 2010 at 20:39

4

Solved

I have two classes as follows: public class Info { [XmlAttribute] public string language; public int version; public Book book; public Info() { } public Info(string l, int v, string auth...
Parnassian asked 23/9, 2009 at 9:56

4

Solved

I am new to C#. Here is a hard-coded thing I got working: InputProperty grantNumber = new InputProperty(); grantNumber.Name = "udf:Grant Number"; grantNumber.Val = "571-1238"; Update update = new...
Iolanthe asked 19/3, 2009 at 18:22

2

I am looking for an easy way to sort NameValueCollection on the basis of key - it should not be a performance heavy though.
Meteor asked 9/3, 2009 at 19:59
1

© 2022 - 2024 — McMap. All rights reserved.