You have to use hidden field for that. Just add a hidden field and put your string into that hidden field.
Then you can easily access that value of hidden field into code behind;
e.g.;
Declare a hidden filed like this;
<
asp:HiddenField ID="hdnX" runat="server" />
Then in javascript file access it to store string like;
document.getElementById('h
dnX').value= str ;
And if u r using master page then access it as;
document.getElementById(
'<%=hdnX.ClientID%>').value= str ;
And in code behind access it as;
hdnX.Value
Best Luck!!!!!!!!!!!!!!!!!!!!
Sujit.