问题:我想将带有加号的手机号码传递到下一页。但只有手机才能没有加号。
非常感谢帮助。
txtMobile1.text = "+61912345678"
if (chk1.IsChecked.Value)
{
NavigationService.Navigate(new Uri("/SendMsg.xaml?fn=" + HttpUtility.UrlEncode(txtMobile1.Text) + "&Name=" + strName, UriKind.Relative));
}
---- Receiving:
if (NavigationContext.QueryString.ContainsKey("fn"))
{
strPassInMobileNo = HttpUtility.UrlDecode(this.NavigationContext.QueryString["fn"]) ;
}
The received mobile phone no is : 61912345678 without the puls sign
答案 0 :(得分:2)
使用HttpUtility.HtmlDecode(this.NavigationContext.QueryString["fn"]);