After adding a subfolder, Order_Details for example, to the CustomPages folder, adding List.aspx and its subfiles immediately creates a bunch of name conflicts with the 5/23/08 bits. This doesn't occur for the same process with file-system Web Sites.
This makes it evident why the Onyx sample projects only use file-system Web Sites.
What's the schedule for fixing this and is there a temporary workaround?
I think what you're seeing is actually the expected behavior if you are just copying List.aspx from PageTemplates into the custom page folder. The problem is that in a Web App, everything gets compiled as one DLL, and bad things happen if you end up with
two classed with the same namespace and name. The fix is trivial: use a different namespace for the custom page. e.g. instead of WebApplication1, use WebApplication1.Order_Details as a namespace. You'll need to change this both in List.aspx (in the 'inherits'
attribute) and in List.aspx.cs (as the namespace).
David
Marked as answer by davidebb on Jun 01, 2008 11:11 PM
Steve beat me to it! As he points out, you can also choose to change the class name instead of the namespace, which will work as well. One way or another, you need to avoid the full class name duplication.
Thanks for the reply. It looked to me to be a namespace/classname issue, but wanted to make sure it wasn't cockpit error on my part before writing about it.
I am getting a "The resource cannot be found" error from a Web Site Project. I have added a Cutomers directory (which matches one of my data entities) to CustomPages and copied Details.aspx files from PageTemplates. The website works fine when I remove the
Customers directory from CustomPages. Anyone come across this before?
Hi Danny, are you running the latest version Visual Studio 2008 SP1 beta + 5/23 release see
here. I've just build a site based on Northwind in a DynamicData Web Applicaion no problems.
Dynamic Data 5-23 ReleaseCustom Pages
See my blog C# Bits | Twitter @sjnaughton Always seeking an elegant solution.
Also, what's the URL you're going it when you get this error? Note that this seems unrelated to the issue discussed in this thread, so it would be best to start a separate thread to avoid confusion between the two.
RogerJenn
Member
4 Points
8 Posts
Unable to Create Custom Pages with Web Application Projects; Web Site Projects Work OK (5/23 Drop...
Jun 01, 2008 10:19 PM|LINK
After adding a subfolder, Order_Details for example, to the CustomPages folder, adding List.aspx and its subfiles immediately creates a bunch of name conflicts with the 5/23/08 bits. This doesn't occur for the same process with file-system Web Sites.
This makes it evident why the Onyx sample projects only use file-system Web Sites.
What's the schedule for fixing this and is there a temporary workaround?
--rj
OakLeaf Systems Blog
sjnaughton
All-Star
27308 Points
5458 Posts
MVP
Re: Unable to Create Custom Pages with Web Application Projects; Web Site Projects Work OK (5/23 ...
Jun 01, 2008 11:04 PM|LINK
Hi Roger I think its just a namespace issue if you change the class name of the page it should work OK.
Dynamic Data WebApplicationProject
Always seeking an elegant solution.
davidebb
Contributor
7006 Points
1366 Posts
Microsoft
Re: Unable to Create Custom Pages with Web Application Projects; Web Site Projects Work OK (5/23 ...
Jun 01, 2008 11:09 PM|LINK
Hi Roger,
I think what you're seeing is actually the expected behavior if you are just copying List.aspx from PageTemplates into the custom page folder. The problem is that in a Web App, everything gets compiled as one DLL, and bad things happen if you end up with two classed with the same namespace and name. The fix is trivial: use a different namespace for the custom page. e.g. instead of WebApplication1, use WebApplication1.Order_Details as a namespace. You'll need to change this both in List.aspx (in the 'inherits' attribute) and in List.aspx.cs (as the namespace).
David
davidebb
Contributor
7006 Points
1366 Posts
Microsoft
Re: Unable to Create Custom Pages with Web Application Projects; Web Site Projects Work OK (5/23 ...
Jun 01, 2008 11:11 PM|LINK
Steve beat me to it! As he points out, you can also choose to change the class name instead of the namespace, which will work as well. One way or another, you need to avoid the full class name duplication.
David
RogerJenn
Member
4 Points
8 Posts
Re: Unable to Create Custom Pages with Web Application Projects; Web Site Projects Work OK (5/23 ...
Jun 02, 2008 02:34 PM|LINK
David and Steve,
Thanks for the reply. It looked to me to be a namespace/classname issue, but wanted to make sure it wasn't cockpit error on my part before writing about it.
Thanks also for your frequent and detailed blog posts on ADO.NET Dynamic Data. The product is shaping up as a more-than-worthy replacement for Blinq (http://oakleafblog.blogspot.com/2006/06/generate-data-based-web-sites-with.html).
--rj
OakLeaf Systems Blog
RogerJenn
Member
4 Points
8 Posts
Re: Unable to Create Custom Pages with Web Application Projects; Web Site Projects Work OK (5/23 ...
Jun 02, 2008 06:31 PM|LINK
My Eliminate Ambiguous Object References when Customizing ADO.NET Dynamic Data Pages in Web Apps post, which deals with this topic, is live.
Is a fix for this problem in the works?
--rj
Custom Pages
OakLeaf Systems Blog
davidebb
Contributor
7006 Points
1366 Posts
Microsoft
Re: Unable to Create Custom Pages with Web Application Projects; Web Site Projects Work OK (5/23 ...
Jun 02, 2008 08:09 PM|LINK
Thanks for blogging the solution Roger!
dannyg_uk
Member
6 Points
12 Posts
Re: Unable to Create Custom Pages with Web Application Projects; Web Site Projects Work OK (5/23 ...
Jun 03, 2008 04:27 PM|LINK
I am getting a "The resource cannot be found" error from a Web Site Project. I have added a Cutomers directory (which matches one of my data entities) to CustomPages and copied Details.aspx files from PageTemplates. The website works fine when I remove the Customers directory from CustomPages. Anyone come across this before?
Thanks
Danny
sjnaughton
All-Star
27308 Points
5458 Posts
MVP
Re: Unable to Create Custom Pages with Web Application Projects; Web Site Projects Work OK (5/23 ...
Jun 03, 2008 04:46 PM|LINK
Hi Danny, are you running the latest version Visual Studio 2008 SP1 beta + 5/23 release see here. I've just build a site based on Northwind in a DynamicData Web Applicaion no problems.
Dynamic Data 5-23 Release Custom Pages
Always seeking an elegant solution.
davidebb
Contributor
7006 Points
1366 Posts
Microsoft
Re: Unable to Create Custom Pages with Web Application Projects; Web Site Projects Work OK (5/23 ...
Jun 03, 2008 04:59 PM|LINK
Also, what's the URL you're going it when you get this error? Note that this seems unrelated to the issue discussed in this thread, so it would be best to start a separate thread to avoid confusion between the two.
thanks,
David