title: JS missing formal parameter
body: <p>Within a website I need to switch panels during the load of a page based on a parameter set in code behind, and needs to be switched through javascript. The parameter is being included within the javascript function in code-behind but I am receiving an error of 'missing formal parameter', what may be the problem?</p>
  
  <p>Here is the code that is generated by the RegisterClientScriptBlock:</p>
  
  <pre><code>&lt;script language='javascript'&gt;function switchactionpanel(1)&lt;/script&gt;
  </code></pre>
  
  <p>Here is the code-behind that registers the script to call on load:</p>
  
  <pre><code>protected void Page_Init(object sender, EventArgs e)
  {
      String switchAction = "&lt;script language='javascript'&gt;function switchactionpanel(" + (int)((Global.upAction) Enum.Parse(typeof(Global.upAction), Global.ProfileAction.ToString())) + ")&lt;/script&gt;";
      Page.RegisterClientScriptBlock("switchaction", switchAction);
  }
  </code></pre>
  
  <p>Here is the javascript function within the aspx file:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function switchactionpanel(upaction) {
          switch (upaction) {
              case 1:
                  $('#urfcontainer').hide();
                  $('#rstcontainer').show();
                  break;
              case 2:
                  $('#urfcontainer').show();
                  $('#rstcontainer').hide();
                  break;
          };
      }
  &lt;/script&gt;
  </code></pre>