views:

195

answers:

2

Had a page that was working fine. Only change I made was to add a datagrid to the page (which also added the xmlns) and all of the sudden I'm getting Page Not Found. Checked the UriMappings. Tried the default nav link. No joy.

Ideas?

UPDATE: The answer was that I had a mock class that was not initializing a collection. See Byrant's answer for a way to save yourself some time.

A: 

Firebug is always a good friend to see which kind of requests are called ... Often the devServer is not closed properly , have a look at the taskbar

Ren Hoek
That's what I thought had happened and was one of the first things I'd checked. Thanks for the idea!!! See other answer for cause.
PretzelSteelersFan
+1  A: 

To see what the issue is you need to make one change to your MainPage.xaml.cs:

// If an error occurs during navigation, show an error window
private void ContentFrame_NavigationFailed(object sender, NavigationFailedEventArgs e)
{
    Exception ex = e.Exception;

    while (ex.InnerException != null)
    {
        ex = ex.InnerException;
    }

    e.Handled = true;
    ChildWindow errorWin = new ErrorWindow(ex);
    errorWin.Show();
}

Once you've made that change when you start the application you should see the exception instead of the page where the exception occurred.

Bryant
I'd nailed it down to a mock class not initializing a collection by the time I saw your answer. I made your changes and they would have saved me about an hour. Thanks!!!!
PretzelSteelersFan