DOM replacement on backend (asp.net)
I am new to asp.net and I am currently having this on front-end to replace DOM node:
$('foo:eq(0) bar:eq(1)').html('Hello World');
What is the best way to do it on back-end asp.net? (1)node.js+jQuey (2)CsQuery
Is there any simple solution that doesn't need any plugin? Say razor + xpath ?
You can't use nodejs+jQuery if you're using asp.net.
With CsQuery the replacement is quite obvious:
CQ.Create("YOUR HTML STRING")['foo:eq(0) bar:eq(1)'].Html('Hello World').Render();
CsQuery comes with an ASP.NET MVC plugin to make development even easier. That really depends on your use case.
If you don't want an external dependencies you can use LinqToXML but I honestly think that if you'd like to run jQuery queries and use jQuery methods the closest you're going to get in .net is CsQuery