locked
Hiding tables on homepage only. RRS feed

  • Question

  • User-2146400267 posted

    Hello,

    I was succesfully able to hide a table from displaying on the default.aspx page by using the [ScaffoldTable(false)] property in the dbml.

    However, it seems to hide, and prevent access to table, globally.  I just need to hide some tables on the default.aspx page.

    How do I do this?

    Thanks!

    Mark

    Thursday, December 4, 2008 1:19 PM

Answers

  • User1641955678 posted

    Note that the default.aspx UI is meant to be some simple thing to get started, and not necessarily something you'd want to keep after your app evolves.  But if you do want to keep it and exclude some tables, you have a number of options:

    1. Change it to not use a repeater, but instead manually list the links that you want (you can get the relevant info from each MetaTable)
    2. Keep the repeater, but limit the list it goes over.  You can do this in Default.aspx.cs by enumerating over something that doesn't have all the visible tables (normally it goes over MetaModel.Default.VisibleTables).

    David

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 4, 2008 2:13 PM
  • User-330204900 posted

    Hi , have a look at this article here:Dynamic Data - Hiding Tables on the Default.aspx page

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 4, 2008 6:34 PM

All replies

  • User193237405 posted

     You can add a runat and ID tag to the <table> tag to be able to access it on the server-side.

    <table id="tblOne" runat="server">

    From the server code-behind file you can call the following in the Page_Load to remove the tables from display. Just repeat add the same to the other tables and include them as Visible = false in the code-behind.

    tblOne.Visible = false;

    If these tables are not on the default page and are part of the master page you'll have to reference them through Master.FindControl("tblOne") and so forth on the Page_Load. That sort of thing anyway.

    Thursday, December 4, 2008 2:08 PM
  • User1641955678 posted

    Note that the default.aspx UI is meant to be some simple thing to get started, and not necessarily something you'd want to keep after your app evolves.  But if you do want to keep it and exclude some tables, you have a number of options:

    1. Change it to not use a repeater, but instead manually list the links that you want (you can get the relevant info from each MetaTable)
    2. Keep the repeater, but limit the list it goes over.  You can do this in Default.aspx.cs by enumerating over something that doesn't have all the visible tables (normally it goes over MetaModel.Default.VisibleTables).

    David

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 4, 2008 2:13 PM
  • User1641955678 posted

    Rampidbyter, I think you are misunderstanding the question.  He's referring to Dynamic Data table, not HTML tables.

    David

    Thursday, December 4, 2008 2:15 PM
  • User-2146400267 posted

    Note that the default.aspx UI is meant to be some simple thing to get started, and not necessarily something you'd want to keep after your app evolves.  But if you do want to keep it and exclude some tables, you have a number of options:

    1. Change it to not use a repeater, but instead manually list the links that you want (you can get the relevant info from each MetaTable)
    2. Keep the repeater, but limit the list it goes over.  You can do this in Default.aspx.cs by enumerating over something that doesn't have all the visible tables (normally it goes over MetaModel.Default.VisibleTables).

    David

    OK, I got it.  This will work.

    Thank you.

    Thursday, December 4, 2008 2:35 PM
  • User193237405 posted

     Yup, *point goes sailing over my head* there it went.

    Thursday, December 4, 2008 4:45 PM
  • User-330204900 posted

    Hi , have a look at this article here:Dynamic Data - Hiding Tables on the Default.aspx page

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 4, 2008 6:34 PM
  • User1641955678 posted

    Ah, I should have known that Steve had this one covered! :)

    David

    Thursday, December 4, 2008 8:21 PM