We have a webpart for our Forums that uses the following Transformation:
<%@ Register Src="~/CMSWebParts/QuitLogix/Forum/ForumPostsLike.ascx" TagName="ForumPostsLike" TagPrefix="cms" %>
<article class="comment">
<div class="img-block">
<%# GetUserAvatarImage(Eval("PostUserID"), 200, 0, 0, "") %>
</div>
<div class="text-block">
<div class="heading-holder">
<h2>
<%# UserInfoProvider.GetUserInfo(ValidationHelper.GetIntegr(Eval("UserID"), 0)).FirstName %>
<%# GetForumPostUserFirstName(EvalInteger("PostUserID")) %>
<%# IsCoach(Eval("PostUserID")) ? " - <em>" + ResHelper.GetString("ForumPost.QuitLogixCoach") + "</em>" : "" %>
</h2>
</div>
<p><%# Eval("PostText") %></p>
<div class="meta-block">
<div class="posted"><%# ResHelper.GetString("ForumPost.PostedAt") %> <time datetime="<%# DateTimeFormat(Eval<string>("PostTime"), "hh:mm") %>"><%# DateTimeFormat(Eval<string>("PostTime"), "h:mm tt").ToLower() %></time>; <time datetime="<%# DateTimeFormat(Eval<string>("PostTime"), "yyyy-MM-dd") %>"><%# DateTimeFormat(Eval<string>("PostTime"), "MMMM dd, yyyy") %></time></div>
<cms:ForumPostsLike ID='AddLikeDislike' PostID='<%# EvalInteger("PostId") %>' runat='server' />
</div>
</div>
</article>
They give errors like:
[TempITemplate.Template]: http://server/CMSVirtualFiles/Transformations/=vg=496cd453-1571-4f9f-9b61-83d04b03651e/QuitLogix.ForumDetails/ForumPostItem.ascx(11): error CS0103: The name 'xxx' does not exist in the current context[TempITemplate.Template]
It was working in V9, but after the upgrade it had stopped working and I have narrowed the problems to the following macros:
<%# UserInfoProvider.GetUserInfo(ValidationHelper.GetIntegr(Eval("UserID"), 0)).FirstName|(recursive)true %>
<%# GetForumPostUserFirstName(EvalInteger("PostUserID")) %>
<%# IsCoach(Eval("PostUserID")) ? " - <em>" + ResHelper.GetString("ForumPost.QuitLogixCoach") + "</em>" : "" %>
<%# ResHelper.GetString("ForumPost.PostedAt") %> <time datetime="<%# DateTimeFormat(Eval<string>("PostTime"), "hh:mm") %>"><%# DateTimeFormat(Eval<string>("PostTime"), "h:mm tt").ToLower() %></time>; <time datetime="<%# DateTimeFormat(Eval<string>("PostTime"), "yyyy-MM-dd") %>"><%# DateTimeFormat(Eval<string>("PostTime"), "MMMM dd, yyyy") %></time>
I have attempted to find any answers, and even touched base with the company that did the upgrade for us (mostly) but my Google Fu is failing me. I have even replaced the first macro with:
<% CMSContext.Current.GlobalObjects.Users[67855].FirstName; %>
But that provided a similar error:
[TempITemplate.Template]: http://server/CMSVirtualFiles/Transformations/=vg=496cd453-1571-4f9f-9b61-83d04b03651e/QuitLogix.ForumDetails/ForumPostItem.ascx(11): error CS0103: The name 'CMSContext' does not exist in the current context
Hopefully I have given enough of an explanation. I know in back end coding the macros work, and they worked before in the transformation, just not sure why they are not working now. It also seems this is the only transformation that is using these macros.