How to reference item properties in template using mvc helpers

2 posts, 0 answers
  1. Leandro
    Leandro avatar
    1 posts
    Member since:
    Jun 2011

    Posted 05 Jun 2013 Link to this post

    Hello !

    Please help me with this. I'm trying to reference an item property in a helper function inside the template. How can I do this ?

    <script type="text/x-kendo-tmpl" id="template">
        <div class="process-view">
            <div class="edit-buttons">
                @(Html.ActionLink("Create New", "Process_Create", "Process",
                    new { id=${ProcessID} }))
    The problem is that the compiler tries to solve the item reference and throws a
    CS1056: Unexpected character '$'

    I've also tried with #:ProcessID#, and get 
    CS1040: Preprocessor directives must appear as the first non-whitespace character on a line

    What should I do ?


  2. Dimo
    Dimo avatar
    8318 posts

    Posted 06 Jun 2013 Link to this post

    Hi Leandro,

    You cannot use client-side binding expressions such as ${...} and #:...# for server-side HTML helpers. Please replace the ActionLink helper with a plain anchor tag <a href="...">.

    In addition, please avoid posting duplicate forum threads.

    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET AJAX banner
Back to Top