Partial view RRS feed

  • Question

  • Can I create a partial view in html?

    I have a flyout that I want to use in multiple pages


    Sunday, July 1, 2012 4:53 PM


  • Hi

    Yes you can, WinJS.UI.Pages.render method will achieve this.

    Actually all the metro style sdk sample use this technique.

    You can download the code here:


    1 create a new html for your flyout.

    2 In the html you want to use the partial view, declare a div.

    3 Use WinJS.UI.Pages.render(URL,targetelemet) to render the new html you create to this div element.

    Some thing like this:

     var targetElement = document.getElementById("itemDetailTarget");//itemDetailTarget is the div you declare.
    var url="/html/noSelection.html"//this is the html you created
     WinJS.UI.Pages.render(url, targetElement);

    Monday, July 2, 2012 7:46 AM