locked
Dynamic Data Web Site Customization? RRS feed

  • Question

  • User770171000 posted

    Using:  Visual Web Developer 2008 Express Edition .. C#

    I have the dynamic web site working fine...  A database, LINQ to SQL, changed the global.asax and all that.  So it displays my tables and everything works fine.  I have tried to follow along the video series to customize the way my gridviews look.

     So, I copied /DynamicData/PageTemplates/List.aspx into a brand new folder /DynamicData/CustomPages/<table name>/List.aspx ... The only problem is that, unlike the video series, the page breaks with all kinds of "already contains a definition of" errors ... In other words, the copy itself brings over all the inheritences and code-behinds from the original List.aspx.  First line of the "custom page":

     <%@ Page Language="C#" MasterPageFile="~/Site.master" CodeBehind="List.aspx.cs" Inherits="AMSv0._2.List" %>

    matches the first line of the original List.aspx page:

    <%@ Page Language="C#" MasterPageFile="~/Site.master" CodeBehind="List.aspx.cs" Inherits="AMSv0._2.List" %>

     Which doesn't seem to make sense to me, since at the very least, it should have the .CustomPages.<table name>.List .... right?  In the video series, Scott just merily cruises past the point and I am stuck in the water with broken page inheritences.

     

    Anyone have any idea what I can do to remedy this?  Below is a screenshot of the solution explorer so you can see what I'm talking about:

    Solution Explorer

     Here's a screenshot of the errors I'm getting:

     Errors

    Monday, September 8, 2008 1:51 PM

Answers

  • User-330204900 posted

    Hi Jack because you are using a Web Application Project each page must have a unique class name as all the pages are compiled into a single assembly at runtime. So you can change the namespace or the class name:

    <%@ Page Language="C#" MasterPageFile="~/Site.master" CodeBehind="List.aspx.cs" Inherits="AMSv0._2.Orders.List" %>

    OR 

    <%@ Page Language="C#" MasterPageFile="~/Site.master" CodeBehind="List.aspx.cs" Inherits="AMSv0._2.ListOrders" %>

    Hope this helps [:D]

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 8, 2008 2:25 PM

All replies

  • User-330204900 posted

    Hi Jack because you are using a Web Application Project each page must have a unique class name as all the pages are compiled into a single assembly at runtime. So you can change the namespace or the class name:

    <%@ Page Language="C#" MasterPageFile="~/Site.master" CodeBehind="List.aspx.cs" Inherits="AMSv0._2.Orders.List" %>

    OR 

    <%@ Page Language="C#" MasterPageFile="~/Site.master" CodeBehind="List.aspx.cs" Inherits="AMSv0._2.ListOrders" %>

    Hope this helps [:D]

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 8, 2008 2:25 PM
  • User770171000 posted
    Aha! Thanks much, that was it. All working now!
    Monday, September 8, 2008 3:31 PM