我对 Tridion 开发很陌生,我遇到了第一个“基本”问题。我已经在 TBB 中编写了一个简单的 C# 代码片段(使用内容管理器文本编辑器),并且我尝试使用引擎、包和日志字段(因为我知道它们由 Tridion 提供)但我收到一条错误消息“该名称在上下文中不存在”。这是代码:
<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="utf-8" %>
<div>
<!-- TemplateBeginRepeat name="Component.Fields.crociera" -->
<!-- TemplateBeginIf cond="prezzo<250" -->
Go to @@location@@<br/>
<!-- TemplateEndIf -->
<!-- TemplateEndRepeat -->
</div>
<%
String ts = DateTime.Now.ToString("d MMM yyyy");
Response.Write("<br/>"+ts);
engine.getSession();
%>
当我保存 TBB 并发布页面时,我收到此错误:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0103: The name 'engine' does not exist in the current context
Source Error:
Line 31: Response.Write("<br/>"+ts);
Line 32: engine.getSession();
Line 33: %>
Line 34: </div>
Source File: c:\inetpub\wwwroot\stage\pj\ricerca\ricerca.aspx Line: 32
可能我错过了什么或做错了什么,有人认识到这个问题吗?