473,396 Members | 1,827 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.

Repeater Control Problem...

Hi!
How can I access a label that I put inside a headertemplate inside a
repeatercontrol from my codebehind?

Or, can I dynamicly add the content of headertemplate from codebehind?

Because I use the same repeater for different views, and I need to modify
the headertemplate dynamicly, depending of the current selection before...

Heres some example code:
-------
<asp:repeater id=Repeater1 runat="server">
<ItemTemplate>
<tr>
<td>
<div align="center">BLABLABLA
<br>
</div>
</td>
</tr>
</ItemTemplate>
<HeaderTemplate>
<tr>
<td>
<b><asp:label id="lblHeadline" Runat="server">SOME TEXT
HERE:</asp:label><br></b>
</td>
</tr>
</HeaderTemplate>
<FooterTemplate>
<tr>
<td>Blablabla
</td>
</tr>
</FooterTemplate>
</asp:repeater>

--------------------
So, now, from the page_load()
HOW?? Do I access the lblHeadline ??
or, How Do I add the context of headerTemplate from Page_Load()

OR, Do I need to use another control?

Yours: Kristoffer
Nov 18 '05 #1
1 1614
Do an e.Item.FindControl in the ItemDataBound event. You can then access it
when you .DataBind().

Sam

"Kristoffer Arfvidson" <kr********@spamtrap.com> wrote in message
news:Oz*************@TK2MSFTNGP11.phx.gbl...
Hi!
How can I access a label that I put inside a headertemplate inside a
repeatercontrol from my codebehind?

Or, can I dynamicly add the content of headertemplate from codebehind?

Because I use the same repeater for different views, and I need to modify
the headertemplate dynamicly, depending of the current selection before...

Heres some example code:
-------
<asp:repeater id=Repeater1 runat="server">
<ItemTemplate>
<tr>
<td>
<div align="center">BLABLABLA
<br>
</div>
</td>
</tr>
</ItemTemplate>
<HeaderTemplate>
<tr>
<td>
<b><asp:label id="lblHeadline" Runat="server">SOME TEXT
HERE:</asp:label><br></b>
</td>
</tr>
</HeaderTemplate>
<FooterTemplate>
<tr>
<td>Blablabla
</td>
</tr>
</FooterTemplate>
</asp:repeater>

--------------------
So, now, from the page_load()
HOW?? Do I access the lblHeadline ??
or, How Do I add the context of headerTemplate from Page_Load()

OR, Do I need to use another control?

Yours: Kristoffer

Nov 18 '05 #2

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

Similar topics

8
by: Invalidlastname | last post by:
Hi, We are developing an asp.net application, and we dynamically created certain literal controls to represent some read-only text for certain editable controls. However, recently we found an issue...
0
by: John Crowley | last post by:
I'm having an odd problem with viewstate and a dynamically created control inside a repeater template. Basically, I have a repeater setup like this in the aspx:
3
by: WebMatrix | last post by:
I am struggling with implementing somewhat complicated UI web-control. I explored Repeater, but I am not sure if it's the best way to go. I am leaning towards writing my own custom control and...
8
by: I am Sam | last post by:
Hi everyone, This problem is making me old. I don't want to get any older. I have a multi-nested repeater control as follows: <asp:Repeater ID="clubRep1" Runat="server">...
9
by: Jaybuffet | last post by:
my aspx has something like this <asp:Repeater id="Repeater1" runat="server"> <ItemTemplate> <mycontrol:ctl id="ctlId" obj='<%# Container.DataItem %>' showItem="true"/> </ItemTemplate>...
8
by: fernandezr | last post by:
I would like to use a user control as a template inside a repeater. Some of the fields in the control should be hidden depending on whether or not there is data. I'm still a ASP .Net newbie so the...
7
by: | last post by:
I have what's probably a simple page lifecycle question related to dynamically evaluating values that are placed by a repeater and dynmically placing user controls that use those values. I'm...
5
by: Brad Baker | last post by:
I am trying to make a "tabbed" interface by iterating through a dataset with a conditional statement. For example: ...
1
by: jazzart | last post by:
Hi there, I'm fairly new to programming with Asp.Net 2.0 so I'm finding myself regularly fumbling around in the dark a bit, so to speak. I'm currently using Visual Web Developer and have been...
12
by: =?Utf-8?B?Qi4gQ2hlcm5pY2s=?= | last post by:
I'm doing a web app in VB/Dot Net 2.0. I'm probably a bit rusty and I have no experience using the repeater control. I have a user control I've created with multiple properties. I've created a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.