Search code examples
asp.netcomponentart

What does "##" mean in this ASP.NET file?


I'm maintaining a C# ASP.NET application and I have come across the following little snippet in a .aspx file.

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

(The function Grid1_GetEditContent() is defined in the JavaScript at the top of the file.)

I was wondering what the "##" means here? Does it mean the function could be invoked from some activity or other on the screen? (I may have to fiddle with this and I'm trying to detect all the mines without treading on them.)


Solution

  • '##' delimiters are using on ComponentArt controls.

    Ref: Q10081 - HOWTO: Using ClientTemplates in ComponentArt controls

    A simple example of a client-side template is one that renders the time on the client when it was instantiated:

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

    When the client template is instantiated, expressions defined within '##' delimiters are evaluated and replaced with the result of the evaluation. Any valid JavaScript can be used in client templates.