Follow @Lusse3 (279 followers)

Flickr Recent Photos

Soluppgången i KnivstaEn vacker morgonPalt palt i stora lass! Sara lyckades magnifikt med sin första palt sats #bArkham horrorDe gjorde bättre tidningar förr :) "gör det själv" från 1970 talet #fbPlanterar litePotatistävlingDragkampDragkampPotatistävlingMini DragkampKapten Liam

Kategorier

Workaround for = EPiServer:Property renders an extra Div

It’s comfortable to just use properties directly in the page. i.e

<EPiServer:Property ID="MainBody" runat="server" PropertyName="MainBody" />

Problem with this, is that it will render an extra div which feels really unnecessary. I’ve tried to look around for a setting of some sort to turn this off but not wanting to waste too much of my time, I just did a simple workaround. Well I didn’t do a workaround, I just render my text in another way.

Front:

<asp:Literal id="txtMainBody" runat="server"/>

Back:

txtMainBody.Text = CurrentPage.Property("MainBody");

This will render out exactly whats in MainBody and nothing extra.
Remember to check for nulls ;)

1 comment to Workaround for = EPiServer:Property renders an extra Div

Kommentera

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Additional comments powered by BackType