【发布时间】:2013-04-01 05:53:39
【问题描述】:
我正在尝试将用户在文本框中输入的特殊字符作为字符串传递,例如 & 或 #。
然后将这个字符串传递到下一页
NavigationService.Navigate(new Uri(String.Format("/Pages/EditNote.xaml?note={0}", strText), UriKind.Relative));
EditNote.xaml 页面然后检查 note 参数并获取其值
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
if (NavigationContext.QueryString.ContainsKey("note"))
{
noteText = NavigationContext.QueryString["note"];
}
}
问题是当noteText为非字母数字字符时,例如&、#等,它总是为空。
我错过了什么?
【问题讨论】:
标签: c# windows-phone-8 special-characters