Solved

Access to ContentPlaceHolder contents/HTML?

Posted on 2009-05-04
3
481 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

621 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