.NETGURU
DataList - Embedded Controls
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngcontrolscs' list.


Dean Santillan
Hi,

I am interested to know how I can manipulate the properties of web form
controls embedded
in the header template of the datalist.

I have a datalist that has label controls in the header template that i
would like to change the text of according to the querystring. I am able to
access all the web from controls on the page but not in the datalist
control.

I really have no idea where i should begin or what to look for. I played
with it all i can see is to get a the datalistitem and then work my through
that. But how is where i stop.

Any ideas or articles on this topic would be appreciated.

This how i am working through the controls
foreach (XmlNode anode in nodes)
            {
                Control c = MyUserControl.FindControl(anode.Name);
                if (c != null)
                {
                    switch ( c.GetType().ToString())
                    {
                        case "System.Web.UI.WebControls.Label":
                            Label lb = (Label) c;
                            lb.Text = anode.Attributes["Value"].Value;
                            break;
                        case "System.Web.UI.WebControls.LinkButton":
                            LinkButton lk = (LinkButton) c;
                            lk.Text = anode.Attributes["Value"].InnerText;
                            break;
                        case "System.Web.UI.WebControls.HyperLink":
                            HyperLink hl = (HyperLink) c;
                            hl.Text = anode.Attributes["Value"].InnerText;
                            break;
                        case "System.Web.UI.WebControls.Button":
                            Button NewBut = (Button) c;
                            NewBut.Text = anode.Attributes["Value"].InnerText;
                            break;
                        case "System.Web.UI.WebControls.DataList":
                            DataList NewDataList = (DataList)c;
                            break;
                        case "System.Web.UI.WebControls.DropDownList":
                            DropDownList ddl = (DropDownList) c;
            foreach (XmlNode itemNode in
anode.ChildNodes)
                            {
                                ListItem li = new ListItem();
            li.Text =
itemNode["text"][Language].InnerText;
                                li.Value = itemNode["value"].InnerText;
            ddl.Items.Add(li);
                            }
                            break;
                    }
                }
            }
This is my xml file

<Ascx>
    <!-- -->
    <ControlTitle Language="En" Css="" Value="View Site Sections" ToolTip="" />
    <ControlTitle Language="Ja" Css="" Value="?????????????" ToolTip="" />
    <!-- -->
    <InstrText Language="En" Css="" Value="Select from the links int the list
below to edit or add a section to the site." ToolTip="" />
    <InstrText Language="Ja" Css="" Value="?????????????" ToolTip="" />
    <!-- -->
    <NewPage Language="En" Css="" Value="Add New Site Section" ToolTip="" />
    <NewPage Language="Ja" Css="" Value="?????????????" ToolTip="" />
    <!-- -->
    <LbID Language="En" Css="" Value="ID:" ToolTip="" />
    <LbID Language="Ja" Css="" Value="??" ToolTip="" />
    <!-- -->
    <Section Language="En" Css="" Value="Name:" ToolTip="" />
    <Section Language="Ja" Css="" Value="??" ToolTip="" />
    <!-- -->
    <Edit Language="En" Css="" Value="Edited:" ToolTip="" />
    <Edit Language="Ja" Css="" Value="Edited:" ToolTip="" />
    <!-- -->
    <TEMP Language="En" Css="" Value="TEMP" ToolTip="" />
    <TEMP Language="Ja" Css="" Value="?????????????" ToolTip="" />
    <!-- -->
    <TEMP Language="En" Css="" Value="TEMP" ToolTip="" />
    <TEMP Language="Ja" Css="" Value="?????????????" ToolTip="" />
</Ascx>

Thanks
Dean Santillan

Reply to this message...
 
    
Dennis West
Dean goto http://aspalliance.com/dotnetsolutions/GetSolution.aspx?ID=9860

over 2500 ASP.Net Solutions at http://aspalliance.com/dotnetsolutions

sign-up for our Newsletter of Daily Dot.Net Solutions
----- Original Message -----
From: "Dean Santillan" <Click here to reveal e-mail address>
To: "aspngcontrolscs" <Click here to reveal e-mail address>
Sent: Tuesday, May 21, 2002 5:24 AM
Subject: [aspngcontrolscs] DataList - Embedded Controls

[Original message clipped]

Reply to this message...
 
 
System.Web.UI.WebControls.Button
System.Web.UI.WebControls.DataList
System.Web.UI.WebControls.DropDownList
System.Web.UI.WebControls.HyperLink
System.Web.UI.WebControls.Label
System.Web.UI.WebControls.LinkButton
System.Web.UI.WebControls.ListItem
System.Windows.Forms.ToolTip
System.Xml.XmlNode




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