p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.

Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 7th, 2009, 03:20 PM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Nested Container control binding

I am using the AjaxControlToolkit and I have several controls that are inside a TabPanel, within a TabContainer. The TabContainer is in a Panel, which is nested in a DataList. (see aspx code below).
The Datalist contains my DataRow, and I need to figure out how to access the DataList to set values in the Tabs child controls from the aspx. Somehting like "Container.Parent.Parent.Container.DataItem" or "Container.Container.DataItem"

Code:
<DataListID="AL"runat="server"DataKeyField="RefNumber"Width="100%">
<ItemTemplate>
   <PanelID="AP"runat="server"GroupingText="Address"CssClass="Addr">
    <TabContainerID="ATS"runat="server">
          <TabPanelID="MemA"runat="server"HeaderText="Member">
             <ContentTemplate>                   <p>
                  <LabelID="HPhLbl"Text="Home"runat="server"Width="75px"/>
                  <TextBoxID="HPh"runat="server"Text=' <%# ((DataRowView)Container.DataItem)["HomePhone"] %> ' />
               </p>
Prior to adding the tabstrip everything loaded correctly, I justneed to understand how to assign values from a Datalist to controls, several containers deep.

Thanks!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old July 14th, 2009, 12:58 AM
Friend of Wrox
Points: 941, Level: 11
Points: 941, Level: 11 Points: 941, Level: 11 Points: 941, Level: 11
Activity: 2%
Activity: 2% Activity: 2% Activity: 2%
 
Join Date: Jun 2007
Location: San Diego, CA, USA.
Posts: 278
Thanks: 0
Thanked 4 Times in 4 Posts
Default

I've tried to build some controls similarly using nested repeaters and had problems, I'm guessing for the same reasons. Somebody mentioned using the FindControl method, but that just threw different errors. I returned for more insight, but all I got was "FindControl is evil, so don't use it. It's bad practice." Unfortunately there was no explanation why or what to use instead.

I'm hoping we can both get some answers here. ;)
__________________
-------------------------

Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe

When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper

Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old July 14th, 2009, 11:53 AM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

FindControl can work when drilling down, but it is not recursive, it only looks in the container in which you call it from, and recursively calling it from the page level would be bad. In this case I'm trying to figure out a way to drill "up" to parent/grand parent/... naming containers. So I hope some one does reply who know the answer.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with binding XMl data into nested repeater vishnu108mishra XML 0 November 19th, 2007 03:53 AM
Container Binding problem tany4u Javascript How-To 0 October 3rd, 2006 02:36 AM
Is there a container control in VBA? sangeenobs Beginning VB 6 1 March 23rd, 2006 10:57 AM
Custom Container Control bmains .NET Framework 2.0 0 April 20th, 2005 03:01 PM
User Control Container Communication Colonel Angus ASP.NET 1.1 2 January 30th, 2004 04:25 PM



All times are GMT -4. The time now is 01:21 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc