protected void GrvQuestions_RowCommand(object sender, GridViewCommandEventArgs e) { Field1.Visible = false; Field2.Visible = true; Session["QuestionId"] = e.CommandArgument.ToString(); objQuestions = new clsQuestionAnswers(); objQuestions.QuestionId = Convert.ToInt32(Session["QuestionId"]); DataSet ds = objQuestions.GetQuestionById(); lblQuestion.Text = ds.Tables[0].Rows[0][0].ToString(); }
protected void GRVPostedQuestions_RowCommand(object sender, GridViewCommandEventArgs e) { Field2.Visible = true; objQuestions = new clsQuestionAnswers(); objQuestions.QuestionId = Convert.ToInt32(e.CommandArgument.ToString()); DataSet dsAnswers = objQuestions.GetPostedAnswersByQuestionId(); if (dsAnswers.Tables[0].Rows.Count > 0) { GRVAnswers.DataSource = dsAnswers.Tables[0]; GRVAnswers.DataBind(); } DataSet dsQuestion = objQuestions.GetQuestionById(); lblQuestion.Text = dsQuestion.Tables[0].Rows[0][0].ToString(); }