protected void Page_Load(object sender, EventArgs e) { try { this.itemId = int.Parse(Request["id"].ToString()); } catch { } if (itemId == 0) { Response.Redirect("QuestionList.aspx"); } DataTable objdata = objAnswer.getList(itemId); dtlData.DataSource = objdata.DefaultView; dtlData.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { objData = objQuestion.getPublic(); if (objData == null) { return; } DataTable objDataAnswer = objAnswer.getList((int)objData["ID"]); if (objDataAnswer.Rows.Count == 0) { return; } countAnswerResult = objAnswer.getCountAnswerResult((int)objData["ID"]); if (!objSystem.isLogin()) { post = false; } else { DataRow objResult = objAnswer.getUserResult((int)objData["ID"]); if (objResult == null) { post = true; } else { result = (int)objResult["AnswerID"]; post = false; } } dtlQuestion.DataSource = objDataAnswer.DefaultView; dtlQuestion.DataBind(); } }