Frage

I have a series of jQuery functions that load Partial Views from a MVC4 Controller. This (loading partial views) works very well in normal desktop browsers, but when I publish and view it on a tablet it doesn't work. I should note that other jQuery methods do work on tablets, so it does not appear to be an issue with the .js files not getting included.

Method in question:

$("#urls").on("click", function () {
    alert("test");
    $("#content-wrapper").load("/URL/Load?userWebID=" + $getActiveUserID());
    $changeTabColour("urls");
});

$getActiveUserID = function () {
    return $("#sidebar ul").find(".active").find("#userID").html();
}

When I click the <div id="urls">, the "test" alert box appears but the PartialView does not load.

War es hilfreich?

Lösung

I am answering my own question for future reference.

This was an ASP.NET problem, caused by the tablet device loading the Index.Mobile.cshtml file, rather than the Index.cshtml file that the desktop was loading.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top