Solved

Access to ContentPlaceHolder contents/HTML?

Posted on 2009-05-04
3
478 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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

820 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