I'd like to change some of the attributes of an HtmlTextArea in a SharePoint web part that I'm developing in C#. The HtmlTextArea is being used as a customized display for some Sql Server 2005 data that I'm pulling in and I'd like to change the font, color, etc., and make it read-only. I see that there are a few methods, such as HtmlTextArea.Attributes.Add, HtmlTextArea.Attributes.AddAttributes, and HtmlTextArea.Attributes.CssStyle, but I'm not sure if these are the proper ones to use, nor how to use them. I know that with an ASP.NET TextArea control I can simply use inline CSS, so I'm trying to figure out a way to set that inline CSS from within C#.
Also, I'd like to find out a way to add a newline in between controls, just to aid in placement. I have laid out all of my controls in CreateChildControls, but I don't see how I can get control over their placement. For instance, I have something like:
protected override void CreateChildControls() { customers = new DropDownList(); customers.ID = "customers"; Controls.Add(customers); machines = new DropDownList(); machines.ID = "machines"; Controls.Add(machines); specsOutput = new HtmlTextArea(); specsOutput.ID = "specsOutput"; Controls.Add(specsOutput); }
I would like for the HtmlTextArea to be displayed below the ddls. Thanks for everyone's help.