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

ItemCommand event does not fire???

Hi,

I built a webform with a repeater:

<asp:repeater id="rep1" runat="server" DataSource='<%# ar %>'>
<ItemTemplate>
<asp:Button Runat=server Text="<%# Container.DataItem %>" ID="Button1"
NAME="Button1"/>
</ItemTemplate>
</asp:repeater>

in my code behind the webform I have
-an array ar (which is not the problem here)
-the ItemCommand event, which does not fire???:
private void rep1_ItemCommand(object source,
System.Web.UI.WebControls.RepeaterCommandEventArgs e)

{

//some code

}

If I try a asp:LinkButton instead of a asp:Button it DOES fire!!! So the
question is why does this event not fire in case of the aspbutton??? You
should be able to fire a button right???

thanks

JIM
Nov 19 '05 #1
3 5163
buttons don't support the ItemCommand event, because they do not use
javascript to postback, so the ItemCommand hidden fields are not filled in.

-- bruce (sqlwork.com)
"Jimmy" <be****@gmail.com> wrote in message
news:O1**************@TK2MSFTNGP09.phx.gbl...
Hi,

I built a webform with a repeater:

<asp:repeater id="rep1" runat="server" DataSource='<%# ar %>'>
<ItemTemplate>
<asp:Button Runat=server Text="<%# Container.DataItem %>" ID="Button1"
NAME="Button1"/>
</ItemTemplate>
</asp:repeater>

in my code behind the webform I have
-an array ar (which is not the problem here)
-the ItemCommand event, which does not fire???:
private void rep1_ItemCommand(object source,
System.Web.UI.WebControls.RepeaterCommandEventArgs e)

{

//some code

}

If I try a asp:LinkButton instead of a asp:Button it DOES fire!!! So the
question is why does this event not fire in case of the aspbutton??? You
should be able to fire a button right???

thanks

JIM

Nov 19 '05 #2

"Jimmy" <be****@gmail.com> wrote in message
news:O1**************@TK2MSFTNGP09.phx.gbl...
Hi,

I built a webform with a repeater:

<asp:repeater id="rep1" runat="server" DataSource='<%# ar %>'>
<ItemTemplate>
<asp:Button Runat=server Text="<%# Container.DataItem %>" ID="Button1"
NAME="Button1"/>
</ItemTemplate>
</asp:repeater>

in my code behind the webform I have
-an array ar (which is not the problem here)
-the ItemCommand event, which does not fire???:
private void rep1_ItemCommand(object source,
System.Web.UI.WebControls.RepeaterCommandEventArgs e)

{

//some code

}

If I try a asp:LinkButton instead of a asp:Button it DOES fire!!! So the
question is why does this event not fire in case of the aspbutton??? You
should be able to fire a button right???

thanks

JIM

I didn't see OnItemCommand="rep1_ItemCommand" in your repeater tagss!
Nov 19 '05 #3
thanks guys
I got it:
http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemwebuiwebcontrolsrepeaterclassonitemcomm andtopic.asp

"Jimmy" <be****@gmail.com> wrote in message
news:O1**************@TK2MSFTNGP09.phx.gbl...
Hi,

I built a webform with a repeater:

<asp:repeater id="rep1" runat="server" DataSource='<%# ar %>'>
<ItemTemplate>
<asp:Button Runat=server Text="<%# Container.DataItem %>" ID="Button1" NAME="Button1"/>
</ItemTemplate>
</asp:repeater>

in my code behind the webform I have
-an array ar (which is not the problem here)
-the ItemCommand event, which does not fire???:
private void rep1_ItemCommand(object source,
System.Web.UI.WebControls.RepeaterCommandEventArgs e)

{

//some code

}

If I try a asp:LinkButton instead of a asp:Button it DOES fire!!! So the
question is why does this event not fire in case of the aspbutton??? You
should be able to fire a button right???

thanks

JIM

Nov 19 '05 #4

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

Similar topics

4
by: Steven | last post by:
Hi there, I am having a weird problem. I have a datagrid with both an ItemCommand and a SortCommand. It was working fine until a day ago. Now, whenever I click a column to fire the...
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"...
2
by: Nick Gilbert | last post by:
We have a Datagrid which contains a template column with a button in it, as well as an actual button column. If either of the buttons are clicked, the ItemCommand event does not fire. If...
0
by: Solomon Shaffer | last post by:
I am trying to add some link buttons to a datagrid template column at runtime and trying to wire these buttons up to the ItemCommand event (or any event when clicked!). The ItemCommand event works...
3
by: sri_san | last post by:
Hello Group, I use a datagrid with a linkbutton to delete the selected row. Added javascript confirm dialogue box in itembound event. The itemCommand event does not seem to fire when I debug the...
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...
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 ...
1
by: shantanu_kush | last post by:
Hi there, I am using a DataList in a composite control. The DataList has an Custom ItemTemplate(ITemplate) which adds a Button to the DataList Item as shown in the code below : public class...
2
by: Josh | last post by:
I have a nested repeater situation with a Link Button on the nested repeater. However when the link button is clicked I get a postback but the event never takes place. I'm trying to wire up the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.