title: How to call javascript function from asp.net code behind function
body: <p>javascript code</p>
  
  <pre><code>function logoutPop() {
         var a = confirm("are you sure !");
         if (a = true)
             return true;
         else return false;
      }
  </code></pre>
  
  <p>aspx file</p>
  
  <pre><code>    protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
          {
              string selectedItem = e.Item.Value;
              if (selectedItem == "logout")
              {
  // here i want to call javascript function logoutPop() and check return value. if true want to redirect login page else nothing.
  </code></pre>
  
  <p>Is there any way to do this . I tried scriptmanager but not success . Please help . Thank you.</p>