1.The JavaScript code (including jQuery), is executed automatically on the client (internet browser) and this speed up the web application response to user actions.
2.The C# code in ASP.NET is executed on the server on the page request or postbacks. See details in the next link:
http://msdn.microsoft.com/en-us/library/vstudio/ms178472(v=vs.100).aspx[
^]
3.The short answer is you cannot do the conversion from JavaScript into C# code and also make no sense to do such conversion. What you can do, if you need to extend your code for searching, is to use
jQuery
together with
AJAX
to call a search method implemented in C# code in your code behind. See details in the next article:
Using jQuery for AJAX in ASP.NET[
^]