locked
Creating Custom Page in Dynamic Data Application RRS feed

  • Question

  • User-580321634 posted

    To create a custom page I copied the List.Ascx file from the Page templates to DynamicData\CustomPage\"MytableName"

    I keep getting the follwing errors mainly in list.aspx.designer

    "The type 'L2SDynamicData.List' already contains a definition for GridView1"

    "The type 'L2SDynamicData.List' already contains a definition for table1"

    "The type 'L2SDynamicData.List' already contains a definition for HeadContent"

    "The type 'L2SDynamicData.List' already contains a definition for DynamicDataManager1"

    "The type 'L2SDynamicData.List' already contains a definition for UpdatePanel1"

     

    There are about 32 of these error types

     

     

    Thursday, November 25, 2010 4:11 AM

Answers

  • User-330204900 posted

     Hi MyASPAccount, I am assuming you are using a Web Application Project rather than a Website project yes? If so the the issue is namespace, because you have copied a page you now have two classes with the same name (Not allowed). What I do is add a namespace to differentiate.

    So if I copied the default Liat page to the CustomPage folder for tabel Employees I would rename all namespaces in file:

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

    To

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

    and for the code behind:

    namespace EPC

    becomes

    namespace EPC.Employees
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, November 25, 2010 6:09 AM
  • User-580321634 posted

    Thanks Steve

    I changed the Namespace as suggested

    I am now able to create the Custom page. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, November 27, 2010 5:13 AM

All replies

  • User-330204900 posted

     Hi MyASPAccount, I am assuming you are using a Web Application Project rather than a Website project yes? If so the the issue is namespace, because you have copied a page you now have two classes with the same name (Not allowed). What I do is add a namespace to differentiate.

    So if I copied the default Liat page to the CustomPage folder for tabel Employees I would rename all namespaces in file:

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

    To

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

    and for the code behind:

    namespace EPC

    becomes

    namespace EPC.Employees
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, November 25, 2010 6:09 AM
  • User-580321634 posted

    Thanks Steve

    I changed the Namespace as suggested

    I am now able to create the Custom page. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, November 27, 2010 5:13 AM
  • User949140326 posted

    Hi Steve,

    I changed the namespace as you mentioned above. No errors now. But I am not able to see the new custom page . I am still seeing the old page. Please tell me what i am missing here.

     

    I am using .NET framework 3.5

    Thursday, April 7, 2011 8:37 AM
  • User232504566 posted

    I would check your path. Custom pages should be placed in

    dynamicdata/custompage/[tablename]/listdetails.apsx (for example) the page templates or actions need to be nested inside a folder with the appropriate Table Name.

    You can also check your routing paths to be sure that the table is being routed to the appropriate action.

    Thursday, April 7, 2011 12:57 PM