473,624 Members | 2,213 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4887
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)sende r).NamingContai ner;

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)rite m.FindControl(" Label1");

and so on

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
"Fred Dag" <fr*****@hostvi lleit.com> wrote in message
news:u6******** ******@TK2MSFTN GP11.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
1090
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( Convert.ToString(DataBinder.Eval(Container.DataItem, "Activity")) == "1") { %>...<%}% My attempts putting 'DataBinder.Eval(Container.DataItem, "Activity")' in 'if' statement were not successfull. It seems like 'DataBinder.Eval(Container.DataItem,...
2
3802
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 webpage where the user can enter some search criteria (via dropdowns and textboxes) and then perform a search and have results presented. The results list includes linkbuttons which the user can click on to obtain more detailed results.
3
2059
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( Convert.ToString(DataBinder.Eval(Container.DataItem, "Activity")) == "1") { %>...<%}%> My attempts putting 'DataBinder.Eval(Container.DataItem, "Activity")' in 'if' statement were not successfull. It seems like 'DataBinder.Eval(Container.DataItem,...
5
3286
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> Clicking View will open a new browser and load PDFReader.aspx My client would like me to hide the address bar and toolbar on this new
3
2531
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 Hashtable. Originally my code was: <asp:Repeater id="rptFamily" runat="server" DataSource="<%# family %>"> <ItemTemplate> <%# DataBinder.Eval(Container.DataItem, "Key") %> = <%# DataBinder.Eval(Container.DataItem, "Value") %>
1
17035
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 control in my aspx page with two image buttons, one for an edit command, another a delete command. Here is a cut down code fragment. ...
0
1724
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 procedures in that database. The user can select any of those stored procedures by clicking on checkboxes; after submitting their selections, a script to delete and then re-create each stored procedure will be generated. Now I'm trying to do...
2
3875
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" /><br /> <label... <label... <label...
3
2564
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
8174
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8680
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8624
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8336
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6111
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5565
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4082
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1786
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.