1

When I use this in my .NET codebehind:

NavigationService.Navigate(new Uri("DetailsPage.xaml", UriKind.Relative)); 

I get redirected to App.xaml.cs and it points to this code.

    // Code to execute if a navigation fails
    private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e)
    {
        if (System.Diagnostics.Debugger.IsAttached)
        {
            // A navigation has failed; break into the debugger
            System.Diagnostics.Debugger.Break();
        }
    }

What am I doing wrong? The files are in the same directory.. and the spelling is correct. I'm using the navigation from MainPage.xaml going to DetailsPage.xaml.. using an application bar.

Echilon
  • 10,064
  • 33
  • 131
  • 217
eaglei22
  • 2,589
  • 1
  • 38
  • 53

2 Answers2

0

You need to use this instead:

NavigationService.Navigate(new Uri("/Folder/DetailsPage.xaml", UriKind.Relative));

Where Folder - location of where pages located.

FanAs
  • 199
  • 1
  • 11
0

you are missing a / it should be like NavigationService.Navigate(new Uri("/DetailsPage.xaml", UriKind.Relative));

Michael
  • 3
  • 2
  • 4