Special characters on the return of the Request.Form method

Asked

Viewed 49 times

1

Good afternoon, my dear, I have an ASP.NET Webform project that reads the form post using the Request.Form method. I play this method in a string but it comes full of space characters. s Excerpt from the code --

        string[] ctrl = Request.Form.ToString().Split('&');

        foreach (string item in ctrl)
        {
            if (item.ToString().Contains("DropDownList="))
            {
                string[] control = item.ToString().Split('=');
                if (control[0].ToString() != "andaresDropDownList" && control[0].ToString() != "periodoDropDownList")
                {

-- The first line is that makes the method return but see the result in the attachment, Retorno chamada método para variável string[]

For example the phrase returned "no spots" returns "no spots" Another example. Cabinets returns Arm%C3%a1rios

Can you help me?

Grateful and waiting.

Good rest of the day.

1 answer

2


Not special characters, your text is coming UrlEncoded just use Decode to display the way you want. You can use HttpUtility.UrlDecode().

  • Good morning, I got it through your guidance.

  • Good afternoon, I would actually like to do this and it ends this subject but I couldn’t find where to do it on the site.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.