You want to add CSS styles to ASP.NET controls from server side programmatically, you can use Style property available to all ASP.NET server controls.
TextBox1.Style.Add("border", "solid 2px blue");
TextBox1.Style.Add("background-color", "yellow");
TextBox2.Style.Add("font-weight", "bold");
TextBox2.Style.Add("color", "#336699");