Request.Params is replacing character "+" for " " (whitespace) .net

I have the follow iframe element

<iframe id="iFrameMain_01_01_01_01" 
        frameborder="0" width="100%" height="100%" scrolling="no"
        style="OVERFLOW:hidden;"
        src="SearchGrid.aspx?SearchName=fey&amp;Code=01_01_01_01&amp;SearchParam=Localizar&amp;ParentType=Filter&amp;gi=Testes&amp;SP=&amp;token=P7vZAKdnaPiDlD89ICn5Hr/CGTYmMpWOMKh5eiO6r0UIXK0cvt8Xc/NA0AEG3n+Lv/p8rSIWSFwVsr9tlS1/+Q==">
</iframe>

When I try to get the param "token" in Page_Load with Request.Params["token"] I have the value:

P7vZAKdnaPiDlD89ICn5Hr/CGTYmMpWOMKh5eiO6r0UIXK0cvt8Xc/NA0AEG3n Lv/p8rSIWSFwVsr9tlS1/ Q==

The character "+" is replacing by white space.

Jon Skeet
people
quotationmark

The character "+" is replacing by white space.

Yes, it would be - because that's what URL decoding is meant to do for query parameters. When you URL-encode a space in a query parameter, you get a + in the resulting URL, so URL-decoding that URL should give back the space. When you URL-encode +, you get %2B.

Basically, it sounds like you should be using a web-safe variant of base64, so you don't need to worry about URL-encoding your data. Or otherwise, make sure you perform your own URL-encoding first.

people

See more on this question at Stackoverflow