473,320 Members | 1,572 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.

repeater ItemCommand not firing on first click

I've got a Repeater and within it a LinkButton.
The LinkButton has an CommandName="Test"

In the Repeater's ItemCommand event I want to check for this command name
but the problem I'm having is that the ItemCommand event is not firing the
first time the LinkButton is clicked. 2nd-(n)times after it's fine but the
FIRST time it's clicked I get nothing.

The repeater is on an ASCX control that's on a standard ASPX page.

Thanks
--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

Nov 19 '05 #1
2 4838
Curt:
Are any of the related controls being dynamically added (or maybe even
unrelated)?

We got a somewhat similar behaviour in the past that was being caused by the
Page.IsPostback switching from True to False 1/2 way through the page
lifecycle (ProcessMain recalculates it a few times). You might want to
check that it's still true by the time in gets to prerender. The page
itself uses IsPostback to determine whether to fire off events...

karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
news:EF**********************************@microsof t.com...
I've got a Repeater and within it a LinkButton.
The LinkButton has an CommandName="Test"

In the Repeater's ItemCommand event I want to check for this command name
but the problem I'm having is that the ItemCommand event is not firing the
first time the LinkButton is clicked. 2nd-(n)times after it's fine but the
FIRST time it's clicked I get nothing.

The repeater is on an ASCX control that's on a standard ASPX page.

Thanks
--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

Nov 19 '05 #2
Actually I found the issue just now...
The user was resetting the ID of the LinkButton in the ItemDataBound event,
thus the first click was disassociated from the event...

Thanks though Karl... :}

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Karl Seguin" wrote:
Curt:
Are any of the related controls being dynamically added (or maybe even
unrelated)?

We got a somewhat similar behaviour in the past that was being caused by the
Page.IsPostback switching from True to False 1/2 way through the page
lifecycle (ProcessMain recalculates it a few times). You might want to
check that it's still true by the time in gets to prerender. The page
itself uses IsPostback to determine whether to fire off events...

karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
news:EF**********************************@microsof t.com...
I've got a Repeater and within it a LinkButton.
The LinkButton has an CommandName="Test"

In the Repeater's ItemCommand event I want to check for this command name
but the problem I'm having is that the ItemCommand event is not firing the
first time the LinkButton is clicked. 2nd-(n)times after it's fine but the
FIRST time it's clicked I get nothing.

The repeater is on an ASCX control that's on a standard ASPX page.

Thanks
--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com


Nov 19 '05 #3

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

Similar topics

0
by: Barry | last post by:
Hi, I have a Repeater in which the first field has a linkbutton. I also have a button outside the repeater. When a user clicks the linkbutton, I want it to fire every linkbutton's click event...
1
by: Mark Fox | last post by:
Hello, I have a repeater and in each itemtemplate I have a radiobuttonlist. I am attempting to figure out how on postback I could iterate through the rows displayed by the repeater and for...
2
by: Stan | last post by:
I cannot make the link buttons fire ItemCommand from repeater control. Here is the code: <asp:repeater id=rptLetters runat="server"> <itemtemplate> <asp:linkbutton id="lnkLetter"...
0
by: Michael | last post by:
I've seen several posts relating to this problem, and tried EnableViewState="False", but it does not work for me. A twist in my problem is that I am adding the templates for the repeater...
3
by: Leigh Webber | last post by:
I have an HTMLAnchor control on my aspx page. When it's not inside a repeater, it works fine. When I put it inside a repeater control, the handler never gets fired. I have a handler for the...
0
by: Amir | last post by:
Hi every one This is the problem: I have a UserControl that contains a Repeater and a few LinkButton. The Repeater generate some linkButton. I use this control for implementing paging solution...
1
by: Rob Rutherford | last post by:
I have a Repeater on an ASP.NET page. If I click a Button in the Repeater, the Repeater's ItemCommand event fails to fire. If anyone can explain why it doesn't fire I'd be grateful. Here's the...
2
by: Deepesh | last post by:
Good day, I have a specific case of the DataGrid in my solution which is causing the ItemCommand Event Not Firing. So I'm creating a "Skinnable" set of controls. I seperate the actual ASCX file...
4
by: EvelynAnd Ethan | last post by:
Hi, ItemCommand event not firing from a dynamic user control ,WHERE A DATAGRID HAS BUTTON,when i click on the linkbutton first time the itemcommand event doesnt fire,second time event fires up ...
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...
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: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.