Sitefinity template parser: The differences

Sitefinity template parser: The differences

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 Guys

View all posts from The Progress Guys 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
 
 
Latest Stories in
Your Inbox
Subscribe
More From Progress
d12fcc0bdb669b804e7f71198c9619a7
5 Questions Automakers Should Ask to Improve Asset Uptime
Download Whitepaper
 
SF_MQ_WCM
2018 Gartner Magic Quadrant Web Content Management (WCM)
Download Whitepaper
 
What-Serverless-Means-For-Enterprice-Apps-Kinvey
What Serverless Means for Enterprise Apps
Watch Webinar