Microsoft.jQuery.Unobtrusive.Ajax Impossible to install

Viewed 1015

I am very simply just trying to use the Microsoft.jQuery.Unobtrusive.Ajax library to post ajax razor forms, but for some reason I can't get the package to install properly.

I tried installing it from the Nuget Package Manager, and I can see it in my dependancies:

enter image description here

But there is not folder for it under lib

So next, I tried right-clicking the project and managing bower package, and can now see in bower.json:

"Microsoft.jQuery.Unobtrusive.Ajax": "^3.2.3"

However, the library is still not present in libs, and when I try posting my ajax form (which i copied from here) the form is posted normally nad not 'ajax'-lly (i.e. I am redirected to the page rather than the data just posting asynchronously).

Form

<form  method="post" data-ajax="true" data-ajax-method="post" data-ajax-complete="complete" enctype="multipart/form-data">
    <div class="input-group">
        <label class="input-group-btn">
            <span class="btn btn-default">
                Browse&hellip; <input asp-for="Uploads" type="file" style="display: none;" accept=".xls,.xlsx,.csv" multiple>
            </span>
        </label>
        <input type="text" class="form-control" readonly>
    </div>

    <a asp-page="Create" class="btn btn-default pull-right">
        <span class="glyphicon glyphicon-plus-sign"></span>
    </a>

    <button type="submit" class="btn btn-default pull-right">
        <span class="glyphicon glyphicon-circle-arrow-up"></span>
    </button>
</form>

I can see that the folder exists here

...\bower_components\Microsoft.jQuery.Unobtrusive.Ajax

But that is the wrong place, and I'd rather have the package manager put it in the right place than move it manually.

Why is this happening to me? Is this normal?

1 Answers
Related