ClassLibraryWeiBao/WebSurvey/McssWebQuestion.cs

(完整代码) 1KB

namespace sstchur.web.survey
{
    using System;
    using System.Web.UI;
    using System.Web.UI.WebControls;

    public class McssWebQuestion : WebQuestion
    {
        private DropDownList m_dropDownList;
        private ListControl m_listControl;
        private RadioButtonList m_radioButtonList;

        public McssWebQuestion(string strId, bool bRequired, string strRequiredText, string strQuestion, string strControlBase, RepeatDirection rdLayout, string[] strResponses) : base(strId, "mcss", bRequired, strRequiredText, strQuestion)
        {
            this.m_radioButtonList = new RadioButtonList();
            this.m_dropDownList = new DropDownList();
            this.m_listControl = null;
            if (strControlBase == "dropdown")
            {
                this.m_listControl = this.m_dropDownList;
            }
            else
            {
                this.m_radioButtonList.RepeatDirection = rdLayout;
                this.m_listControl = this.m_radioButtonList;
            }
            foreach (string text in strResponses)
            {
                this.m_listControl.Items.Add(new ListItem(text));
            }
            this.m_listControl.ID = "lst_" + strId;
            if (bRequired)
            {
                ListControlValidator child = new ListControlValidator();
                child.EnableClientScript = false;
                child.Text = strRequiredText;
                child.Display = ValidatorDisplay.Dynamic;
                child.ControlToValidate = this.m_listControl.ID;
                this.Controls.Add(child);
            }
            this.Controls.Add(this.m_listControl);
            this.Controls.Add(new LiteralControl("</p>"));
        }

        public override void SetAnswer()
        {
            base.m_strAnswer = this.m_listControl.SelectedValue;
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。