CREATE FILE encountered operating system error 5(Access is denied.)
<p>I am creating a cascading dropdown and receiving the error <strong>CREATE FILE encountered operating system error 5(Access is denied.)</strong> when the dropdown is initializing. I built a EF database first application and no files should be created. No idea why it would be trying to create any files.</p>

<p>My cascading dropdowns are a Manufacturer dropdown that when selected another dropdown is loaded with corresponding Models.</p>

<p>the ViewModel that created - </p>

<pre><code>public class ManufacturerModelContext : DbContext
{

public DbSet&lt;Manufacturer&gt; Manufacturers { get; set; }
public DbSet&lt;ManufacturerModel&gt; ManufacturerModels { get; set; }
}
</code></pre>

<p>I populate the dropdowns with - </p>

<pre><code>//Populate the cascading dropdowns for manufacturer and model
ManufacturerModelContext mm = new ManufacturerModelContext();
[HttpGet]
public JsonResult GetManufacturers()
{

    var manufacturer = from a in mm.Manufacturers
                       select a.Manufacturer1;

    return Json(manufacturer.ToList(), JsonRequestBehavior.AllowGet);

}

public JsonResult GetModelsByManufacturerID(string manufacturerId)
{

    int Id = Convert.ToInt32(manufacturerId);

    var models = from a in mm.ManufacturerModels where a.ManufacturerID == Id select a;

    return Json(models);
}
</code></pre>

<p>my ajax code is - </p>

<pre><code> $(function () {
    $.ajax({
        type: "GET",
        url: "GetManufacturers",
        datatype: "Json",
        contentType: "application/json; charset=utf-8",
        success: function (data) {
            $.each(data, function (index, value) {
                //alert("ManufacturerID: " + value.ManufacturerID + " Manufacturer: " + value.Manufacturer1);
                $('#dropdownManufacturer').append('&lt;option value="' + value.ManufacturerID + '"&gt;' +
                value.Manufacturer1 + '&lt;/option&gt;');
            });
        },
        error: function(error){
            alert("Error Ajax not working: " + error);
    }
    });

    $('#dropdownManufacturer').change(function () {
        $('#dropdownModel').empty();

        $.ajax({
            type: "POST",
            url: "GetModelsByManufacturerID",
            datatype: "Json",
            data: { manufacturerID: $('#dropdownManufacturer').val() },
            success: function (data) {

                $.each(data, function (index, value) {
                    $('#dropdownModel').append('&lt;option value="' + value.ManufacturerID + '"&gt;' +
                        value.Model + '&lt;/option&gt;');
                });
            },
            error: function (error) {
                alert("Error Ajax not working: " + error);
            }
        });
    });
});
</code></pre>

<p>and I populate my dropdowns with - </p>

<pre><code>    &lt;div class="form-group"&gt;
        @Html.LabelFor(model =&gt; model.ManufacturerModelID, "Manufacturer", new { @class = "control-label col-md-2" })
        &lt;div class="col-md-10"&gt;
            @Html.DropDownList("dropdownManufacturer", new SelectList(string.Empty, "Value", "Text"), "Please select a manufacturer", new { @style = "width:250;" })
            @Html.ValidationMessageFor(model =&gt; model.ManufacturerModelID)
        &lt;/div&gt;
    &lt;/div&gt;

    &lt;div class="form-group"&gt;
        @Html.LabelFor(model =&gt; model.ManufacturerModelID, "Model", new { @class = "control-label col-md-2" })
        &lt;div class="col-md-10"&gt;
            @Html.DropDownList("dropdownModel", new SelectList(string.Empty, "Value", "Text"), "Please select a model", new { @style = "width:250;" })
            @Html.ValidationMessageFor(model =&gt; model.ManufacturerModel.Model)
        &lt;/div&gt;
    &lt;/div&gt;
</code></pre>

<p>Update -- </p>

<p>StackTrace error </p>

<pre><code>   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean&amp; dataReady)
   at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.&lt;NonQuery&gt;b__0(DbCommand t, DbCommandInterceptionContext`1 c)
   at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func`3 
</code></pre>