Hi,
Right, Reponse.Write cannot be used since no postback is done…
Since jqgrid doesn't postback to the server.. One option is to use ajax with code handler, or web service.
As for the javascript,
Whenever onSelectRow is called in jqgrid you assigned the ID to the hiddenfield. You don't have to use HiddenField, if you dont know about them you can just use a label and hide it.
However, if you do want to learn more about HiddenField, I suggest you to have a look into MSDN Library.
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.hiddenfield.aspx