locked
keeping common functionality in default.html and default.css

    Question

  • I'm creating a Navigation Page template app. I want to use the user's account name and picture on the entire app. So the user can see his/her name/pic on each page of the app. I understand that I can keep this functionality in default.html and default.css scripts. I tried following code, but I can see user's name /pic only on the home page. What can I do to achieve this behavior?

    default.html from navigation page template.

    <body>
        <header aria-label="Header content" role="banner">
               <h3 id="h3" class="titlearea win-type-ellipsis">
                <span class="pagetitle" id="aname">sonal</span>
                <img class="imageHolder" style="vertical-align: top" id="apic" alt="image holder" src="/images/placeholder.png" width="96" height="96" />
            </h3>
           
        </header>
        <div id="contenthost" data-win-control="Application.PageControlNavigator" data-win-options="{home: '/pages/home/home.html'}"></div>


    sonal

    Monday, October 28, 2013 5:07 AM

Answers

  • Hi Sonal,

    I did not see your navigation code backend I don't know how you navigate between pages, but I think you need something like this:

    Read this article for more information: Quickstart: Using single-page navigation.

    You may need WinJS navigation to help you, if this is not what you need, update me more information please.

    function linkClickEventHandler(eventInfo) {
        eventInfo.preventDefault(); 
        var link = eventInfo.target;
        WinJS.Navigation.navigate(link.href); 
    }

    Best Regards,

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Monday, October 28, 2013 8:34 AM
    Moderator