Is it possible to call a Model function in a razor page like this (the function is never hit):
<input id="btnWork" type="submit" value="Work" onclick="writeLog("add to log");" />
However, I have this in my razor page and it hits the function on page load only:
{
<script>
function writeLog(msg)
{
@IndexModel.logHolder.Add("testing 123");
}
</script>
}

