Kendo UI Grid Template error - invalid template

chowe991
# if( #:AllTemplateID# == @(ViewBag.BigTemplateID) ) { 
    <div class="templateItem testing" id="#:AllTemplateID#">
        <img src="@(ViewBag.TemplateImageThumbURL)#:AllTemplateUrlImage#" alt="#:AllTemplateName#"/>
    </div>
#} else { #
    <div class="templateItem" id="#:AllTemplateID#">
        <img src="@(ViewBag.TemplateImageThumbURL)#:AllTemplateUrlImage#" alt="#:AllTemplateName#"/>
    </div>
#} #

It's saying I have an invalid template. Why? I'm assuming it has something to do with the hashtags - #

CodingWithSpike

the first line:

# if( #:AllTemplateID# == @(ViewBag.BigTemplateID) ) { 

First, there is no ending '#' at the end of the line. Second, you don't need to put hashes around variables #:AllTemplateID# if they are already in javascript portions of the template.

Try:

# if( AllTemplateID == @(ViewBag.BigTemplateID) ) { #

-or-

# if( data.AllTemplateID == @(ViewBag.BigTemplateID) ) { #

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related