I use the js lib you mention.
Include the .js file inside a script tag, add a named asp:Literal to the page
<asp:Literal ID="litCompare" runat="server">
</asp:Literal>
and add to the code-behind:
litComparison.Text = "<pre id=\"lbDiffPre\" class=\"code\"> </pre>";
ClientScript.RegisterStartupScript(GetType(), "calccompare",
@"document.getElementById('lbDiffPre').innerHTML =
diffString(document.getElementById('" + edit1.ClientID + "').value,
document.getElementById('" + edit2.ClientID + "').value).
replace(/\r\n/g, '<br>';", true);
In my case I had 2 controls which display the original values as well, you might want to include the strings literally in the diffString() function. The additional replace() converts \r\n line breaks into HTML line breaks.
devio
2008-12-11 16:48:00