protected void lbStudentsList_Click(object sender, EventArgs e) { if (IsLoggedIn) { HiddenField rowHdnSessionID = (sender as LinkButton).NamingContainer.FindControl("hdnSessionID") as HiddenField; if (rowHdnSessionID != null) { int sessionId = int.Parse(rowHdnSessionID.Value); Result <List <StudentSessionsListView> > result = cms.GetSessionStudents(sessionId); if (result.isSuccess) { gvSessionStudents.DataSource = result.resultObject; } else { gvSessionStudents.DataSource = null; } gvSessionStudents.DataBind(); ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "showStudentListModal();", true); } } }