Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Event handling: Button Click Vs Repeater OnItemCreated

Reply
Thread Tools

Event handling: Button Click Vs Repeater OnItemCreated

 
 
Mauritsius
Guest
Posts: n/a
 
      12-17-2004
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
 
Reply With Quote
 
 
 
 
John Saunders
Guest
Posts: n/a
 
      12-17-2004
"Mauritsius" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
image button click event fires before click event of button Purvi T ASP .Net 0 10-19-2004 06:19 AM
Button.Init? how Do I know if click event has been fired? TextBox.TextChanged event before Button.Click in a CompositeCustomControl. jorge ASP .Net Building Controls 1 05-28-2004 06:23 AM
Button.Init? how Do I know if click event has been fired? TextBox.TextChanged event before Button.Click in a CompositeCustomControl. jorge ASP .Net 2 05-25-2004 11:45 PM
Button.Init? how Do I know if click event has been fired? TextBox.TextChanged event before Button.Click in a CompositeCustomControl. jorge ASP .Net Datagrid Control 0 05-25-2004 01:45 AM
Button.Init? how Do I know if click event has been fired? TextBox.TextChanged event before Button.Click in a CompositeCustomControl. jorge ASP .Net Web Controls 0 05-25-2004 01:45 AM



Advertisments