Have you seen the error page shown below when you are developing a ASP.NET Dynamic Data application?
Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /DynamicData/PageTemplates/Edit.aspx
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
I thought my application was broken. In the end, it had nothing to do with my application. It has everything to do with how a ASP.NET Dynamic Data Domain Service Web Application is setup by default when press F5. By default the project is setup to open the Current Page as the start action. I noticed that if I have the Edit.aspx page selected in my Solution Explorer and then hit F5 I get the error above. Notice the url in your browser, it is something like this:
What I wanted and expected to happen was open the default page when I hit F5. The error is 100% correct. That page is not directly available since I am using Dynamic Data.
If I select my project instead and hit F5 I get the default page as expected and desired.
So, really all this is just because I didn’t realize what the default behavior was. The remedy is very simple. Right click on Default.aspx in the Solution Explorer and select Set as Start Page. This will change the Start Action to use a Specific Page (the Default.aspx in this case) instead of the Current Page.
If you are not sure what your project is set to you can right-click on your project in Solution Explorer and go to the Web tab. Here you will see Start Action. To have F5 always start the Default.aspx page make sure Default.aspx is in the Specific Page textbox.
Here is what it should look like: