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 ?

Answers


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


Need Your Help

How to show sensor output using Dino and Sinatra?

javascript ruby asynchronous sinatra arduino

I would like to show on my page output from one of my sensor(moisture) connected to Arduino.

Method is not calling from UITableview?

ios objective-c uitableview methods uiviewcontroller

I have a UITableView and in didSelect method i'm calling method of another class with parameter and when i click the row i want to open that class xib with corresponding paramter .But here when i ...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.