【发布时间】:2010-02-01 21:46:37
【问题描述】:
我想在我用 C# 开发的 SharePoint Web 部件中更改 HtmlTextArea 的一些属性。 HtmlTextArea 被用作我正在拉入的一些 Sql Server 2005 数据的自定义显示,我想更改字体、颜色等,并将其设为只读。我看到有一些方法,例如 HtmlTextArea.Attributes.Add、HtmlTextArea.Attributes.AddAttributes 和 HtmlTextArea.Attributes.CssStyle,但我不确定这些方法是否合适,也不知道如何使用它们.我知道使用 ASP.NET TextArea 控件,我可以简单地使用内联 CSS,因此我试图找出一种在 C# 中设置内联 CSS 的方法。
另外,我想找到一种在控件之间添加换行符的方法,以帮助放置。我已经在 CreateChildControls 中布置了我的所有控件,但我看不出如何控制它们的位置。例如,我有类似的东西:
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); }
我希望 HtmlTextArea 显示在 ddls 下方。感谢大家的帮助。
【问题讨论】:
标签: c# asp.net css sharepoint newline