Navigate between Views of different Controllers

2 posts, 0 answers
  1. Venu
    Venu avatar
    11 posts
    Member since:
    Aug 2013

    Posted 26 Nov 2016 Link to this post

    From SharePoint site ribbon icon click opens a dialog window and loads View1.
    On View1 a button click navigates to View2.
    On View2 a button click should navigate back to View1.

    Problem: The Forward navigation is working fine with the href below

    window.location.href = '@Url.Action("Index", "Tab")';

    But the backward navigation is not working. I have two different Controllers [HomeController, TabController]

    <div class="k-closeDiv">
            .HtmlAttributes(new { type = "button" })
            .Events(e => e.Click("onCloseButtonClick"))
     function onCloseButtonClick() {
            window.location.href = '@Url.Action("Index", "Home")'; //NotWorking..??

    I have tried all the available options below.

    1. Here
    2. RedirectToAction("Action","Controller")
    3. RedirectToRoute("routeName") 

    No errors but No option is working.

    Is this an issue since I am loading views in dialog window.??

    Please suggest. Thanks



  2. T. Tsonev
    T. Tsonev avatar
    2796 posts

    Posted 30 Nov 2016 Link to this post


    What type of dialog is being open? If it hosts it contents in an IFRAME then the window.location.href code should work.
    Check that the onCloseButtonClick handler is being executed, by adding an alert or a debugger statement.

    You might also want to try to "navigate back" without specifying an URL:

    I hope this helps.

    T. Tsonev
    Telerik by Progress
    Telerik UI for ASP.NET MVC is ready for Visual Studio 2017 RC! Learn more.
Back to Top