示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            Ac1.DataSource = GetAll();
            Ac1.DataBind();
            ViewState.Add("Language", "EN");

            if (Request.QueryString["QuestionID"] != null)
            {
                ViewState.Add("QuestionID", Request.QueryString["QuestionID"]);
                DisplayAnswer(ViewState["QuestionID"].ToString());
                //Ac1.SelectedIndex = 2;
                foreach (GridViewRow gvRow in Ac1.Rows)
                {
                    if (Ac1.DataKeys[gvRow.DataItemIndex].Value.ToString() == ViewState["QuestionID"].ToString())
                    {
                        Ac1.SelectedIndex = gvRow.DataItemIndex;
                        break;
                    }
                }
            }

            //if (GeneralClass.UserName() == "dh" || GeneralClass.UserName() == "editor"
            //    || GeneralClass.UserName() == "jo" || GeneralClass.UserName() == "milo")
            //{
            //    hlQuestionsEdit.Visible = true;
            //}
        }
    }
示例#2
0
    protected void rbl_BC_Language_SelectedIndexChanged(object sender, EventArgs e)
    {
        Answer.Text       = "";
        Ac1.SelectedIndex = -1;
        phAnswer.Visible  = false;

        Ac1.DataSource = GetAll();
        Ac1.DataBind();
    }