Solution 1 :

If you have js code in _Calendar,the page which refernces _Calendar will not load the js code.And you need to put the js code of _Calendar into the page which refernces _Calendar.
Here is a demo worked.
Main.cshtml(reference a partial view):

    ViewData["Title"] = "Main";

<div style="height:400px;width:400px;border:1px solid red;">
    <partial name="_partial1" />
@section scripts{
    <script type="text/javascript">
        $("#div1").text("Hello World!");

_partial1.cshtml(in Shared folder):

<div id="div1">


enter image description here

Problem :

I need to create a partial view for a calendar and it’s not showing up I don’t know why. I try to display the partial view with:

    await Html.RenderPartialAsync("_Calendar");

I don’t know what the problem is…If I made a button in my navigation bar with:

<a class="nav-link text-dark" asp-area="" asp-controller="Booking" asp-action="Calendar">Calendar</a>

and then in the BookingController simply do this:

 public class BookingController : Controller
    public IActionResult Index()
        return View();

    public ActionResult Calendar()
        return View("_Calendar");

There it shows up..but not in the Booking Index like it should. Here are some images:
enter image description here

The red rectangle is where I want the _Calendar to be. This Image if what shows if I go to _Calendar using the nav bar:
enter image description here

The _Calendar partial view is in my shared folder. Let me know if you need any more information.

So I added a


inside the _Calendar and that shows up but the calender does not:
enter image description here


Comment posted by JamesS

Would it not be

Comment posted by Saty

Where in the BookingController ? how ? I only use the return View(“_Calendar”); for the navigation bar button and there it works. But I want the _Calendar to show up in the Booking Index that is why it should just show up when i do IActionResult Index return View(). It works with smaller and simpler partial views like