Questions tagged [namevaluecollection]

NameValueCollection is a .Net collection of string keys and string values that can be accessed either with by key or by the index.

NameValueCollection is a .Net collection of string keys and string values that can be accessed either with by key or by the index.

References

116 questions
1
vote
1 answer

NameValueCollection to string? Help

The service I've written waits for requests and when one arrives it extracts the querystring, parses it and saves the values in database. However, for some odd reason I cannot use the System.Web.HttpUtility class with windows service. I've tried…
Dragan
  • 3,713
  • 12
  • 42
  • 59
1
vote
1 answer

Disable URL Encoding of Equals sign in a Parameter Value

I have this code below that creates the query parameter collection for a restful web service call NameValueCollection outgoingQueryString = HttpUtility.ParseQueryString(String.Empty); outgoingQueryString.Add("SessionID",…
Tim
  • 1,249
  • 5
  • 28
  • 54
1
vote
3 answers

How can I convert a NameValueCollection to a KeyValuePair

I want to convert a NameValueCollection to a KeyValuePair. Is there a way to do this easily for just a single value in a NameValueCollection? I have this right now but it seems kind of verbose: private KeyValuePair
DannyD
  • 2,732
  • 16
  • 51
  • 73
1
vote
1 answer

How do I update an objects parameters from a NameValueCollection (or similar)?

I am trying to update public parameters of a known type MyClass from a NameValueCollection (see code below). This is possible in MVC3, the Controller class has an UpdateModel method which does exactly this with the Request.Params. I would like to do…
gingerbreadboy
  • 7,386
  • 5
  • 36
  • 62
1
vote
1 answer

Uploading Image to Server from NameValueCollection

I am using ASP.net 4.5 with VB.net This is my TestPage.aspx code <%@ Page Language="VB" MasterPageFile="~/Master.master" AutoEventWireup="false" CodeFile="TestPage.aspx.vb" Inherits="TestPage" %>
Etienne
  • 7,141
  • 42
  • 108
  • 160
1
vote
4 answers

Does this copy the reference or the object?

Sorry, I am being both thick and lazy, but mostly lazy. Actually, not even that. I am trying to save time so I can do more in less time as there's a lot to be done. Does this copy the reference or the actual object data? public class Foo { …
Water Cooler v2
  • 32,724
  • 54
  • 166
  • 336
1
vote
1 answer

Get name/value from field Type "Name Lookup Value List" in Sitecore 7

I am using Sitecore 7.1 . I used one field Type "Name Lookup value List" . I want catch name/value stored in that Field Type in Code behind in MVC . How can I catch the Key value Item .
1
vote
0 answers

wb.UploadValue with NameValueCollection in Objective C

I have a C# code and I want to translate it to objective C. var data = new NameValueCollection(); data["username"] = "abc"; data["password"] = "abc"; wb.UploadValues("https://abc.abc" + loginUrl, "POST", data); I think it is possible over the…
Algoros
  • 21
  • 2
1
vote
0 answers

HTTPPOST with JSON Object having array

below is my json object i need to pass on my server: { "PostImages": [{ "FileFormat": "jpeg", "id": "0", "FileByteArray": "LONG BYTE ARRAY OF FILE", "FileCaption": "", "VideoLink": "" },{ …
Shreyash Mahajan
  • 23,386
  • 35
  • 116
  • 188
1
vote
1 answer

NameValueCollection not available from System.Collections.Specialized

In VS 2012 Express for Windows Phone, I am using imports of both System and System.Collections.Specialized, but I still get an error when trying to use NameValueCollection. Looking in the Object browser, I see it nested within System.dll, but there…
Ryan H
  • 349
  • 1
  • 6
  • 20
1
vote
1 answer

Most elegant way to check to see if a NameValueCollection has value

I have a simple line of code: lead.InternalCompany = nvCollection["ic"]; I want to set lead.InternalCompany to the value retrieved, but if nothing is there to a blank string "" I've tried to use nvCollection["ic"].HasValue(); I know I could do…
Jon Harding
  • 4,928
  • 13
  • 51
  • 96
1
vote
0 answers

Parse JSON to Name Value Collection in c#

i have JSON Collection as Follows [{"name":"SearchText","value":"smith"}] This Collection value i have to change as Name Value Collection Like {"SearchText","smith"}
user2568074
  • 21
  • 1
  • 4
1
vote
3 answers

How to store name value pair in file

I have a large number of name value pair that I need to use in a program. What should be the best way to store the name value pair in a file so that I can easily parse them in my python program. For some reasons we are not using xml. Please suggest…
Abhishek
  • 1,717
  • 6
  • 22
  • 39
1
vote
1 answer

Setting values with commas in namevaluecollection

I am using the following code to access and manipulate query string NameValueCollection qs = HttpUtility.ParseQueryString(Request.Url.Query); qs.Set("OID", "5,6,7"); Response.Redirect( absolutepath + "?" + qs); The problem is that query string…
mko
  • 6,638
  • 12
  • 67
  • 118
1
vote
1 answer

NameValueCollection in Windows Phone 8

I want to use NameValueCollection in windows phone 8, but I can not see this option in WP8 SDK. Can you help me please?