This is a migrated thread and some comments may be shown as answers.

Problematic Details Templates

1 Answer 99 Views
Grid
This is a migrated thread and some comments may be shown as answers.
yaron
Top achievements
Rank 1
yaron asked on 27 Sep 2012, 05:31 AM
Hellow,
When I use this following code I get error "Invalid template" by "kendo.web.js"
I tried it first by script but the script from the kendodropdownlist closed the main script of the tamplate and it forced me to put it in a div. Both are wrong. What can I do for doing this simple example?

the code by script:
<script id="employeesTemplate" type="text/kendo-tmpl">
@(Html.Kendo().DropDownList()
.Name("AddressSource")
.BindTo(
new List<string>() {
"רשמית",
"מדווחת",
"למשלוח דואר"
})
)
</script>


the code by div:
<

div id="addressEditTemplate" style="display:none;">
@(Html.Kendo().DropDownList()
.Name(
"AddressSource")
.BindTo(
new List<string>() {
"רשמית",
"מדווחת",
"למשלוח דואר"
})
)
</div>

Thanks in advance.

 

1 Answer, 1 is accepted

Sort by
0
Neil
Top achievements
Rank 1
answered on 02 Oct 2012, 12:24 PM
Hi Yaron,

I think you may be missing '.ToClientTemplate()'

i.e:

<script id="employeesTemplate" type="text/kendo-tmpl">
@(Html.Kendo().DropDownList()
.Name("AddressSource")
.BindTo(
new List<string>() {
"רשמית",
"מדווחת",
"למשלוח דואר"
}).ToClientTemplate())
</script>

But I can't be certain...

Thanks,

Neil.
Tags
Grid
Asked by
yaron
Top achievements
Rank 1
Answers by
Neil
Top achievements
Rank 1
Share this question
or