Solved

Access to ContentPlaceHolder contents/HTML?

Posted on 2009-05-04
3
475 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:adilkhan
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:
adilkhan 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
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 …
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

708 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

18 Experts available now in Live!

Get 1:1 Help Now