User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 375,199 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,050 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 698 | Replies: 4
Reply
Join Date: Apr 2008
Posts: 2
Reputation: psspl is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
psspl psspl is offline Offline
Newbie Poster

How to add data to the content place holder at runtime

  #1  
Apr 2nd, 2008
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.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2005
Location: Ohio
Posts: 204
Reputation: plazmo is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 16
plazmo's Avatar
plazmo plazmo is offline Offline
Posting Whiz in Training

Re: How to add data to the content place holder at runtime

  #2  
Apr 2nd, 2008
you access your content tags.
they look like this.
  1. <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)
Last edited by peter_budo : Apr 4th, 2008 at 4:43 am. Reason: Keep It Organized - please use [code] tags
Reply With Quote  
Join Date: Apr 2008
Posts: 2
Reputation: psspl is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
psspl psspl is offline Offline
Newbie Poster

Re: How to add data to the content place holder at runtime

  #3  
Apr 3rd, 2008
Originally Posted by plazmo View Post
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??
Reply With Quote  
Join Date: Sep 2007
Posts: 1,054
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 61
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: How to add data to the content place holder at runtime

  #4  
Apr 4th, 2008
place your code, only your content place holder code like the above example, and I will try to help you.
I answer pm's.
I answer questions.
I answer quickly.
I answer.
Reply With Quote  
Join Date: Jun 2006
Posts: 12
Reputation: Hosam Kamel is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
Hosam Kamel Hosam Kamel is offline Offline
Newbie Poster

Re: How to add data to the content place holder at runtime

  #5  
Apr 4th, 2008
you can use another a[approach by using the new ASP.NET 2.0 control which called MultiView control and set the active view depending on selected dropdown item.

http://www.c-sharpcorner.com/UploadF...a-393c43872384
Thanks,
Hosam Kamel
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb ASP.NET Marketplace
Thread Tools Display Modes

Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 2:30 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC