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
0
votes
1 answer

Overriding NameValueCollection ToString

I have Written the following extension method to override the NameValueCollection.ToString: public static string ToString(this NameValueCollection a) { return string.Join("&", a.AllKeys.Select(k => $"{k}={a[k]}")); } But it still uses the…
Ashkan Mobayen Khiabani
  • 33,575
  • 33
  • 102
  • 171
0
votes
1 answer

How to modify values of HTTP header of a request permanently

I am referring to the below post. How to Modify HTTP Header of a request using C#? Solution provided here is working fine. But when i do the redirection to another page. All the changes done at request header are being lost. Please help
0
votes
1 answer

Request.Form works only on name tags?

I am developing a very simple data entry application (in bootstrap) using ASP.net and VB.Net as code behind in Visual Studio 2012 web. Suppose that i have the following html to get the firstname:
Andreas Venieris
  • 452
  • 3
  • 15
0
votes
0 answers

An object reference is required for the non-static field, method, or property 'System.Collections.DictionaryEntry.Key.get

My below method is throwing an error: Error 205 An object reference is required for the non-static field, method, or property 'System.Collections.DictionaryEntry.Key.get static string GetConfigValue(NameValueCollection tempCollection) { …
user1104946
  • 680
  • 1
  • 9
  • 30
0
votes
2 answers

How to create a dynamic where clause using a name value collection?

I have column search filter values sent to my web api and I can't figure how to make the where clause dynamic? Look below (too much code)!! Name Value Collection: public DataTablePager Get([FromUri] DataTableParameter param) …
Chaka
  • 1,709
  • 11
  • 33
  • 58
0
votes
1 answer

Web Page Posting and Capturing Response using C#

I have a webpage :http://180.92.171.80/ffs/data-flow-list-based/. After Filling Basin Name and River Name from Drop-down Menu, Station Names are appeared in Flood Forecasting Sites, when I select any of them, it automatically redirect to return that…
nishanuw
  • 49
  • 1
  • 11
0
votes
1 answer

NameValueCollection doesn't actually do anything with its IEqualityComparer?

I am looking at System.Collections.Specialized.NameValueCollection and it takes an IEqualityComparer, which is good news if someone like me wanted to sort the items in the collection by, say, something like the alphabetical order of the keys. But,…
Water Cooler v2
  • 32,724
  • 54
  • 166
  • 336
0
votes
2 answers

ASP.Net and NameValueCollection

I have the following method: public object[] GetEventsByUser(DateTime start, DateTime end, string fullUrl) The value of the fullUrl is: http://localhost:50435/page/view.aspx?si=00&us=admin&ut=smt& When I do: NameValueCollection qscoll =…
Marco
  • 1,272
  • 6
  • 22
  • 33
0
votes
1 answer

Custom control names (not ID) in ASP.NET to use with JQ.serialize

I am developing a website using mainly AJAX for saving and retrieving data in order to avoid postbacks (or at least full postbacks). I "prepare" the page in codebehind, and on client I use JQ and Javascript. When I want to save data I serialize the…
Oliver
  • 320
  • 1
  • 10
0
votes
3 answers

Sort NameValueCollection against Enum

I have to sort a namevaluecollection(Items usually 5 to 15) Against an enum(having items more than 60). Right now I am using this extension function, Anyone have better idea to write this code.... public static NameValueCollection Sort(this…
Mukesh Agarwal
  • 392
  • 4
  • 13
0
votes
2 answers

mask query dynamic query string value

I am building a wrapper to process payments. We want to log requests, but don't want to store sensitive credit card data. A query string will be passed similar to what is below amount=100.00&expMonth=01&expYear=14&cardnumber=4111111111111111 I want…
Jon Harding
  • 4,928
  • 13
  • 51
  • 96
0
votes
2 answers

XML response error: Invalid at the top level of the document

I am getting an error back and following the API manual I received on how to encode my request. Below is my request.. string url = "[My url to send request to]"; string xmlrequest =…
Dan Cope
  • 23
  • 1
  • 1
  • 6
0
votes
1 answer

NameValueCollection not grabbing first value of query string

I am using a simple statement NameValueCollection nvCollection = HttpUtility.ParseQueryString(queryString); I am trying to grab the values passed in the query string. A simple example of something passed would…
Jon Harding
  • 4,928
  • 13
  • 51
  • 96
0
votes
1 answer

Cookie's value is doubled without any reason

I've got an problem with Cookie. That's the code: NameValueCollection ncook = new NameValueCollection(); ncook = HttpContext.Current.Request.Cookies["history"].Values - in that line What is in my cookie:…
0
votes
1 answer

String whitespace replacement error when using string.join

Trying to join a list of strings together using string.join. When I use the Separator string " OR " the white spaces are being replaced with "+" which is breaking my targetUri string. Below is the code used to join. if…