.NETGURU
User Custom Controls within User Custom Controls
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngreuse' list.


Russ Nemhauser
-- Moved from [aspngfreeforall] to [aspngreuse] by Marcie Jones <Click here to reveal e-mail address> --

Hi all,

I wrote 2 user custom controls. Now I have a need to put the second user
custom control "inside" the first one.

For example, if user custom control 1 returns a table with a bunch of rows,
I need my user custom control 2 to be in one of the cells within the table.

When I alter custom control 1 to create a tag for custom control 2, the end
result HTML is the tag itself, not the rendered custom control 2.

Does anyone know how to do what I'm trying to explaing here?

Thanks,
Russ

_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com

Reply to this message...
 
    
Russ Nemhauser
Yeah.

Now I'm taking a different approach and I'm still having trouble.

I'm overriding one of the functions in control #1 that generates the HTML,
and I'm programmatically creating control #2. But control #2 is still not
getting rendered. Here's the code. Remember, this is in the overridden
function within control #1:

Dim pg As System.Web.UI.Page = Me.DrillDownBox.Page
Dim itb As UserControls.InquiryThreadBox = New UserControls.InquiryThreadBox
itb.ID = "itb" & dr.Item("WorkID").ToString()
itb.Width = Unit.Pixel(500)
itb.HyperlinkInquiries = True
itb.InquiryPage = "note.aspx"
itb.DataSource = GetAllRelatedInquiries(10114)
itb.DataBind()
Return itb.GenerateHTML

My thinking is that since THIS control is currently getting rendered, I'm
way beyond trying to add controls to the page object. So that GenerateHTML
function there at the end should return everything that control #2 WOULD
have generated if it had just been put on a page. Instead, I'm "Return"ing
that HTML generated by control #2 to control #1's HTMLTextWriter.

Can anyone figure out why nothing ever gets rendered for control 2? The
thing ALWAYS returns HTML, whether there is data in the data source or not.

Thanks!

[Original message clipped]

_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail.
http://www.hotmail.com

Reply to this message...
 
    
Ryan Healey
are you including runat="server" within your 2nd user control ?

Thanks,

Ryan Healey
http://www.fuzzysoftware.com/
Comprehensive, categorized, searchable collection
of links to ASP & ASP.NET resources...

---------------------------------------------------------------
http://www.instantasp.co.uk
Your complete Internet software development division.
---------------------------------------------------------------
----- Original Message -----
From: "Russ Nemhauser" <Click here to reveal e-mail address>
To: "aspngreuse" <Click here to reveal e-mail address>
Sent: Friday, May 10, 2002 11:11 PM
Subject: [aspngreuse] User Custom Controls within User Custom Controls

> -- Moved from [aspngfreeforall] to [aspngreuse] by Marcie Jones
<Click here to reveal e-mail address> --
[Original message clipped]

Reply to this message...
 
    
Little, Ambrose
Have you tried just creating the control and adding it to the child controls
collection when you control #1 is created?

--Ambrose

[Original message clipped]

_________________________________________________________________
Join the world's largest e-mail service with MSN Hotmail.
http://www.hotmail.com

| [aspngreuse] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/aspngreuse.asp = JOIN/QUIT

******************************************************************************
The Company reserves the right to amend statements
made herein in the event of a mistake. Unless expressly
stated herein to the contrary, only agreements in writing signed
by an authorized officer of the Company may be enforced against it.
*******************************************************************************

Reply to this message...
 
 
System.Web.UI.Page
System.Web.UI.WebControls.Unit




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification