title: Show modal after clicking on a button with asp.net core MVC
body: <p>I am trying to implement a semantic-ui modal with asp.net-core 2.0 MVC, which should show after being clicked on a button, but after trying and searching for 5 hours now I've got no solution. How can i define an eventhandling for this situation (it doesn't work with controllers too).</p>
  
  <p>JavaScript</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;script&gt;
          function toggle_modula(id) {
              document.getElementById(id).innerHTML = '&lt;div class="ui container"&gt;&lt;div class ="ui modal"&gt;&lt;div class="header"&gt;Hi There!&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class ="Content"&gt;hello World&lt;/div&gt;';
              run();
          }
  &lt;/script&gt;
          
  &lt;script&gt;function run() {
              $('.ui.modal').modal('toggle');
  }&lt;/script&gt;</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://semantic-ui.com/dist/semantic.min.js"&gt;&lt;/script&gt;
  &lt;link href="https://semantic-ui.com/dist/semantic.min.css" rel="stylesheet"/&gt;
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;button id="editButton" onclick="toggle_modula('insertcodehere');"&gt;Click Me&lt;/button&gt;
  
  
  &lt;div id="insertcodehere"&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Reference:<a href="https://semantic-ui.com/modules/modal" rel="nofollow noreferrer" title="Reference">semantic-ui information</a></p>
  
  <p>Thank you very much and sorry for disturbing!</p>