- Online Barcode Generator
- How To
- Buy Now
Information to CSS Style Drop-down
What is css class drop-down? Within the PerHtmlEditor Control, the drop-down that is used to display all the classes and that is often placed at the toolbar of the html editor is called the css class drop-down. And with the css class drop-down, developers can easily list the classes that are either defined in the page or from external css files.
In following text, we will put the focus on how to add various css styles to a pre-defined collection for creating a css class drop-down. To help you have a general understanding of the css class drop-down, we here offer a screen shot of this drop-down.
How to Add CSS Style to Drop-down in ASP.NET
The css class drop-down of the PerHtmlEditor Control is created from the collection of CssClasses. Therefore, the essence of creating the css class drop-down is to add css styles to the CssClasses collection. And in this section, we will offer you two methods to add css styles to collection.
But for either of these two methods, the first thing you need to do is to define the properties of various css items using css code, as is what has been instructed in following sample code.
One method for creating the css class drop-down is to declare the CssClasses collection in aspx web page. Following example is provided here to guide developers how to add css styles to target collection via aspx code.
<kettic:PerHtmlEditor runat="server" ID="PerHtmlEditor1" SkinID="DefaultSetOfTools"
The other method for adding css classes to collection is to use C# code. Similarly, we here specifically attach a sample C# code to guide developers to add css styles to drop-down using C# code programmatically.
PerHtmlEditor1.CssClasses.Add("redText ", ".redText");
Related Tutorials for Other Supported HtmlEditor Drop-downs
Besides the drop-down collection of css styles, the PerHtmlEditor Control for ASP.NET AJAX also allows users to create other commonly used drop-downs in html editor. Following links will take you to detailed programming guiding pages on how to add these drop-downs to html editor in ASP.NET web application.
ASP.NET AJAX UI Controls