0

我正在维护一个 C# ASP.NET 应用程序,并且在 .aspx 文件中遇到了以下小片段。

<body>
    <form id="form1" runat="server">
    .
    snip
    .
    <ComponentArt:DataGrid id="Grid1"
    .
    snip
    .
        <ClientTemplates>
            <ComponentArt:ClientTemplate Id="DataCellClientTemplate">
                ## Grid1_GetEditContent(DataItem) ##
            </ComponentArt:ClientTemplate>
            .
            .
            .

(函数 Grid1_GetEditContent() 在文件顶部的 JavaScript 中定义。)

我想知道“##”在这里是什么意思?这是否意味着可以从屏幕上的某些活动或其他活动中调用该功能?(我可能不得不摆弄这个,我试图在不踩到它们的情况下检测所有地雷。)

4

2 回答 2

4

'##' 分隔符在 ComponentArt 控件上使用。

Ref: Q10081 - HOWTO: 在 ComponentArt 控件中使用 ClientTemplates

客户端模板的一个简单示例是在客户端实例化时呈现时间:

  <ClientTemplates>
    ...
    <ComponentArt:ClientTemplate ID="timeTemplate">
      The time on the client is: <b>## (new Date()) ##</b>
    </ComponentArt:ClientTemplate>
  </ClientTemplates>

当客户端模板被实例化时,在“##”分隔符中定义的表达式将被计算并替换为计算结果。任何有效的 JavaScript 都可以在客户端模板中使用。

于 2011-11-09T09:12:09.863 回答
2

它与.net无关

它是 componentArt 的内部标记。

此令牌用于在服务器上创建时按逻辑呈现一些 html(此控件是 SERVER SIDE)

于 2011-11-09T09:01:20.983 回答