title: Can I mix & match javascript with server-side code in javascript?
body: <p>I know this might be an odd situation but currently I need to mix javascript with server side code as follows:</p>
  
  <pre><code> function PerformGlobalCallback(sender, value) {
          var index = hfCurrentTabIndex.Get("activeIndex"));
          window['&lt;%= ((ASPxCallbackPanel)myTabControl.TabPages[index].Controls[0]).ClientInstanceName %&gt;'].PerformCallback(sender + "|" + value);
      } 
  </code></pre>
  
  <p>where hfCurrentTabIndex is a hidden field which correctly holds the value of the current tab index.
  I know I cannot simply put the "index" variable in the &lt;%= %> section so I need to come up with a way to do it.</p>
  
  <p>The reason I need this is because the myTabControl current tab index is somehow lost in between callbacks. Also, even though I store it in Session, I get null when I access it in the above code.  </p>
  
  <p>Please let me know if you have any insights. Appreciate your help.</p>