Ajax navigation with ability to link directly to the url of any page. Possible?

9 posts, 1 answers
  1. Miljan
    Miljan avatar
    3 posts
    Member since:
    Aug 2013

    Posted 20 Sep 2013 Link to this post

    Hi there,

    I am looking into feasibility to create mobile(phone) version of high traffic site with Kendo UI Mobile.

    Following this article http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/mobileapplication/overview I was able to create an example navigating pages with ajax. Since the controller is returning PartialView for the page, when you reload the url for the second page, that page seems broken as it doesn't load layout.  

    I was able to workaround that with this code
                if (Request.IsAjaxRequest())
                                return PartialView();
                 return View();

    But when I load that second page directly, link to the third page got messed up (showing the route data and appending relative url)
    Everything works well though when I set PushState to false, but in that case # is added to the url.
     
    Is my approach wrong, or there is different setup for ajax navigation with ability to load inside pages by typing the url?

    Any help would be appreciated.

    Thanks.
  2. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2284 posts

    Posted 23 Sep 2013 Link to this post

    Hello Miljan,

    The recently released Kendo UI Service Pack should address that issue. You can downloaded from your account and give it a try.

    Regards,
    Nikolay Rusev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Miljan
    Miljan avatar
    3 posts
    Member since:
    Aug 2013

    Posted 23 Sep 2013 Link to this post

    I downloaded the latest version 2013.2.918.340, tried the same thing, but it didn't work as expected.

    I've created simple example. Code below.

    From home page there is a Navigate to Details link which loads /home/details/1. On the details page you can navigate to the next one with incremented id /home/details/2, /home/details/3, .... All works fine until you try to load for example /home/details/3 without going through homepage, and then try to navigate to next item. The url got messed up and next link is not working.

    Thank you so much.

    Miljan

    HomeController.cs
    public class HomeController : Controller
        {
            public ActionResult Index()
            {
                return View();
            }

            public ActionResult Details()
            {
                ViewBag.NextID = (Convert.ToInt32(RouteData.Values["id"])) + 1;
                if (Request.IsAjaxRequest()){
                    ViewBag.ShowBackButton = true;
                    return PartialView();
                }
                return View();
            }
        }

    Index.cshtml
    @(Html.Kendo().MobileView()
        .Name("Index")  
        .Title("Index")
        .Content(
            @<text>
            @(Html.Kendo().MobileButton()
                .Text("Details")
                .Url("/home/details/1")            
            )
            </text>
        )
    )

    Details.cshtml
    @(Html.Kendo().MobileView()
        .Title("Details")    
        .Name("Details")    
        .Content(
            @<text>
            View Details Template                
            @(Html.Kendo().MobileButton()
                .Text("Go Back")
                .Url("#:back")
            )
            @(Html.Kendo().MobileButton()
                .Text("Next")
                .Url("/home/details/" + ViewBag.NextID)
            )
            </text>
        )
    )
    _Layout.cshtml
    @(Html.Kendo().MobileApplication()
                        .PushState(true)
                        .ServerNavigation(false)
                    )






  5. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2284 posts

    Posted 25 Sep 2013 Link to this post

    Hello Miljan,

    For your convenience I've create a sample project. Navigation seems to be working properly here. Please give it a try and let me know how it goes.

    Regards,
    Nikolay Rusev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. Miljan
    Miljan avatar
    3 posts
    Member since:
    Aug 2013

    Posted 26 Sep 2013 Link to this post

    Thanks, Nikolay!

    I've updated your example with the code I pasted here previously, and also recorded a screencast of the problem I am experiencing.

    Here is the screencast http://screencast.com/t/Lra3QdvA5o26

    Miljan

  7. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2284 posts

    Posted 30 Sep 2013 Link to this post

    Hello Miljan,

    I'm afraid that we will need more time to investigate this behavior further. I'll post in this thread once we have more details for this case.

    Regards,
    Nikolay Rusev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  8. Miljan
    Miljan avatar
    3 posts
    Member since:
    Aug 2013

    Posted 15 Oct 2013 Link to this post

    Any word on this?

    Thanks,
    Miljan
  9. Answer
    Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2284 posts

    Posted 16 Oct 2013 Link to this post

    Hello Miljan,

    Latest Internal build available should contain a fix for the issue. At least that's what my tests shows. 
    For your convenience I'm attaching upgraded version of the project.

    Regards,
    Nikolay Rusev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  10. Miljan
    Miljan avatar
    3 posts
    Member since:
    Aug 2013

    Posted 17 Oct 2013 Link to this post

    My first tests also shows that it works correctly now.

    Much appreciated.

    Thanks,
    Miljan

Back to Top
Kendo UI is VS 2017 Ready