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

Event handling: Button Click Vs Repeater OnItemCreated

I have a simple page where I would like to modify a repeater (bounded
to a dataset) if a button (outside the repeater) is clicked or not.

I tried to solve this with a button click event that raises a global
flag and a repeater OnItemCreated event that modifies the repeater
items accordingly.

My problem is that the click event for the button is fired after the
OnItemCreated event for the repeater when the flag still has a default
value. I know a possible solution would be to loop the repeater in the
click event instead and modify the child controls that needs editing,
but that seems like a strenuous way to do it compared to OnItemCreated
event.

If there was someway to raise the button flag before the OnItemCreated
event fires it would solve my problem...maybe by moving the flag
rising code or rerender the repeater someway. Or perhaps there is a
completely different solution.

Any help will be much appreciated
Mauritsius
Nov 19 '05 #1
1 2503
"Mauritsius" <ma********@hotmail.com> wrote in message
news:be**************************@posting.google.c om...
I have a simple page where I would like to modify a repeater (bounded
to a dataset) if a button (outside the repeater) is clicked or not.

I tried to solve this with a button click event that raises a global
flag and a repeater OnItemCreated event that modifies the repeater
items accordingly.

My problem is that the click event for the button is fired after the
OnItemCreated event for the repeater when the flag still has a default
value. I know a possible solution would be to loop the repeater in the
click event instead and modify the child controls that needs editing,
but that seems like a strenuous way to do it compared to OnItemCreated
event.

If there was someway to raise the button flag before the OnItemCreated
event fires it would solve my problem...maybe by moving the flag
rising code or rerender the repeater someway. Or perhaps there is a
completely different solution.


Call repeater.DataBind again in the button click event.

John Saunders
Nov 19 '05 #2

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

Similar topics

10
by: tony kulik | last post by:
This code works fine in ie and opera but not at all in Mozilla. Anybody got a clue as to how to get it right? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <script...
18
by: Christopher W. Douglas | last post by:
I am writing a VB.NET application in Visual Studio 2003. I have written a method that handles several events, such as closing a form and changing the visible status of a form. I have some code...
2
by: sunil | last post by:
OnItemCreated method of DataGrid I modified the Pager cell to have a button TableCell pager = (TableCell)e.Item.Controls; ImageButton hImg = new ImageButton(); hImg.ImageAlign=ImageAlign.Left;...
0
by: Sam | last post by:
Hi, I have a class that receives a DataGrid control and populates it. However, I need to do an OnItemCreated event because if I'm missing data in a certain column, I display a HyperLink control...
0
by: Diane Yocom | last post by:
I'm very new to ASP.Net and probably jumped in a little over my head, but... I'm trying to create a user control that will control navigation through my site. It's sortof like Amazon.com, where...
3
by: Jack Turnbull | last post by:
Hi, I have a Checkbox in a Repeater set to AutoPostBack = true. I have pointed OnCheckedChanged to a Sub but it doesn't fire. If I move the checkbox out of the Repeater it fires! Any ideas? Thanks
1
by: smash2004 | last post by:
I have VS 2005 CTP. I created a page with one repeater. Inside i put a linkbutton. Usually when i put linkbutton on a page I doubleclick it in designview and event gets created in codebehind...
0
by: Demetri | last post by:
I have created a web control that can be rendered as either a linkbutton or a button. It is a ConfirmButton control that allows a developer to force a user to confirm if they intended to click it...
1
by: Arpan | last post by:
What's the difference between the ItemCreated event & the OnItemCreated method of a data binding control, say, for e.g. a Repeater? Please explain with examples, if possible. Thanks, Arpan
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.