I have a textarea something like this:
<textarea id="textreview" name="textreview"></textarea>
On the click of a button, I need this pass this information to a controller action defined inside the controller.
<button onclick="sendReview()"></button>
The jquery sendReview() function looks like this:
<script>
function sendReview() {
var textreview = $('#textreview').val();
window.location.href = '@Url.Action("ControllerAction", "ControllerName", new { review = textreview })'
}
</script>
However, unfortunately I get an error:
The name textreview does not exist in the current content
How can I send the parameter to the controller action?
Thanks for the help. Much appreciated.