title: How to give user confirmation message before ActionLink based on validation
body: <p>I have the following link.  On click, I'd like to check the item.primary_company field and if populated, give the user a warning and ask if they would like to continue.  How can I do this?</p>
  
  <pre><code>&lt;a href="&lt;%= Url.Action("Activate", new {id = item.company_id}) %&gt;" class="fg=button fg-button-icon-solo ui-state-default ui-corner-all"&gt;&lt;span class="ui-icon ui-icon-refresh"&gt;&lt;/span&gt;&lt;/a&gt;
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>I've changed to this, but nothing happens when clicked.  Also, I don't know how to reference the item to do the check on the primary_company field.  I only want to message to show if item.primary_company.HasValue.  I'd also like to show item.company1.company_name in the confirm message. </p>
  
  <pre><code>&lt;a href="#" onclick="return Actionclick("&lt;%= Url.Action("Activate", new {id = item.company_id}) %&gt;");" class="fg=button fg-button-icon-solo ui-state-default ui-corner-all"&gt;&lt;span class="ui-icon ui-icon-refresh"&gt;&lt;/span&gt;&lt;/a&gt;
  
  
  &lt;script type="text/javascript"&gt;
  function Actionclick(url)
  {
      alert("myclick");
      if ( confirm('Do you want to activate this company\'s primary company and all other subsidiaries?'))
          {
              location.href(url);
          }
  
  };
  &lt;/script&gt;
  </code></pre>