Skip to content

DevExpress-Examples/asp-net-web-forms-html-editor-bind-html-property-to-database

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTML Editor for ASP.NET Web Forms - How to bind the Html property to a database field

This example demonstrates how to add the ASPxHtmlEditor to the FormView control's template and use the Bind method to bind the editor's content to the corresponding data source field.

Overview

Add the FormView control to the page, bind it to a data source, and specify a field to get its data from the data source.

Add the ASPxHtmlEditor to the FormView's template and specify the editor's markup - use the Bind method to bind the editor's Html property to the corresponding field in the FormView's data source.

<asp:FormView ID="FormView1" runat="server" DataKeyNames="ID" DataSourceID="AccessDataSource1"
    AllowPaging="True">
    <ItemTemplate>
        <dx:ASPxHtmlEditor ID="ASPxHtmlEditor1" runat="server" Html='<%# Bind("Html") %>'>
            <Settings AllowDesignView="False" AllowHtmlView="False" />
        </dx:ASPxHtmlEditor>
    </ItemTemplate>
</asp:FormView>
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/HtmlEditorSampleDB.mdb"
    SelectCommand="SELECT * FROM [Html]">
</asp:AccessDataSource>

Files to Review

Documentation

More Examples

About

Add the ASPxHtmlEditor to the FormView control's template and use the Bind method to bind the editor's content to the corresponding data source field.

Topics

Resources

License

Stars

Watchers

Forks