hi. im having trouble passing the value that i get from another page to my linq.
my code is:
on my first page i have..
then on my 2nd page to retrieve the value i have..Code:NavigationService.Navigate(new Uri("/ViewPage.xaml?articleID=I", UriKind.Relative));
problem is on my 2nd page.. its not showing the data if i put it like this..Code:protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { string articleNo = NavigationContext.QueryString["articleID"]; base.OnNavigatedTo(e); MessageBox.Show("ID: " + articleNo); }
the articleNo is not returning the value from the recent page hence the linq is having a null result.
Code:XDocument loadedData = XDocument.Load("phconstitution.xml"); var data = from query in loadedData.Descendants("article") where query.Attribute("Title").Value == articleNo select new article() { Title = query.Attribute("Title").Value, SubTitle = query.Attribute("SubTitle").Value, Content = query.Attribute("Content").Value };

Reply With Quote

