Hi nauna,
Check this example. Now please take its reference and correct your code.
HTML
<asp:ListView ID="lvhtml" runat="server" GroupPlaceholderID="groupPlaceHolder1" ItemPlaceholderID="itemPlaceHolder1">
<LayoutTemplate>
<table id="ListViewTable" cellpadding="0" cellspacing="0" border="1" style="border-collapse: collapse">
<tr>
<th>HTML(Encoded)</th>
<th>HTML(Decoded)</th>
</tr>
<asp:PlaceHolder runat="server" ID="groupPlaceHolder1"></asp:PlaceHolder>
</table>
</LayoutTemplate>
<GroupTemplate>
<tr>
<asp:PlaceHolder runat="server" ID="itemPlaceHolder1"></asp:PlaceHolder>
</tr>
</GroupTemplate>
<ItemTemplate>
<td><%# HttpUtility.HtmlEncode(Eval("HTML").ToString()) %></td>
<td><%# HttpUtility.HtmlDecode(Eval("HTML").ToString()) %></td>
</ItemTemplate>
</asp:ListView>
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
string html = System.IO.File.ReadAllText(Server.MapPath("~/HTML.txt"));
System.Data.DataTable dt = new System.Data.DataTable();
dt.Columns.Add("HTML");
dt.Rows.Add(html);
lvhtml.DataSource = dt;
lvhtml.DataBind();
}
}
VB.Net
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
If Not Me.IsPostBack Then
Dim html As String = IO.File.ReadAllText(Server.MapPath("~/HTML.txt"))
Dim dt As Data.DataTable = New Data.DataTable()
dt.Columns.Add("HTML")
dt.Rows.Add(html)
lvhtml.DataSource = dt
lvhtml.DataBind()
End If
End Sub