Ok, so I have a repeater which renders among other things a literal control which contains a string of JSON data. this data is lifted from a database and is set up as follows:
public void GetResults(string messageId)
{
var messages = MtFacade.GetResults(messageId).AsQueryable();
rptResults.DataSource = messages;
rptResults.DataBind();
}
MtFacade.GetResults return a list of the following class:
public class Results
{
public string SearchedString { get; set; }
public string MatchedString { get; set; }
public string Result { get; set; }
}
the field in question is the Result string. How would one render this JSON string in a repeater?
* EDIT * Aim is to make the JSON data more readable to the naked eye.
Repeater is:
<asp:Repeater runat="server" ID="rptDuplicates" ItemType="Models.DuplicateMessages" >
<ItemTemplate>
<div class="message">
<p><strong>Message: </strong><asp:Literal ID="ltMessage" runat="server" Text='<%# Item.Message %>'></asp:Literal></p>
<p><strong>Message Id: </strong><asp:Literal ID="ltMessageId" runat="server" Text='<%# Item.MessageId %>'></asp:Literal>
<p><strong>Matching Message Id: </strong><asp:Literal ID="ltMatchingMessageId" runat="server" Text='<%# Item.MatchingMessageId %>'></asp:Literal></p> \
</div>
</ItemTemplate>
</asp:Repeater>