• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 280
  • Last Modified:

Passing string with " ' " causes error

When I select a string with " ' "  , causes an error in the receiving aspx page.

For example names with " '" like O'hare, O'toole results to an error. How would I parse it?

The error happens when I pass it to the next page using Response Redirect and add the string as a parameter.
0
zachvaldez
Asked:
zachvaldez
1 Solution
 
PaulHewsCommented:
You have to url encode the value of the parameter

Response.Redirect("MyPage.aspx?Name=" & Server.UrlEncode("O'Brian"))
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now