Web Forms

Shorter epi prefix for EPiServer:Property

Posted on Updated on

Declaration of a property output in Page.aspx. This is one the most common code through the whole solution.

<EPiServer:Property runat="server" PropertyName="ContactsArea"></EPiServer:Property>

I like to make repetitive markup to be smaller and have:

<epi:Property runat="server" PropertyName="ContactsArea"></epi:Property>

In your web.confing instead of

<add tagPrefix="EPiServer" namespace="EPiServer.Web.WebControls" assembly="EPiServer" />
<add tagPrefix="EPiServer" namespace="EPiServer.Web.WebControls" assembly="EPiServer.Web.WebControls" />
<add tagPrefix="EPiServer" namespace="EPiServer.Framework.Web.WebControls" assembly="EPiServer.Framework" />

you put:

<add tagPrefix="epi" namespace="EPiServer.Web.WebControls" assembly="EPiServer" />
<add tagPrefix="epi" namespace="EPiServer.Web.WebControls" assembly="EPiServer.Web.WebControls" />
<add tagPrefix="epi" namespace="EPiServer.Framework.Web.WebControls" assembly="EPiServer.Framework" />

Usefull Open Waves snippets

Posted on

When Condition is false, the markup (and method calls) inside <ThenContent> is not evaluated.

<ow:ConditionalPlaceHolder runat="server" Condition="<%# CurrentBlock.IsShowAllLinkVisible %>">
    <ThenContent>
        <a href="<%# CurrentBlock.GetCalendarListLink() %>" class="link-big special icon-big-square-right"><%# CurrentBlock.CalendarListText %></a>
    </ThenContent>
    <ElseContent>
        <p>ElseContent</p>
    </ElseContent>
</ow:ConditionalPlaceHolder>

Why I don’t like Web Forms in EPiServer

Posted on Updated on

It can be avoided using Macio code (lambdas).