I have a SharePoint 2010 and I was asked to fix something on the master page.
I have a very weird issue. The current custom master page is working fine. But when I create a blank master page, copy the code of the current master through SharePoint Designer and make it the default, I get this error:
The control type 'System.Web.UI.WebControls.ListView' is not allowed on this page. The type is not registered as safe.
It is exactly the same code with the working (current) one, I copied it and I compared them, they are the same.
When I remove this bit below, from the masterpage, the error gets resolved. So it's definitely the asp:Listview it is not happy about:
<asp:ListView runat="server" ID="MenuRepeater" DataSourceID="XXXX"> <LayoutTemplate> <div class="secondary-navigation"> <ul> <asp:PlaceHolder runat="server" ID="ItemPlaceholder"/> </ul> </div> </LayoutTemplate> <ItemTemplate> <li><a class="secondary-navigation-tablink" href="<%# Eval("Url")%>" title="<%# Eval("Description")%>"><%# Eval("Title")%></a></li> </ItemTemplate> <EmptyItemTemplate></EmptyItemTemplate> </asp:ListView>
Does anyone know why this could be happening? The two master page files are absolutely the same. The only difference is the new one is created in SharePoint designer and the old one is deployed through a wsp.
This is the bit about assembly registration at the start of master page.
<%@ Register Assembly="System.Web.Extensions, Version=184.108.40.206, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI.WebControls" TagPrefix="asp" %>
Unfortunately I cannot remove that asp:listview from the page, so I need to make this work. Any suggestions welcome. I am quite baffled why the current one is working but how it does not work when it's copied to a new file. If the control is not safe, it is not safe, so how on earth is the current one working?