Odd problem with # character in URL |
1/27/2021 9:12:01 AM |
ASPRunner.NET General questions | |
![]() I have an app that sends some field values from a selected record to an add record page by means of querystring parameters. XVar data = ajax.getCurrentRecord();
http://localhost:8088/ShoppingCart/Add?StockNo=06-999&Description=TEST%20#ITEM%20**DO%20NOT%20ORDER***&Category=06
http://localhost:8088/ShoppingCart%2fAdd%3fStockNo%3d06-999%26Description%3dTEST+%23ITEM+**DO+NOT+ORDER***%26Category%3d06
|
|
![]() |
FrankR_ENTA 1/27/2021 |
I have an app that sends some field values from a selected record to an add record page by means of querystring parameters. Here's some relevant code: XVar data = ajax.getCurrentRecord();
http://localhost:8088/ShoppingCart/Add?StockNo=06-999&Description=TEST%20#ITEM%20**DO%20NOT%20ORDER***&Category=06
http://localhost:8088/ShoppingCart%2fAdd%3fStockNo%3d06-999%26Description%3dTEST+%23ITEM+**DO+NOT+ORDER***%26Category%3d06
|
![]() |
Pete K author 1/27/2021 |
Some destinations will accept those plus signs and some will not.
The way around this is: don't use the UrlEncode, and instead, do a replace of the pound to the HTML code for that, using your own string replace.
|
![]() |
Sergey Kornilov admin 1/28/2021 |
Personally, I would suggest avoiding any "bad" characters in the URL. Those IIS URL filtering settings are there for a reason. |
![]() |
Pete K author 1/29/2021 |
Personally, I would suggest avoiding any "bad" characters in the URL. Those IIS URL filtering settings are there for a reason. The best option is to pass to the Add page something that is safe like StockNo and pull the rest of data from the database using one of Add page event like ProcessValues.
|