Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Add usercontrol to page in page init from text reference

Posted on 2011-03-09
1
Medium Priority
?
240 Views
Last Modified: 2012-05-11
Hello, I have a text editor control where users can create a page then add text, video, images and other things. I want to also allow them to add usercontrols that I create to where they place the control in the text editor. Basically, I add to the text editor's content a discriptive tag such as ***mycontrol*** when they drop the control into the editor(perhaps into a div or table).

 I have created some controls and have registered them in the web.config.

Now, when the page init fires I get the page and parse for the discriptive tag  ***mycontrol*** . I remove the tag and add the html for a placeholder control. The place holder is given a name when created like phMyControl.

On page load I want to find the placehoder control that was created in the page init and do control.add to add the  ***mycontrol***

I can't seem to find the placeholder control using findcontrol!

My questions are:
Is it possible to do what I'm trying to do?
Is my approach the best way to do this?
Why can't I find the programatically added placeholder control so I can add the usercontrol to the page?

Is there a better way? How does DNN do it?




0
Comment
Question by:gogetsome
[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
1 Comment
 
LVL 96

Accepted Solution

by:
Bob Learned earned 2000 total points
ID: 35102477
A lot of the problems that I have with ASP.NET deal with the page life-cycle, and the timing of things.  If you try to find a control before it is created, then you won't be able to find it.  What does your page hierarchy look like (master page, naming containers, ...)?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

719 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