hi all,

i am developing a content management system in asp.net with C#. i have a master page named "Master1.master" with 5 content place holders-"cphHeader, cphLeft,cphCenter,cphright,cphbottom". i have another default.aspx page which is inherited from the "Master1.master". it takes as input,the following fields from the user :
1. text to be displayed.(Textbox)
2. Content holder where the text will be displayed (dropdown having names of all the 5 content holders mentioned above.).
these things entered by the user are stored in the database. The text entered by the user should be displayed in the content holder mentioned above.

How do i do it?? is there any facility which helps us access the content place holders on the default.aspx.cs page.

thanks in advance.please reply as soon as possible.

Recommended Answers

All 4 Replies

you access your content tags.
they look like this.

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

then you just call it from the c# code by id
ex.
Content1.Controls.Add(acontrolfilledwithcontent)

you access your content tags.
they look like this.
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"></asp:Content>

then you just call it from the c# code by id
ex.
Content1.Controls.Add(acontrolfilledwithcontent)

Thanks for the reply. but i cannot access 'Content1 ' in my '.cs' page.is there any other solution??

place your code, only your content place holder code like the above example, and I will try to help you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.