locked
Custom Pages for derived types RRS feed

  • Question

  • User2110012998 posted

    I am able to create custom pages for a base type, but not for any of its derived types.

    I copied a standard template from the PageTemplates folder to the CustomPages/{TableName} folder.

    This works for the base type without a problem, but it doesn't work for derived types (I made sure that the CustomaPages/{TableName} folder name matches the table name in the database. When I run the website, it redirects me to the standard page rather than to the custom page.

    Is this a limitation of Dynamic Data?

    Thank you for your time.

    Wednesday, August 15, 2012 1:47 PM

Answers

  • User2110012998 posted

    The problem was solved by changing the folder name from plural to singular for subtypes (i.e. Leds -> Led, LightPipes -> LightPipe)

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 22, 2013 7:58 PM

All replies

  • User3866881 posted

    Hi,

    Can you show me your full codes?

    Many thanks!

    Thursday, August 16, 2012 9:30 PM
  • User-330204900 posted

    Hi bravemav, are you making the custom page folder name the Entity Name to the Entity Set Name as it must be the plural name?

    Friday, August 17, 2012 5:59 AM
  • User2110012998 posted

    Hi guys thanks for the replies. I have a 'Product' class with subtype classes 'Led', 'LightPipe', and 'CardGuide'. 

    I have a added a custom page for Products under

    • DynamicData/CustomPages/Products/List.aspx. 
    When I run the website, it correctly displays the custom page for Products.

    I have also added a custom page for the other subtypes under:

    • DynamicData/CustomPages/Leds/List.aspx
    • DynamicData/CustomPages/LightPipes/List.aspx
    • DynamicData/CustomPages/CardGuides/List.aspx

    However, when I navigate to their respective subtype page, the custom page is not displayed. Instead, the standard "List.aspx" provided by DynamicData is displayed. 

    All of my other custom pages display correctly for all entities except for subtypes in a hiearchy (Led, CardGuide, and LightPipe). Thanks for taking the time to read this.

    Friday, August 17, 2012 10:54 AM
  • User1641955678 posted

    I think you essentially hit a limitation here. While there is some support for derived classes, I think the list page always uses the root of the hierarchy, and will show items of all the various derived types in there.

    Thursday, August 23, 2012 1:10 AM
  • User2110012998 posted

    The problem was solved by changing the folder name from plural to singular for subtypes (i.e. Leds -> Led, LightPipes -> LightPipe)

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 22, 2013 7:58 PM