Exemple #1
0
        private void InitializeComponent()
        {
            cbWebForms  = new global::My.AspNetCore.WebForms.Controls.CheckBox();
            cbMVC       = new global::My.AspNetCore.WebForms.Controls.CheckBox();
            rbCS        = new global::My.AspNetCore.WebForms.Controls.RadioButton();
            rbFS        = new global::My.AspNetCore.WebForms.Controls.RadioButton();
            rbVB        = new global::My.AspNetCore.WebForms.Controls.RadioButton();
            ddlGender   = new global::My.AspNetCore.WebForms.Controls.DropDownList();
            litGreeting = new global::My.AspNetCore.WebForms.Controls.Literal();
            litPostBack = new global::My.AspNetCore.WebForms.Controls.Literal();
            btnPost     = new global::My.AspNetCore.WebForms.Controls.Button();
            hlText      = new global::My.AspNetCore.WebForms.Controls.HyperLink();
            hlImage     = new global::My.AspNetCore.WebForms.Controls.HyperLink();
            imgLogo     = new global::My.AspNetCore.WebForms.Controls.Image();

            //
            // cbWebForms
            //
            this.cbWebForms.Name         = "cbWebForms";
            this.cbWebForms.Text         = "WebForms";
            this.cbWebForms.AutoPostBack = true;

            //
            // cbMVC
            //
            this.cbMVC.Name         = "cbMVC";
            this.cbMVC.Text         = "MVC";
            this.cbMVC.AutoPostBack = true;

            //
            // rbCS
            //
            this.rbCS.Name         = "rbCS";
            this.rbCS.GroupName    = "Languages";
            this.rbCS.Text         = "C#";
            this.rbCS.AutoPostBack = true;

            //
            // rbFS
            //
            this.rbFS.Name         = "rbFS";
            this.rbFS.GroupName    = "Languages";
            this.rbFS.Text         = "F#";
            this.rbFS.AutoPostBack = true;

            //
            // rbVB
            //
            this.rbVB.Name         = "rbVB";
            this.rbVB.GroupName    = "Languages";
            this.rbVB.Text         = "VB";
            this.rbVB.AutoPostBack = true;

            //
            // ddlGender
            //
            this.ddlGender.Name         = "ddlGender";
            this.ddlGender.AutoPostBack = true;
            this.ddlGender.Items        = new List <ListItem>
            {
                new ListItem("Male"),
                new ListItem("Female")
            };

            //
            // litGreeting
            //
            this.litGreeting.Name = "litGreeting";

            //
            // litPostBack
            //
            this.litPostBack.Name = "litPostBack";
            this.litPostBack.Text = "IsPostBack: False";

            //
            // btnPost
            //
            this.btnPost.Name     = "btnPost";
            this.btnPost.Text     = "Post";
            this.btnPost.CssClass = "btn btn-primary";

            //
            // hlText
            //
            this.hlText.Name          = "hlText";
            this.hlText.NavigationUrl = "https://github.com/";
            this.hlText.Text          = "GitHub";

            //
            // hlImage
            //
            this.hlImage.Name          = "hlImage";
            this.hlImage.NavigationUrl = "https://github.com/";
            this.hlImage.ImageUrl      = "Images/github-logo.png";
            this.hlImage.ImageHeight   = 50;
            this.hlImage.ImageWidth    = 50;

            //
            // imgLogo
            //
            this.imgLogo.Name          = "imgLogo";
            this.imgLogo.ImageUrl      = "Images/github-logo.png";
            this.imgLogo.AlternateText = "GitHub";
            this.imgLogo.ImageAlign    = ImageAlign.Left;

            this.Title = "Home";
            this.Load += Page_Load;
            this.Controls.Add(cbWebForms);
            this.Controls.Add(cbMVC);
            this.Controls.Add(rbCS);
            this.Controls.Add(rbFS);
            this.Controls.Add(rbVB);
            this.Controls.Add(ddlGender);
            this.Controls.Add(litGreeting);
            this.Controls.Add(litPostBack);
            this.Controls.Add(btnPost);
            this.Controls.Add(hlText);
            this.Controls.Add(hlImage);
            this.Controls.Add(imgLogo);
        }
Exemple #2
0
        private void InitializeComponent()
        {
            txtNumber1 = new global::My.AspNetCore.WebForms.Controls.TextBox();
            txtNumber2 = new global::My.AspNetCore.WebForms.Controls.TextBox();
            btnAdd     = new global::My.AspNetCore.WebForms.Controls.Button();
            btnSub     = new global::My.AspNetCore.WebForms.Controls.Button();
            btnMul     = new global::My.AspNetCore.WebForms.Controls.Button();
            btnDiv     = new global::My.AspNetCore.WebForms.Controls.Button();
            litResult  = new global::My.AspNetCore.WebForms.Controls.Literal();

            //
            // txtNumber1
            //
            this.txtNumber1.Name     = "txtNumber1";
            this.txtNumber1.CssClass = "form-control";

            //
            // txtNumber2
            //
            this.txtNumber2.Name     = "txtNumber2";
            this.txtNumber2.CssClass = "form-control";

            //
            // btnAdd
            //
            this.btnAdd.Name        = "btnAdd";
            this.btnAdd.CssClass    = "btn btn-primary";
            this.btnAdd.Text        = "Add";
            this.btnAdd.CommandName = "Add";
            this.btnAdd.Command    += Button_Command;

            //
            // btnSub
            //
            this.btnSub.Name        = "btnSub";
            this.btnSub.CssClass    = "btn btn-primary";
            this.btnSub.Text        = "Sub";
            this.btnSub.CommandName = "Sub";
            this.btnSub.Command    += Button_Command;

            //
            // btnMul
            //
            this.btnMul.Name        = "btnMul";
            this.btnMul.CssClass    = "btn btn-primary";
            this.btnMul.Text        = "Mul";
            this.btnMul.CommandName = "Mul";
            this.btnMul.Command    += Button_Command;

            //
            // btnDiv
            //
            this.btnDiv.Name        = "btnDiv";
            this.btnDiv.CssClass    = "btn btn-primary";
            this.btnDiv.Text        = "Div";
            this.btnDiv.CommandName = "Div";
            this.btnDiv.Command    += Button_Command;

            //
            // litResult
            //
            this.litResult.Name = "litResult";

            this.Title = "Calculator";
            this.Controls.Add(txtNumber1);
            this.Controls.Add(txtNumber2);
            this.Controls.Add(btnAdd);
            this.Controls.Add(btnSub);
            this.Controls.Add(btnMul);
            this.Controls.Add(btnDiv);
            this.Controls.Add(litResult);
        }