I am currently facing an issue with a div in my View that uploads a PartialView.
Below is the code snippet:
<div id="right2" style="border-style: solid; border-color: #1d69b4; border-radius: 10px;">
@Html.Partial("CalendarDefault")
</div>
Additionally, I need to change one PartialView to another upon clicking a button.
Here is the button code:
<button class="filled-button" onclick="myFunction()" style="background: #72c367">New Appointment</button>
Provided below is the JavaScript code for loading:
<script>
function myFunction() {
$("#right2").load(@Url.Action("SheduleNewAppointment","Calendar"));
}
</script>
However, I encountered the following errors:
myFunction is not defined at HTMLButtonElement.onclick (Index:125) Uncaught SyntaxError: Invalid regular expression flags
Any ideas on how I can resolve this?