Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

JavaScript in MVC 4

$
0
0

Good morning,

I would like JavaScript code embedded as a ASP.NET function request.

<script type="text/javascript">
    $(function () {
        $('#patient').autocomplete({
            source: '@Url.Action("PatientSearch", "Patient")',
            select: function (event, ui) {
                document.location.href = '@Url.Action("PatientSummary", "Patient", new { patientId = ui.item.value })';
            },
            minlength: 0
        });
    });
</script>

ui.item.value is a javascript variable.

Visual Studio marked this part red and stopped debugging.

Thanks
Samuel


Viewing all articles
Browse latest Browse all 5678

Trending Articles