Search code examples
asp.netsitecoresitecore7asp.net-webpages

SItecore Field renderer not working in page editor


Field renderer was working fine on mvc but now we moved to web pages, and i am converting my layouts & renderings to webpages but field renderer are not working in page editor mode but in published mode looking fine. page editor screen shot is attached.

Field rendered as

<sc:Text ID="Title" Item="<%# ((Sitecore.Data.Items.Item)Container.DataItem) %>" Field="Navigation Title" runat="server" />

and

<%# FieldRenderer.Render(Container.DataItem as Sitecore.Data.Items.Item, "Navigation Title") %>

tryied both but same result :) any help would be appreciated.

enter image description here


Solution

  • I have av vague memory of seeing this error before. If I remember right, the problem was that Sitecore couldn't do all its Page Editor magic properly by inserting scripts etc into the html header and body. It's worth I try to just verify that your layout forms a proper html document and having the head and a form accessible from the server, such as this:

    <!DOCTYPE html>
    <html>
    <head runat="server">
    </head>
    <body>
    <form runat="server">
    
    </form>
    </body>
    </html>
    

    I was a long time ago I used webforms with Sitecore, so I don't remember exactly what components Sitecore hooks into in order to make the editor works, but having a page structure as above should be good to go.

    Hope it helps

    // Mikael