I have a problem with HttpRequest.Que ryString.
There is an XML string that contains something like the following: <age>8+</age>
As you probably guessed, the "+" is the problem :)
I want to get that XML string from QueryString, however, the "+" appears as a " " (space), not a "+".
I have tried the following:
** note: XMLstring is a string (decleration: string XMLstring = "";)
I realise I can just search XMLstring and replace the space with the plus sign. I don't want to do that :)
Also, this isn't my code, and I have no idea why XML is in QueryString nor if it should be there, but it
has to stay like this for the moment, and I have to somehow extract that + sign.
Any help/advice is appreciated.
Thank you.
There is an XML string that contains something like the following: <age>8+</age>
As you probably guessed, the "+" is the problem :)
I want to get that XML string from QueryString, however, the "+" appears as a " " (space), not a "+".
I have tried the following:
Code:
NameValueCollection coll = Request.QueryString;
XMLstring = coll.Get("XMLstr"); // result: XMLstring = "<age>8 </age>"
Code:
XMLstring = Request.QueryString["XMLstr"]; // result: XMLstring = "<age>8 </age>"
Code:
XMLstring = Request.QueryString.Get("XMLstr"); // result: XMLstring = "<age>8 </age>"
Code:
XMLstring = HttpUtility.HtmlDecode(Request.QueryString["XMLstr"]); // result: XMLstring = "<age>8 </age>"
Code:
XMLstring = HttpUtility.HtmlDecode(Request.QueryString.Get("XMLstr")); // result: XMLstring = "<age>8 </age>"
I realise I can just search XMLstring and replace the space with the plus sign. I don't want to do that :)
Also, this isn't my code, and I have no idea why XML is in QueryString nor if it should be there, but it
has to stay like this for the moment, and I have to somehow extract that + sign.
Any help/advice is appreciated.
Thank you.
Comment