MVC: OnDropDownChange call controller
<p>I have this method on my controller</p>

<pre><code>public JsonResult GetPlaceImageUrls(int? id)
{
     string[] urls = PlaceService.
                      GetByID(id, "Images").
                      Images.Select(i =&gt; i.URL).
                      ToArray();
     return Json(urls.First(), JsonRequestBehavior.AllowGet);
}
</code></pre>

<p>And I am sure that it returns the data I want. I put onchange = "OnPlaceChange()" on my dropdown and I am also sure the onchange event is getting fired. However what I want to do is this:</p>

<pre><code>@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
&lt;script type="text/javascript"&gt;

    function OnPlaceChange() {
        var pid = document.getElementById("s_place").value;
        $.ajax({
            url: "admin/BlogEntries/GetPlaceImageUrls/" + pid,
            type: "GET",
            dataType: JSON,
            success: function (data) {
                window.alert(data);
            }
        });
    }

&lt;/script&gt; 
}
</code></pre>

<p>But this does not work. I put a breakpoint on the controller but it does not get hit. Any ideas? Regards.</p>

<p><strong>UPDATE</strong></p>

<pre><code>url: "/GetPlaceImageUrls/" + pid,
</code></pre>

<p>changing the ajax url solved the non hit breakpoint issue. However now, the success function does not work. </p>