locked
Navigation from appbar button,html page not working

    Question

  • Hi,

    I am using appbar button to navigate from one page to other page.Problem is,
    When I go to other html page by clicking appbar button, page opens but not user handling, but when I click anywhere on the page then its working i.e. html page handling.I am using following code to navigate in js file.

    appBar.addEventListener("click", function (e) {
                    if (e.target.id == "appbar_button") {
                        WinJS.Navigation.navigate("/pages/Page1.html");
                    }
                }, false);

    Please help on this...


    Prashant Dikonda

    Thursday, February 21, 2013 4:59 AM

All replies

  • Hi Prashant,

    Are you using single-page navigation? Please change the navigate code as follow and have a try. I have test on my side, it is running normal.

    WinJS.Navigation.navigate("ms-appx:///pages/page1.html");

    #Quickstart: Using single-page navigation (Windows Store apps using JavaScript and HTML) (Windows)

    http://msdn.microsoft.com/en-us/library/windows/apps/hh452768.aspx


    Roy
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, February 22, 2013 8:42 AM
  • Hi Song,

    I tried this : WinJS.Navigation.navigate("ms-appx:///pages/page1/page1.html"); code.

    Still not working

    Thanks for reply.

    Prashant


    Prashant Dikonda

    Friday, February 22, 2013 8:51 AM
  • Hi Prashant,

    Please refer to the example at: https://skydrive.live.com/?cid=6B6C9082658DF18D&id=6B6C9082658DF18D%21121 .


    Roy
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Song Tian Wednesday, February 27, 2013 10:46 AM
    • Unmarked as answer by Prashant Dikonda Thursday, February 28, 2013 5:22 AM
    Friday, February 22, 2013 9:02 AM
  • Hi Song,

    I referred your given example from skydrive.But still not working.

    Thanks for reply.

    Prashant


    Prashant Dikonda

    Tuesday, February 26, 2013 5:21 AM
  • Hi,

    That is running on my side. Then please check your VS2012 configuration.


    Roy
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, February 27, 2013 10:46 AM
  • Hi Song,

    I used ,

    appBar.addEventListener("click", function (e) {
                    if (e.target.id == "add_case") {
                       // WinJS.Navigation.navigate("/pages/Page1/Page1.html");

                        WinJS.Navigation.navigate("ms-appx:///pages/Page1/Page1.html");
                    }
                }, false);

    this code,but still its not working......I am navigating through appbar button then only its not working i.e. navigating to Page1.html but its not intractable first time till click at least once on page.But by using normal button its working.

    You said check VS2012 configuration ,but what to check.......

    Thanks for reply

    Prashant


    Prashant Dikonda

    Thursday, February 28, 2013 5:33 AM
  • Hi Prashant,

    Please share your project on skydrive.


    Roy
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, February 28, 2013 6:23 AM