0
votes

enter image description hereI am working on a web application. The process regarding the problem is that I am fetching users comments from DB using Entity Framework Model. I am using a listview to show Customers Name, Rating and Comments. The problem is that I am using a Ajax toolkit control called HTMLEditor for storing comments in the DB, so when I have to display the comments, I need the same control ie HTML Editor. Now when I use the following code to create the ITEMTEMPLATE for the listview,

 <ItemTemplate>
<tr style="background-color:#EDECB3;color: #000000;"> 
<td><%# Eval("CustomerName")%></td>
    <td> <img src='Styles/Images/ReviewRating<%# Eval("Rating") %>.png' alt="">
    <br />
    </td>
    <td> <cc1:Editor ID="Comments" runat="server" Text="<%#Eval("Comments") %>"/>
    </td>
    </tr>
    </ItemTemplate>

Everything is working except the line

 <td> <cc1:Editor ID="Comments" runat="server" Text="<%#Eval("Comments") %>"/>
        </td>

It says that the server tag is not well formed. please help.

Updated Error: I added nounicode="true". and the error I encountered is

Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "AjaxControlToolkit.Properties.Resources.NET4.resources" was correctly embedded or linked into assembly "AjaxControlToolkit" at compile time, or that all the satellite assemblies required are loadable and fully signed.

Screenshot showing editor within listview

4
Just to be sure, Have you tried to remove that tag and it worked? Sometimes the error may be generated by another section.Boomer
Yes its working.Its also working if i use no control and just the EVAL expression within the <td></td>.Samarth Agarwal

4 Answers

0
votes

you should try

<cc1:Editor ID="Comments" runat="server" Text="<%#Eval('Comments') %>"/>

the text proprty is not the same.

0
votes

Try below code:

Text='<%#Eval("Comments") %>'

0
votes

Using the ScriptManager on the page solve the problem. As far as the problem of displaying HTML text in HTML Editor is concerned, I decided not to use the HTML Editor from Ajax Control Toolkit. Rather I displayed the html text raw on the page using the html decoding utility like this,

<%#Server.HtmlDecode(Eval("Comments").ToString()) %>
0
votes

"rr_only4you" told that answer is correct, i got the error like use blow one

Text="<%#Eval("Comments") %>"

after that i change that to

Text='<%# Eval("Comments") %>'

this format it will correct,

you use this one

<cc1:Editor ID="Comments" runat="server"><%# Eval("Comments") %></cc1>