3

私はjqueryモバイルで単純な複数ページを実行しようとしていますが、キャッシュのあるもの(と思います)がそれを台無しにします。

これは私のレイアウトです: _MobileSwipe.Mobile.cshtml

<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width">
    <meta charset="utf-8" />
    <title>@ViewBag.Title </title>
    @Html.MetaAcceptLanguage()
    <script src="@Url.Content("~/Scripts/kendo/2012.3.1121/jquery.min.js")"></script>
    @Scripts.Render("~/bundles/jquerymobile")
    @Styles.Render("~/Content/Mobile/css")
    @Styles.Render("~/Content/jquerymobile/css")
</head>
<body>
    @RenderBody()
</body>
</html>


<script>
    $(document).ready(function () {
        $.ajaxSetup({ cache: false });

    });
</script>

これは私の見解です:

 @model List<ExtremeOnline.Models.BookingDays>

@{
    ViewBag.Title = "Välj din tid";
    Layout = "~/Views/Shared/_MobileSwipe.Mobile.cshtml";
}

<div data-role="page" id="1" class="ui-page">
    page 1
</div>
<div data-role="page" id="2" class="ui-page">
    page 2
</div>

 <script>
        $('div.ui-page').live("swipeleft", function () {
            var nextpage = $(this).next('div[data-role="page"]');
            // swipe using id of next page if exists
            if (nextpage.length > 0) {
                $.mobile.changePage(nextpage, 'slide');
            }
        });
        $('div.ui-page').live("swiperight", function () {
            var prevpage = $(this).prev('div[data-role="page"]');
            // swipe using id of next page if exists
            if (prevpage.length > 0) {
                $.mobile.changePage(prevpage, 'slide', true);
            }
        });

    </script>

フォームはこちら

  @using (Html.BeginForm("SearchMobile", "Boka", FormMethod.Post))
            {
                <input class="searchbutton" id="searchBtn" data-ajax="false" type="submit" data-theme="b" value="Sök bokning" />
            }

        </div>

問題は、これを実行すると、投稿を送信したページのレイアウトがキャッシュされ、ソース コードに表示されることです。

レイアウトがキャッシュされるのはなぜですか? 何をすべきか?

4

1 に答える 1