General Information
.NET Subscription
Desktop
Web
Controls and Extensions
Mainteinance Mode
Enterprise and Analytic Tools
Quality Assurance and Productivity
Frameworks and Libraries
General Information
.NET Subscription
Desktop
Web
Controls and Extensions
Mainteinance Mode
Enterprise and Analytic Tools
Quality Assurance and Productivity
Frameworks and Libraries
HtmlEditorCssFile Class
Represents a link to the CSS file.
Namespace: DevExpress.Web.ASPxHtmlEditor
Assembly: DevExpress.Web.ASPxHtmlEditor.v19.2.dll
Declaration
public class HtmlEditorCssFile :
CollectionItem
Public Class HtmlEditorCssFile
Inherits CollectionItem
Remarks
The HtmlEditorCssFile represents a link to the CSS file which is linked to the web project. The HtmlEditorCssFile objects are held within the HtmlEditorCssFileCollection object and can be accessed by using the Collection<T>.Item property.
The path to a CSS file, which is referred to by the HtmlEditorCssFile object, can be defined via the HtmlEditorCssFile.FilePath property
Examples
This example illustrates how to customize the ASPxHtmlEditor's placeholders by using CSS styles.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/aspxhtmleditor-how-to-customize-appearance-of-placeholders-by-using-css-styles-t428160
- Default.aspx (C#)
- Default.aspx.cs
- ContentStyles.css (C#)
- Default.aspx (VB.NET)
- ContentStyles.css (VB.NET)
- Default.aspx.vb
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register assembly="DevExpress.Web.ASPxHtmlEditor.v16.1, Version=16.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxHtmlEditor" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.v16.1, Version=16.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.ASPxSpellChecker.v16.1, Version=16.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxSpellChecker" tagprefix="dx" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<dx:ASPxHtmlEditor ID="ASPxHtmlEditor1" runat="server">
<SettingsPlaceholders StartMark="[%" EndMark="%]" />
<CssFiles>
<dx:HtmlEditorCssFile FilePath="~/ContentStyles.css" />
</CssFiles>
<Placeholders>
<dx:HtmlEditorPlaceholderItem Value="FirstName" />
<dx:HtmlEditorPlaceholderItem Value="Date" />
</Placeholders>
</dx:ASPxHtmlEditor>
</div>
</form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
ASPxHtmlEditor1.Html = File.ReadAllText(Server.MapPath("~/Content.html"));
}
}
.dxhePlaceholder {
background-color: yellow;
}
.dxhePlaceholder:hover {
background-color: orange;
}
.dxhePlaceholder.dxheSelected {
background-color: red !important;
color: white !important;
}
<%@ Page Language="vb" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<%@ Register assembly="DevExpress.Web.ASPxHtmlEditor.v16.1, Version=16.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxHtmlEditor" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.v16.1, Version=16.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.ASPxSpellChecker.v16.1, Version=16.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxSpellChecker" tagprefix="dx" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<dx:ASPxHtmlEditor ID="ASPxHtmlEditor1" runat="server">
<SettingsPlaceholders StartMark="[%" EndMark="%]" />
<CssFiles>
<dx:HtmlEditorCssFile FilePath="~/ContentStyles.css" />
</CssFiles>
<Placeholders>
<dx:HtmlEditorPlaceholderItem Value="FirstName" />
<dx:HtmlEditorPlaceholderItem Value="Date" />
</Placeholders>
</dx:ASPxHtmlEditor>
</div>
</form>
</body>
</html>
.dxhePlaceholder {
background-color: yellow;
}
.dxhePlaceholder:hover {
background-color: orange;
}
.dxhePlaceholder.dxheSelected {
background-color: red !important;
color: white !important;
}
Imports System
Imports System.Collections.Generic
Imports System.IO
Imports System.Linq
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Partial Public Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
If Not IsPostBack Then
ASPxHtmlEditor1.Html = File.ReadAllText(Server.MapPath("~/Content.html"))
End If
End Sub
End Class