c# - ASP.NET Select item from ListView not being called -
i wanted call listview's selectedindexchanged method doesn't go in selectedindexchanged method in runtime. here's code.
<asp:listview id="leftsidemessagelist" runat="server" itemplaceholderid="itemplaceholder1" datakeynames="id" onselectedindexchanged="leftsidemessagelist_selectedindexchanged" >
code behind:
protected void leftsidemessagelist_selectedindexchanged(object sender, eventargs e) { string pid = leftsidemessagelist.selecteddatakey.value.tostring(); messagebusinessclass mbc = new messagebusinessclass(); string x = pid; int id = convert.toint32(x); var grouplist = mbc.getspecificgroup(x, session["username"].tostring()); //session session["groupname"] = grouplist.groupname; session["remail"] = grouplist.recipient.email; // message getrightmessagelist(grouplist.recipient.email); }
edit:
i had linkbutton used call method removed , wanted use item selected event call method instead.
<asp:linkbutton id="lnkselect" runat="server" forecolor="white" >
you need set autopostback property true
<asp:listview id="leftsidemessagelist" runat="server" autopostback="true" itemplaceholderid="itemplaceholder1" datakeynames="id" onselectedindexchanged="leftsidemessagelist_selectedindexchanged" >
Comments
Post a Comment