How to assign the javascript return value to c# code behind variable, while the page load. I am trying to do this. Please see the below example. I want the exact result like this.
Note : I already posted a question like this,but that is meaning less.
Javascript:
<script>
function GetValue() {
return 10;
}
</script>
C#.NET
protected void Page_Load(object sender, EventArgs e)
{
int Data
ClientScript.RegisterStartupScript(this.GetType(), "GetData", "a=GetValue();alert(a)", true);
Data=a;//a is Javascript Variable
}