I have a listview with a linkbutton button, also using the image button, and I want to do this call the "DummyChanged" method in my code using OnSelectedIndexChanged inside the list and using linkbutton with CommandName = "Select".
The problem is that this does not work, when I click on the button, there is no error or exception.
<asp:ListView ID="lvwDummy" runat="server" DataSourceID="odsDummy" DataKeyNames="Id" OnSelectedIndexChanged="DummyChanged" > <LayoutTemplate> <asp:PlaceHolder ID="itemPlaceholder" runat="server" /> </LayoutTemplate> <ItemTemplate> <input runat="server" type="checkbox" id="cbxApplication" onclick='CheckOne(this)' value='<%# Eval("Id") %>' /> <asp:LinkButton ID="lnkDummy" runat="server" CommandName="select" > <asp:Image ID="imgDummy" runat="server" ImageUrl="Dummy.jpg" ToolTip="Dummy" /> </asp:LinkButton> <br /><br /> </ItemTemplate> </asp:ListView> <asp:ObjectDataSource ID="odsDummy" runat="server" TypeName="XPTO.MyDummy.MyDummyController, XPTO, Version=1.0.0.0, Culture=neutral, PublicKeyToken=60d2c0583f4c4a69" DataObjectTypeName="MyDummyViewModel" SelectMethod='GetAllDummys' />
I am trying to call this code behind:
protected void DummyChanged(object sender, EventArgs e) { new SimpleLogger().LogInformation("Dummy: SelectedIndexChanged"); this.DataBind(); }
Any ideas on how to solve this?
Thanks in advance!
source share