How to Pass textbox value using @html.actionlink in asp.net mvc 3

asp.net-mvc, asp.net-mvc-3

Solution

Rather than passing your value using @Html.actionlink, try jquery to pass your textbox value to the controller as:

$(function () {
    $('form').submit(function () {
        $.ajax({
            url: this.action,
            type: this.method,
            data: { search: $('#textboxid').val()},
            success: function (result) {
                $('#mydiv').html(result);
            }
        });
        return false;
    });
});

This code will post your textbox value to the controller and returns the output result which will be loaded in the div "mydiv".

Problem

How to Pass value from text using @html.actionlink in asp.net mvc3 ?

Original source