I want to share the currentTab variable which exists on the C# server side with JavaScript. Here is my code:
C#:
public
You can write the index from your javascript function, to a hiddenfield, and then read that on postback.
In your code, you check the hiddenfield, if your page is postback. Like so:
protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack)
{
currentTab = Int32.Parse(HiddenTabValue.Value);
}
}