I would use ASP.NET AJAX PageMethods/WebService.
You could trigger the javascript call to your PageMethod on window.unload and then fill in the fields as necessary.
Or you could have an UpdatePanel with your label controls in it. Choose not to render the labels unless ScriptManger1.IsInAsyncPostBack == True. Then you trigger a postback on that UpdatePanel via javascript in window.unload by calling __doPostBack('NameOfControlInUpdatePanel,'')
Just some quick ideas.