I have the following code, which is working in ASPX file correctly, but in HTML Master page it is not working, please help me.

<!--MS:<SharePoint:AjaxDelta id="DeltaTopNavigation1" BlockElement="true" CssClass="ms-displayInline ms-core-navigation" role="navigation" runat="server">-->
                            <!--MS:<SharePoint:DelegateControl runat="server" ControlId="TopNavigationDataSource" Id="topNavigationDelegate1" AllowMultipleControls="True">--><!--ME:</SharePoint:DelegateControl>-->
                                <nav id="SpNav">
                                    <ul id="SpNavUL">
                                        <!--MS:<asp:Repeater runat="server" ID="MenuRepeater" DataSourceID="topSiteMap1">-->

                                                <!--MS:<asp:LinkButton ID="lnkLink" runat="server" Text='<%# Eval("Title") %>' CommandArgument='<%# Eval("Url") %>'>--><!--ME:</asp:LinkButton>-->
                                                <!--MS:<asp:Repeater runat="server" ID="ChildMenuRepeater" DataSource="<%# ((SiteMapNode)Container.DataItem).ChildNodes %>">-->
                                                        <ul id="SpNavChilds">
                                                            <li><!--SPS:<asp:LinkButton ID="lnkLink" runat="server" Text='<%# Eval("Title") %>' CommandArgument='<%# Eval("Url") %>'>--><!--ME:</asp:LinkButton>--></li>
                                <!--MS:<asp:SiteMapDataSource ShowStartingNode="False" SiteMapProvider="CombinedNavSiteMapProvider" id="topSiteMap1" runat="server" StartingNodeUrl="sid:1002" />-->
  • 2
    Welcome to the SP.SE community! We would love to help you out with your question. Can you give us a few more details about your situation? What version of SharePoint is this? What is the code supposed to do and which aspx file are you referring to?
    – thanby
    Jan 15, 2014 at 15:05
  • Hi Robert, I am using SharePoint 2013, this code is for Global Menu, you know that in SharePoint 2013 we should work in HTML Master page. for simple asp.net page it is working, but when I want to convert it to HTML version then it is not working. Jan 16, 2014 at 4:13

2 Answers 2


your code looks like a mess ;) sorry! You cant do a straight conversion of aspx to html! when you load a page from aspx on a browser it gets converted in html: witin ie goto f12 developer tools and you can inspect the html generated from the aspx.... thats masterpage + layouts + everything else :)

are you trying just to get the divs navs and ul li to show up in sharepoint html page? I dont get why your trying to make a masterpage in html?

your missing the doc type, header/footer and body! its not like in asp.net! html needs to have those!

as a template you can follow this:

            "-//W3C//DTD XHTML 1.0 Transitional//EN"

<html xmlns="http://www.w3.org/1999/xhtml">

      <link rel="shortcut icon" 
            href="Images/favicon.ico" />

      <link type="text/css" 
            href="CSS/GGGustafson.css" />

    <body onload="add_header('PAGE LOGO',
                             'PAGE LOGO TARGET',
                             'PAGE HEADER',
                             'PAGE SUBHEADER');
                  add_footer('PAGE VALIDATION LOGO');">

      <div id="header">

      <table class="content" 
          <td class="left_column left_content">


          <td class="center_column center_content">


          <td class="right_column right_content">


      <div id="footer">

      <script type="text/javascript" 
      <script type="text/javascript" 
      <script type="text/javascript" 
      <script type="text/javascript" 


the above was taken from here, it explains in detail whats going on:


  • Thanks to your replay, I want to have this Master page for SharePoint 2013, in SP2013 we must work in HTML file, not directly in .master file, this code is only for global menu. Jan 16, 2014 at 3:56

I don't have a solution to your problem, but I can narrow it down.

The issue is with : <%# Eval("Title") %>

If you remove these from your code it will work, but obviously won't have the links. I am attempting to solve the same problem at the moment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.