Пример #1
0
        public static void BindProfessions(HtmlControl ctrl, Page thispage)
        {
            List <Profession> Plist = Profession.GetProfessionList();

            foreach (Profession p in Plist)
            {
                HtmlInputCheckBox rd_button  = new HtmlInputCheckBox();
                const string      GROUP_NAME = "Professions";
                rd_button.Name = GROUP_NAME;
                string LinkID = "Prof" + p.ProfessionID.ToString();
                rd_button.ID    = LinkID;
                rd_button.Value = p.ProfessionID.ToString();
                RegisterUserControl userprofession = (RegisterUserControl)thispage.LoadControl("~/RegisterUserControl.ascx");
                userprofession.imgP            = p.ProfPath;
                userprofession.fieldName       = p.ProfName;
                userprofession.IDnum           = p.ProfessionID;
                userprofession.RadioName       = "ContentPlaceHolder1_" + LinkID;
                userprofession.EnableViewState = true;
                rd_button.EnableViewState      = true;
                ctrl.Controls.Add(rd_button);
                ctrl.Controls.Add(userprofession);
            }
        }
Пример #2
0
        public static void BindKnowledge(HtmlControl ctrl, Page thispage)
        {
            List <Knowledge> Plist = Knowledge.RetKnowledgeList();

            foreach (Knowledge p in Plist)
            {
                HtmlInputCheckBox checkBox   = new HtmlInputCheckBox();
                const string      GROUP_NAME = "knowledge";
                checkBox.Name = GROUP_NAME;
                string LinkID = "Know" + p.ProgramID.ToString();
                checkBox.Attributes["id"] = LinkID;
                checkBox.ID    = LinkID;
                checkBox.Value = p.ProgramID.ToString();
                RegisterUserControl userprofession = (RegisterUserControl)thispage.LoadControl("~/RegisterUserControl.ascx");
                userprofession.imgP            = p.ProgPath;
                userprofession.fieldName       = p.PName;
                userprofession.IDnum           = p.ProgramID;
                userprofession.RadioName       = "ContentPlaceHolder1_" + LinkID;
                userprofession.EnableViewState = true;
                checkBox.EnableViewState       = true;
                ctrl.Controls.Add(checkBox);
                ctrl.Controls.Add(userprofession);
            }
        }