Dynamic Master / Detail pages question

Discussion in 'ASP .Net' started by Guest, Jun 20, 2006.

  1. Guest

    Guest Guest

    I've just started playing around with master / detail pages and I'm trying
    to simply change the detail page displayed in the contentplaceholder control
    from code behind. I can't seem to find any examples of this. Does anyone know
    how to do this?

    Thanks in advance.
    Guest, Jun 20, 2006
    1. Advertisements

  2. Guest

    Guest Guest


    There are probably a large number of ways to this. You can put controls
    inside two or more <div> tags with the id properties set and with
    runat="server". Then, set the visibilities of the <div>s as you desire.

    You can dynamically build contols in the code.

    You can use nested master pages.

    Can you provide more details on what you are trying to achieve?

    Guest, Jun 20, 2006
    1. Advertisements

  3. Guest

    Guest Guest

    Just a simple example of changing the detail page in code behind.
    controls.add() or whatever it is now when using master / detail pages.
    Guest, Jun 20, 2006
  4. Guest

    Guest Guest

    Here's a suggestion. It can get tedious, however.

    <asp:Content ID="Content1" runat="Server"

    <asp:Table id="tblMain" runat="server">
    <asp:TableRow id="row1" runat="server">
    <asp:TableCell id="cell11" runat="server">


    At this point you can add rows and cells to tblMain in your code-behind.
    You can also add controls to the cells.

    You can also try this using the <div> tag instead of a table. I have not
    used the <div> personally this way. I have successfully added rows and cells
    to an asp:Table in this way, but I did not do it for all the content.

    I hope this helps.

    Have Fun!!!
    Guest, Jun 20, 2006
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.