protected void btnDelete_Click(object sender, EventArgs e) { //Call delete conversation API if (lvLastMessages.SelectedIndex > -1) { HiddenField hdfield = (HiddenField)lvLastMessages.Items[lvLastMessages.SelectedIndex].FindControl("hfConvID"); if (hdfield != null) { if (TelligentService.DeleteConversation(ScreenName, hdfield.Value)) { BindConversations(true); rptMessages.DataSource = new List <Message>(); rptMessages.DataBind(); } } } }