简体   繁体   English

如何在Stimulsoft中显示CKEditor数据? 在 WebForm 网格视图中?

[英]How To Display CKEditor Data In Stimulsoft? and In WebForm Grid View?

How To Display CKEditor Data In Stimulsoft?如何在Stimulsoft中显示CKEditor数据? and In WebForm Grid View?在 WebForm 网格视图中?

I Use CkEditor to Save My Data In SQL then Data Saved as HTML Tags In Database我使用 CkEditor 将我的数据保存在 SQL 中,然后数据在数据库中保存为 HTML 标签

When I want to Display Data In StimulSoft当我想在 StimulSoft 中显示数据时

My data Show As HTML Tag.我的数据显示为 HTML 标签。 but I want to Display with out Html Tags.但我想显示 Html 标签。

Well, for the most part, you can directly display such content on a web page.好吧,在大多数情况下,您可以直接在 web 页面上显示此类内容。

In most cases, even a simple label dropped onto the form will correctly render that column of data.在大多数情况下,即使是简单的 label 放到表单上也能正确呈现该列数据。

Say we have a simple GridView like this:假设我们有一个像这样的简单 GridView:

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
    DataKeyNames="ID"
    CssClass="table table-hover" Width="50%" GridLines="None"
    ShowHeaderWhenEmpty="true">
    <Columns>
        <asp:BoundField DataField="FirstName" HeaderText="FirstName" />
        <asp:BoundField DataField="LastName" HeaderText="LastName" />
        <asp:BoundField DataField="City" HeaderText="City" />
        <asp:BoundField DataField="HotelName" HeaderText="HotelName" />
        <asp:BoundField DataField="Description" HeaderText="Description" />
        <asp:TemplateField HeaderText="Info">
            <ItemTemplate>
                <asp:Label ID="lblMarkUp" runat="server" width="340px"
                    Text='<%# Eval("ImageInfo") %>' >
                </asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField>
            <ItemTemplate>
                <asp:Button ID="cmdEdit" runat="server" Text="Edit" CssClass="btn myshadow"
                    OnClick="cmdEdit_Click" />
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView>

and out code beind to load is this:要加载的代码是这样的:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    If Not IsPostBack Then
        LoadGrid()
    End If

End Sub

Sub LoadGrid()

    Dim strSQL As String = "SELECT * FROM tblHotelsP ORDER BY HotelName"
    GridView1.DataSource = Myrst(strSQL)
    GridView1.DataBind()

End Sub

So, all we did was shove a data.table right into the grid.所以,我们所做的就是将 data.table 直接推入网格。

However, note that ONE column we have.但是,请注意我们只有一列。 I don't have ckedit installed, but I do have the ajaxtoolkit HTML editor.我没有安装 ckedit,但我有 ajaxtoolkit HTML 编辑器。 The results will be the same.结果将是相同的。 We "save" that one column right into the database.我们将这一列直接“保存”到数据库中。

So, in most cases, any markup, and even ctrl-v to paste in a picture will work.因此,在大多数情况下,任何标记,甚至是粘贴到图片中的 ctrl-v 都可以。

The results of the above grid are thus this:因此,上述网格的结果是这样的:

在此处输入图像描述

A text box will not work, but a label will as per above.文本框将不起作用,但 label 将按照上述方式工作。 You can also say use a content placeholder or whatever.您也可以说使用内容占位符或其他内容。 However, I find just a simple label control works rather well in most cases (as the above example grid using a label shows)然而,我发现在大多数情况下,一个简单的 label 控件工作得相当好(如上面使用 label 的示例网格所示)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM