Hi Varun,
I would start, as I was you, with the answer from Suma.
Make a textbox, make it visible = false and enter the text value in your
page in that using your javascript.
Than you can get that as the
textbox.text in your code behind.
This is not the only possibility but surely the most simple to do.
Cor