Not sure what Graus is talking about, so I thought I'd create a working example. The page:
<%@ Page Language="C#" AutoEventWireup="true"
CodeBehind="Default.aspx.cs"
Inherits="WebApplication1._Default" %>
<html>
<body>
<form id="form1" runat="server">
<div>
<input runat="server" id="myData" type="hidden" />
<script language="javascript">
var field = document.getElementById("<%= myData.ClientID %>");
field.value = "javascript set this value";
</script>
<asp:Button runat="server" ID="btnGo" Text="Go" />
</div>
</form>
</body>
</html>
The code behind:
namespace WebApplication1
{
using System;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack)
{
btnGo.Text = myData.Value;
}
}
}
}