0

I'm planing to design star rating control in MVC. I've design input text to store rating value. I want to pass the input text with action link.

How to do that?

<input type="text" name="votenumber" class="ratingEvent rating5" value="5" />
<div><b id="result">5</b> start(s)</div>

@Html.ActionLink("Vote", "Vote", "Home")

Pass the input value to the action link or better idea pass to controller?

The b id= result will immediately change value when user selected others value.

Divyang Desai
  • 7,483
  • 13
  • 50
  • 76

1 Answers1

0

I think so , the better way is use jquery ajax and send it via this , such as this code

$('form').submit(function () {
    $.ajax({
        url: '/Home/Vote',
        type: 'GET',
        data: { search: $('#your text box').val()},
        success: function (result) {
            $('#your result div').html(result);
        }
    });
    return false;
});