Dynamic Master / Detail pages question

G

Guest

Hi,
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.
 
G

Guest

sqlboy2000,

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?

Thanks,
Eagle
 
G

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.
 
G

Guest

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

<asp:Content ID="Content1" runat="Server"
ContentPlaceHolderID="ContentPlaceHolder1">

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

</asp:Content>

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!!!
Eagle
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top