コード例 #1
0
        /// <summary>
        /// Initializes the current page.
        /// </summary>
        protected override void InitializePage()
        {
            base.InitializePage();

            if (Request.Url == null)
            {
                return;
            }

            var currentUrl = Request.Url.AbsoluteUri;

            if (string.IsNullOrWhiteSpace(ViewBag.Title))
            {
                return;
            }

            if (!NavigationHistory.Any() || !NavigationHistory.Last().Equals(currentUrl))
            {
                AddToHistory(ViewBag.Title, Request.Url);
            }
        }