0

I need to display the longlistselector data in a new page when an item was selected.. im getting an error message System.Argument.Exception so plz help me to solve this issue..

my selectedindex change code..

private void OrganizationList_SelectionChanged(object sender, SelectionChangedEventArgs e)
{                
   NavigationService.Navigate(new Uri("Organization_Details.xaml?selectedItem" +Organization.Name , UriKind.Relative));
}

Error:

enter image description here In the navigated page, i'm jus using a text block to display my data..and the code is..

Organization org;//Class name with obj

public Organization_Details()
{
    InitializeComponent();

    org_name.Text = org.name;//textblock(org_name)-->needs to set the data from the b4 page..
}

enter image description here

Error in navigated page...

4

2 回答 2

2

尝试这个

 NavigationService.Navigate(new Uri("/Organization_Details.xaml?selectedItem=" +Organization.Name , UriKind.Relative));

您在 url 的开头错过了“/” ,在 selectedItem 之后错过了“=”

于 2013-11-14T12:13:50.863 回答
0

不能直接取值,所以使用下面的函数,

protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
    {
        base.OnNavigatedTo(e);
            if (e.Uri.OriginalString.Contains("selectedItem"))
            {
                //Get the value here
            }
     }

这对你来说很好!

于 2013-11-15T05:41:38.087 回答