473,394 Members | 1,737 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,394 software developers and data experts.

Issues with OnTextChanged using <asp:Repeater

As far as I can work out when using the OnTextChanged event I cannot get the
TextBox and Labels values when the event fires as they are populated by a
<asp:repeater and so don't have values.

If I try to give the repeater values by removing
if (!IsPostBack)

{}

from the

Page_Load() method then my method is not called by the OnTextChanged event.

There is probably a limitation with my understanding of the event model.

How should I be getting OnTextChanged events from a <asp:repeater component
and getting details about the values from the other controls of the
<ItemTemplate> line that caused the event to trigger?

Thanks in advance

Jan 5 '06 #1
1 4861
Hi,

if you have specific problems can you show the code?

Anyways, if you get TextChanged event to be raised, you can get to the
current repeater's item via sender (first argument in event handler method)
with code as follows:

RepeaterItem ritem =(RepeaterItem)((Control)sender).NamingContainer;

It would be the the parent item of the TextBox which raises this specific
TextChanged event. Then getting to other controls on the same item would be
just running FindControl againts the RepeaterItem

Label lbl=(Label)ritem.FindControl("Label1");

and so on

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
"Fred Dag" <fr*****@hostvilleit.com> wrote in message
news:u6**************@TK2MSFTNGP11.phx.gbl...
As far as I can work out when using the OnTextChanged event I cannot get
the TextBox and Labels values when the event fires as they are populated
by a <asp:repeater and so don't have values.

If I try to give the repeater values by removing
if (!IsPostBack)

{}

from the

Page_Load() method then my method is not called by the OnTextChanged
event.

There is probably a limitation with my understanding of the event model.

How should I be getting OnTextChanged events from a <asp:repeater
component and getting details about the values from the other controls of
the <ItemTemplate> line that caused the event to trigger?

Thanks in advance

Jan 6 '06 #2

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

Similar topics

0
by: Oleg | last post by:
I am using asp:repeater control. I would like to create a conditional row <tr> when the data in DataBinder.Eval(Container.DataItem, "Activity") returns '1'. I need something like this: <%if(...
2
by: Peter Kirk | last post by:
Hi are there any "gotchas" with using an asp:repeater that means that the "onclick" method of a LinkButton created in the repaeter does not fire? I at least cannot get it to work. I have a...
3
by: Oleg | last post by:
I am using asp:repeater control. I would like to create a conditional row <tr> when the data in DataBinder.Eval(Container.DataItem, "Activity") returns '1'. I need something like this: <%if(...
5
by: George Durzi | last post by:
I currently have an href inside of an asp:repeater <a href='<%# String.Concat("PDFReader.aspx?id=", DataBinder.Eval(Container.DataItem, "ProductUniqueId")) %>' target="_blank">View</a> ...
3
by: Joe Fawcett | last post by:
Sorry about the multi post, I thought I'd sent to both groups simultaneously but somehow it failed to find this one the first time. I'm having a problem binding an asp:repeater control to a...
1
by: Timbo | last post by:
Hi all, This is my first message here so i'll try and include all the information that will help you help me out, if possible. Basically I am using C# in ASP.NET 2.0 and have a Repeater...
0
by: deathtospam | last post by:
A few weeks ago, I created a Classic ASP page that connects to a machine with SQL Server installed on it, prompts the user to select a database on that server, then lists all of user-created stored...
2
by: bissatch | last post by:
Hi, I am trying to output a list of checkboxes. Using ASP .NET controls, I was able to create the following: <label for="colour_red">Red: </label><asp:CheckBox ID="colour_red" runat="server"...
3
by: Homer J. Simpson | last post by:
I have the following stored procedure: ALTER PROCEDURE . AS BEGIN SET NOCOUNT ON; SELECT COUNT(*) FROM QUICKNOTES END ....and the following data source in my .aspx file:
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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...

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.