500 Internal Server Error JsonResult mvc asp.net
<p>trying to create a cascading dropdownmenu with jsonresult and ajax, but i cant see why am i getting 500 Internal Server Error. The error occurs above the following method :</p>

<pre><code>    [HttpGet]
    public JsonResult GetModels(string brandID="")
    {
        List&lt;Model&gt; models = new List&lt;Model&gt;();
        int ID = 0;
        if (int.TryParse(brandID, out ID))
        {
            using (CarsEntities1 dc = new CarsEntities1())
            {
         models = dc.Models.Where(a =&gt; a.Brand_ID == ID).OrderBy(a =&gt;a.Model_name).ToList();  
            }
        }
        if (Request.IsAjaxRequest())
        {

            return new JsonResult
            {
                Data = models,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            };
        }
        else
        {
            return new JsonResult
            {
                Data = "Not valid request",
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            };
        }
    }
</code></pre>

<p>I use the method to pass a list of items into DropDownMenu and try to output the list by the following code  : </p>

<pre><code>$(document).ready(function () {
        //if (typeof ($) == 'function') alert('jQuery is loaded.');
        $("#brand_Brand_ID").change(function () {
            // this will call when Brand Dropdown select change
            var brandID = parseInt($("#brand_Brand_ID").val());
            if (!isNaN(brandID)) {
                var ddModel = $("#Model_ID");
                ddModel.empty(); // this line is for clear all items from Model dropdown
                ddModel.append($("&lt;option&gt;&lt;/option").val("").html("Select model"));
                // Here I will call Controller Action via Jquery to load Model for selected Brand
                $.ajax({
                    url: "@Url.Action("GetModels","ModelSpec")",
                    type: "GET",
                    data: { brandID: brandID },
                    dataType: "json",
                    success: function (data) {
                        if (data != null &amp;&amp; data.success) {
                            $.each(data, function (i, val) {
                                ddModel.append(
                                        $("&lt;option&gt;&lt;/option&gt;").val(val.Model_ID).html(val.Model_name)
                                    );
                            });
                        }
                    },
                    error: function () {
                        alert("Fail");

                    }
                });
            }
        });
    });
</code></pre>

<p>All i get is the following :
GET <a href="http://localhost:2508/ModelSpec/GetModels?brandID=2" rel="nofollow">http://localhost:2508/ModelSpec/GetModels?brandID=2</a> 500 Internal Server Error jquery-1.7.1.js (line 8102)</p>

<p>Also i noticed the error doesnt occur when theres no data passing through the GetModels method. And sometimes i get :
GET /ModelSpec/GetModels?brandID=5  401 Unauthorized</p>

<p>As soon as GetModels returns anything the error occurs else not.</p>

<p><code>The ObjectContext instance has been disposed and can no longer be used for
 operations that require a connection</code></p>

<p>Stacktrace :
<a href="http://pastebin.com/3aXg7YiM" rel="nofollow">http://pastebin.com/3aXg7YiM</a>    </p>