Sitefinity template parser: The differences

Sitefinity template parser: The differences

Posted on April 07, 2009 0 Comments

The content you're reading is getting on in years
This post is on the older side and its content may be out of date.
Be sure to visit our blogs homepage for our latest news, updates and information.

[This post is part of the developer's manual preview published on this blog. You can find temporary TOC here.] 

As it was stated, Sitefinity template parser is almost completely identical to the ASP.NET template parser (and purposefully so). There are, however, some differences between the two and in this article we are going to examine them.

Case sensitivity


Sitefinity template parser is case sensitive, which means that this declaration:
<telerik:MessageControl runat="server" ID="messageCtrl"
    <ItemTemplate> 
        <asp:Label ID="messageText" runat="server"></asp:Label> 
    </ItemTemplate> 
</telerik:MessageControl> 
 
Is not same as this declaration:
<telerik:messagecontrol runat="server" ID="messageCtrl"
    <itemtemplate> 
        <asp:Label ID="messageText" runat="server"></asp:Label> 
    </itemtemplate> 
</telerik:messagecontrol> 
 
Sitefinity template parser expects the declarations have correct casing. So if the name of the class (control) is MessageControl first declaration will be correct. If the name of the class (control) is messagecontrol second declaration will be correct.

 

No need for casting


One of the nice, built-in things regarding Sitefinity template parser is the fact that you don’t need to explicitly cast the types you use there. Let us consider the proper usage of the property in standard ASP.NET template parser:
<href="<%= ((Telerik.Events.WebControls.Admin.EventsItemsList)Parent.Parent).ItemEditUrl %>">edit</a> 
If you are using Sitefinity template parser, the line above can be rewritten as follows:

<href="<%= Parent.Parent.ItemEditUrl %>">edit</a> 
And those are all the differences between the two parsers. As you can see, interoperability should not be a problem. In order to make all your templates work with both parsers, you should properly cast all the controls and use explicit casting.
progress-logo

The Progress Team

View all posts from The Progress Team on the Progress blog. Connect with us about all things application development and deployment, data integration and digital business.

Comments

Comments are disabled in preview mode.
Topics

Sitefinity Training and Certification Now Available.

Let our experts teach you how to use Sitefinity's best-in-class features to deliver compelling digital experiences.

Learn More
Latest Stories
in Your Inbox

Subscribe to get all the news, info and tutorials you need to build better business apps and sites

Loading animation