title: Open component view from code behind
body: <p>I am using mvc 6 and I would like to "open" component view by using some button onClick.</p>
  
  <p>I can display it by using </p>
  
  <pre><code>&lt;div id="DialogDiv"&gt;
     @Component.Invoke("MyComponent");
  &lt;/div&gt; 
  </code></pre>
  
  <p>but I would like to do it so that some button onclick method would call that invoke method and give that div as a reference. Is that possible?</p>