title: How to open a view within a view in .Net Core MVC?
body: <p>I am developing a .Net Core application using MVC in Visual Studio 2017.</p>
  <p>I have been developing on it for some time, and 7 months ago I took a break. Now I have returned to develop further on it. Back then I &quot;learned&quot; that the way to render a view within a view was to create a <code>partialView</code> and render that using javascript/jQuery as follows:</p>
  <pre><code>$(&quot;#div_name&quot;).load(&lt;some-url&gt;, { id: &lt;some-id&gt; }, function() {
      console.log(&quot;loaded successfully&quot;);
  )};
  </code></pre>
  <p>I assume there are different &quot;integrated&quot; methods for doing this? I find it hard to believe that the only way to load a view within a view is by using javascript/jQuery. Does anyone have some knowledge to share? I can't seem to find anything on Google (but that might just be because I don't know what to search for).</p>
  <p>I have been reading up on partialViews and have found that these &quot;can&quot; be loaded from Razor, but if I want to get data from my database context I am unsure of how this would go about. Furthermore found something called components which I will take a look into myself.</p>
  <p>However my current problem is that I have a table in my view:
  <a href="https://i.stack.imgur.com/UtmsO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UtmsO.png" alt="enter image description here" /></a></p>
  <p>I want it to be that whenever I click a row inside that table I download some data from my DbContext (using my controller) and that data should be put inside a new view that is loaded within the first view so it would be like follows:
  <a href="https://i.stack.imgur.com/FUm41.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FUm41.png" alt="enter image description here" /></a></p>
  <p>Right now it works when I use static &quot;test&quot; data that I generate myself, inside my controller, but not when I try to connect to my DbContext in my controller, even though I am using async calls, I get no data passed through the view.</p>
  <p>I would think that .Net Core might have some other way to do this, as I think it is quite tedious to use javascript/jQuery to do this. Am I completely wrong?</p>
  <h1>EDIT:</h1>
  <p>After I did some error checking in my code I managed to get it to work (I had my input value to my Controller method receive an <code>int</code> when in fact the value passed was 15 characters long and started with a 3 (larger than the largest value allowed for an <code>int</code>). As soon as I changed the input to the method to a <code>long</code> it worked and I got my desired output. However I would still like to know if there's a different way to do this in .Net Core MVC.</p>