示例#1
0
        private void btnTestDoc_Click(object sender, EventArgs e)
        {
            int            question_id = test.questions_list[getSelectedQuestionIndex()].id;
            QuestionViewer obj         = new QuestionViewer(question_id);

            obj.Show();
        }
示例#2
0
        /// <summary>
        /// When implemented by a class, defines the <see cref="T:System.Web.UI.Control" /> object that child controls and templates belong to.
        /// These child controls are in turn defined within an inline template.
        /// </summary>
        /// <param name="container">The <see cref="T:System.Web.UI.Control" /> object to contain the instances of controls from the inline template.</param>
        public void InstantiateIn(Control container)
        {
            var mainPanel = new Panel();

            mainPanel.DataBinding += MainPanel_DataBinding;
            container.Controls.Add(mainPanel);

            var checkBox = new CheckBox()
            {
                Text = CheckBoxText, TextAlign = TextAlign.Right
            };

            checkBox.LabelAttributes.CssStyle.Add(HtmlTextWriterStyle.Display, "inline-block");
            checkBox.LabelAttributes.CssStyle.Add(HtmlTextWriterStyle.MarginLeft, "4px");
            mainPanel.Controls.Add(checkBox);

            var viewer = new QuestionViewer();

            viewer.DataBinding += Viewer_DataBinding;
            mainPanel.Controls.Add(viewer);
        }