I am trying to render a page as below from my controller
$this->renderPartial("_ReservationDetails",array('rowarray'=>$rowarray,'CalendarID'=>$CalendarID),false,true);
in my view file, _ReservationDetails I have the following content
....
...
<td>
<button id="btnPrint" onclick="return PrintReciept();" class="btn btn-small" type="button">Print Reservation</button>
</td>
....
I wrote a script inside the _ReservationDetails as below
<script>
public function PrintReciept()
{
alert("I am here!");
return false;
}
</script>
But when I click on PrintReservation
button it throws an error in the console. PrintReciept() is not defined
Why is it happening?