-1

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

I Use CkEditor to Save My Data In SQL then Data Saved as HTML Tags In Database

When I want to Display Data In StimulSoft

My data Show As HTML Tag . but I want to Display with out Html Tags.

Abbas
  • 1
  • 2
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jan 27 '23 at 14:47

1 Answers1

0

Well, for the most part, you can directly display such content on a web page.

In most cases, even a simple label dropped onto the form will correctly render that column of data.

Say we have a simple GridView like this:

<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.

However, note that ONE column we have. I don't have ckedit installed, but I do have the ajaxtoolkit HTML editor. 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.

The results of the above grid are thus this:

enter image description here

A text box will not work, but a label will as per above. 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)

Albert D. Kallal
  • 42,205
  • 3
  • 34
  • 51