Solved

Access to ContentPlaceHolder contents/HTML?

Posted on 2009-05-04
3
477 Views
Last Modified: 2013-11-08
Is there a way to programmatically access the HTML or XML that is containe inside a ContentPlaceHolder when a page a built?  I want to duplicate the contents programmatcally when a submit button is presses so I can email the form as a whole.
0
Comment
Question by:jglazer63
  • 2
3 Comments
 
LVL 23

Expert Comment

by:Saqib Khan
ID: 24300011
I can advise few Solutions..

1st using ASP.NET....
Within ContentPlaceHolder you can have a Label/Literal and then access the TEXT of that Label within ContentPlaceHolder and duplicate it into another object.


2nd Solution is Client Side...

ContentPlaceHolder must be within a DIV (id attribuite), then use javaScript to get the innerHTML of that Div, then Store the Output into a Hidden Field, then by using ASP.NET you can access the TEXT/VALUE property of Hidden Field.
0
 

Author Comment

by:jglazer63
ID: 24300551
Do you think either of these would be viable to replace the HTML <input> tags with the text the person enters?  I thought of the DIV thing too but haven't played wih it yet.  Kinda hoping for a strictly .net solution.
0
 
LVL 23

Accepted Solution

by:
Saqib Khan earned 500 total points
ID: 24308065
then You would Create a User Control, and Setup properties within User Control (For multiple Versions, you can change them).

Then in .NET use the LoadControl Method to load the Control, Setup properties for each instance, and create any many copes you want (The Right way:)).

Dim ctrl as userControl
ctrl = LoadControl("ControlName.Ascx")
ctrl.Property = "My name"

PlaceHolder.AddControl(ctrl)

.. make next copy (Instance), so far and so on...

 - Saqib
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now