Random geekery since 2005.

Husband, father, programmer, speaker, writer, blogger, podcaster, collector, traveler, golfer.

What I Learned in WP7 – Issue 10

Written in

by

First, I hope everyone has a great holiday.  I’m going to be disappearing for a  few days, but I’ll likely be back by Tuesday, December 28.  I recommend that you do the same.  Step away from the computer, and find some people to spend time with.  Family, friends, colleagues (sometimes they’re not your friends, right?), neighbors, etc.  Spend some time with the people you care about.  It’s important.


Yesterday, I mentioned how you can pass data using a query string in Windows Phone development.  @PhraseMeme (on Twitter) was kind enough to remind me that you should probably consider escaping your data before passing it as a query string, just as you would in a website.  To do this, you can use the Uri.EscapeDataString method to convert all of your non-reserved characters to their hexadecimal equivalents.  Obviously, when you receive that data, you’ll also want to use the UnescapeDataString method to convert it back.

Tags

One response to “What I Learned in WP7 – Issue 10”

  1. Ashish Sadanandan Avatar
    Ashish Sadanandan

    It seems you don't need [b]Uri.UnescapeDataString[/b] when you receive the string. According to the MSDN docs for [b]NavigationContext.QueryString[/b] (http://tinyurl.com/2f8l7s6):
    [quote]The values from the query string are decoded before being stored in the QueryString collection.[/quote]

Leave a reply to Ashish Sadanandan Cancel reply