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" />

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s