S
Stan
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"
runat="server" commandname="Filter"
CommandArgument='<%#
DataBinder.Eval(Container, "DataItem.Letter")%>'>
<%# DataBinder.Eval
(Container, "DataItem.Letter")%>
</asp:linkbutton>
</itemtemplate>
</asp:repeater>
In code-behind I've got:
this.rptLetters.ItemCommand += new
System.Web.UI.WebControls.RepeaterCommandEventHandler
(this.OnLetterClicked);
and
protected void OnLetterClicked(object source,
System.Web.UI.WebControls.RepeaterCommandEventArgs e)
{
if (e.CommandName == "Filter")
{
letterFilter = (string)
e.CommandArgument;
PopulateGrid();
}
}
and it is does not fire the click event!
However, if I replace link button with regular buttons
<asp:repeater id=rptLetters runat="server">
<itemtemplate>
<asp:button id="lnkLetter" runat="server"
commandname="Filter"
CommandArgument='<%#
DataBinder.Eval(Container, "DataItem.Letter")%>'
Text='<%# DataBinder.Eval
(Container, "DataItem.Letter")%>' />
</itemtemplate>
</asp:repeater>
exactly the the same code works fine.
I am using 1.0.3705 framework.
Is this a bug?
Thanks,
-Stan
repeater control.
Here is the code:
<asp:repeater id=rptLetters runat="server">
<itemtemplate>
<asp:linkbutton id="lnkLetter"
runat="server" commandname="Filter"
CommandArgument='<%#
DataBinder.Eval(Container, "DataItem.Letter")%>'>
<%# DataBinder.Eval
(Container, "DataItem.Letter")%>
</asp:linkbutton>
</itemtemplate>
</asp:repeater>
In code-behind I've got:
this.rptLetters.ItemCommand += new
System.Web.UI.WebControls.RepeaterCommandEventHandler
(this.OnLetterClicked);
and
protected void OnLetterClicked(object source,
System.Web.UI.WebControls.RepeaterCommandEventArgs e)
{
if (e.CommandName == "Filter")
{
letterFilter = (string)
e.CommandArgument;
PopulateGrid();
}
}
and it is does not fire the click event!
However, if I replace link button with regular buttons
<asp:repeater id=rptLetters runat="server">
<itemtemplate>
<asp:button id="lnkLetter" runat="server"
commandname="Filter"
CommandArgument='<%#
DataBinder.Eval(Container, "DataItem.Letter")%>'
Text='<%# DataBinder.Eval
(Container, "DataItem.Letter")%>' />
</itemtemplate>
</asp:repeater>
exactly the the same code works fine.
I am using 1.0.3705 framework.
Is this a bug?
Thanks,
-Stan