Saturday, May 31, 2008

Creating Controls at Runtime

TextBox txt1 = new TextBox();
TextBox txt2 = new TextBox();
txt1.Text = "This is the textbox inside the placeholder";
txt2.Text = "This is the textbox inside the panel";
txt1.Style["width"] = "250px";
txt2.Style["width"] = "250px";
PlaceHolder1.Controls.Add(txt1);
Panel1.Controls.Add(txt2);

No comments:

Using Authorization with Swagger in ASP.NET Core

 Create Solution like below LoginModel.cs using System.ComponentModel.DataAnnotations; namespace UsingAuthorizationWithSwagger.Models {     ...