473,396 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Having a UserControl returned in a string from another UserControl to be rendered

I hope this makes sense.

Here is what I am attempting. I have an inital generic aspx page that
has one custom tag:

<web:site id=webSite runat=server/>

When this control evaluates, it will return a small amount of Html with
another custom control tag inside this html. For example:

<table>
<tr>
<td><web:page id=webPage runat=server/></td>
</tr>
</table>

In turn, this web:page control will have multiple other custom tags
called web:content. When asp.net renders this, only the initial custom
control I have embedded in the generic aspx page actually renders. The
web:site tag renders with the web:page custom control tag showing in
the rendered page source as plain text, it was never rendered.

What I need is a way to tell asp.net to render any custom control tags
I spit out inside text/html strings and have this repeat down thru a
series of controls.

How do I tell asp.net to essentially "re-render" the page. Hopefully
someone has done something similar and I am speaking clearly.

Thanks.

Dec 2 '05 #1
1 1112
I do not think you can do that. Once the page has loaded, all the controls
have been parsed and processed.

Having said that, you can dynamically load controls using the LoadControl
method and add it to the Controls collection, but once ASP.NET has finished
parsing the document, it will not parse it anymore.

Maybe your goal does not fit with a proper design. What specifically are
you trying to do and maybe I can offer a better alternative?

From your small information below, maybe a better solutions would be to
constrain your top-level control even more by requiring that it return an
actual WebControl (or something) that can then be added to the Controls
collection at the proper place.

I am always cautions to allow my code to return data that cannot be
validated for correctness. For instance, by allowing any string to be
returned, you have no idea what will be returned, while if you return a
WebControl instance, then you know that it can be rendered.

"SlimFlem" <sl******@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
I hope this makes sense.

Here is what I am attempting. I have an inital generic aspx page that
has one custom tag:

<web:site id=webSite runat=server/>

When this control evaluates, it will return a small amount of Html with
another custom control tag inside this html. For example:

<table>
<tr>
<td><web:page id=webPage runat=server/></td>
</tr>
</table>

In turn, this web:page control will have multiple other custom tags
called web:content. When asp.net renders this, only the initial custom
control I have embedded in the generic aspx page actually renders. The
web:site tag renders with the web:page custom control tag showing in
the rendered page source as plain text, it was never rendered.

What I need is a way to tell asp.net to render any custom control tags
I spit out inside text/html strings and have this repeat down thru a
series of controls.

How do I tell asp.net to essentially "re-render" the page. Hopefully
someone has done something similar and I am speaking clearly.

Thanks.

Dec 2 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Tinus | last post by:
Hello all, I've create a custom control (UserControl) and have a custom Item Collection. The control is a custom calendar which is draw using the Graphics Rectangle etc. functions. It is drawn...
2
by: Phl | last post by:
Hi, I have a page with many usercontols and I would like to access other usercontrols from one usercotnrol , so I can access their server controls. This is how I do it, EditProfile...
2
by: John Olsen | last post by:
Hi. I`m building a small CMS, and want to add the possibility to include server side code inside static html-strings that is stored in a database. For e.g. in the string...
1
by: Will Gillen | last post by:
I know this has probably been asked before, but I can't seem to find a solid answer in any of the archives. First, before my question, please forgive my limited knowledge of the event lifecycle...
12
by: Joe | last post by:
Hello All: Do I have to use the LoadControl method of the Page to load a UserControl? I have a class which contains three methods (one public and two private). The class acts as a control...
5
by: Tarun Mistry | last post by:
Hi all, is it possible to update a usercontrol before it is rendered? In my scenario I have a Page with a usercontrol on it. When a button is clicked on the Page, I want to update the...
34
by: Larry Hastings | last post by:
This is such a long posting that I've broken it out into sections. Note that while developing this patch I discovered a Subtle Bug in CPython, which I have discussed in its own section below. ...
6
by: MeowCow | last post by:
I have created a UserControl that encapsulates a third party data grid. My goal was to create my own DataSource and DataMember properties that forward the binding to the third party grid, then use...
14
by: WT | last post by:
Hello, I have a usercontrol loaded in a page with a theme. This usercontrol contains columns template with hyperlinks, with skinID. The columns are not displayed, seems thta there is some...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.