Search code examples
c#xamlwindows-phone-8windows-phone

How to pass a value contains special characters between pages?


I want to pass a value like this: Black & White between two pages. but it has a character which gives it another meaning. how to pass that value?

value = "Black & White";
NavigationService.Navigate(new Uri("/secondpage.xaml?value=" + value, UriKind.Relative));

Solution

  • Try applying HttpUtility.UrlEncode method to the string.