예제 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
            return;

        SelectSections();

        if (Request.QueryString["ID"] != null)
        {
            if (Request.QueryString["ID"] == "True")
            {
                lblMsg.Text = "Successfully Edited";
            }
        }

        if (Request.QueryString["QuestionId"] != null)
        {
            int QuestionId = Convert.ToInt32(Request.QueryString["QuestionId"]);
            dtFAQs = taFAQs.SelectQuestionsbyQuestionId(QuestionId);
            if (dtFAQs.Rows.Count > 0)
            {
                ddlSection.Items.FindByValue(dtFAQs[0].SectionId.ToString()).Selected = true;
                txtQuestion.Text = dtFAQs[0].Question.ToString();
                txtAnswer.Text = dtFAQs[0].Answer.ToString();
                txtSortOrder.Text = dtFAQs[0].Sort.ToString();
            }
            else
            {
                lblMsg.Text = "No record found";
                btnEdit.Visible = false;
                return;
            }
        }
        else
        {
            lblMsg.Text = "No record found";
            btnEdit.Visible = false;
            return;
        }
    }
예제 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
            return;

        if (Request.QueryString["SectionId"] != null)
        {
            int SectionId = Convert.ToInt32(Request.QueryString["SectionId"]);
            dtSections = taSections.SelectSectionsbySectionId(SectionId);
            if (dtSections.Rows.Count > 0)
            {

                dtFAQ = taFAQ.SelectQuestionsbySectionId(SectionId);
                if (dtFAQ.Rows.Count > 0)
                {

                    Repeater2.DataSource = dtFAQ;

                    Repeater2.DataBind();
                }
                else
                {

                    Repeater2.Visible = false;
                }
            }
            else
            {

                Repeater2.Visible = false;
            }
        }
        else
        {

            Repeater2.Visible = false;
        }
    }