I'am developing MVC 4 app with Razor engine using some Kendo UI elements. The Kendo's ComboBox has "Template" property to set HTML template for rows in ComboBox. Within this template I have IMG element that using Url.Action in it's SRC. However I don't know how to pass value to parameter ID. In the following code I hard-coded value to 61 but I need "data.KodFazeBiljkeId" just like written in the ALT attribute.
Here is my VIEW with Kendo's ComboBox:
@(Html.Kendo().ComboBoxFor(model => model.MaticniKodFazeBiljke1Id)
.Name("MaticniKodFazeBiljke1Id")
.Placeholder("Odaberi razvojnu fazu biljke...")
.DataTextField("OpisDvocifrenogKoda")
.DataValueField("KodFazeBiljkeId")
.HtmlAttributes(new { style = "width:500px" })
.DataSource(source =>
{
source.Read(read =>
{
read.Action("getKodoviFazeBiljke_byRazvojnaFazaBD", "KodFazeBiljke")
.Data("filterRazvojnaFazaBD");
})
.ServerFiltering(true);
})
.Enable(false)
.AutoBind(false)
.CascadeFrom("RazvojnaFazaBDId")
.Height(300)
.Template("<img src=\"" + Url.Action("GetPhoto", "KodFazeBiljke", new { id = 61, thumb = true }) + "\" alt=\"${data.KodFazeBiljkeId}\" />" +
"<dl>" +
"<dd>${ data.OpisDvocifrenogKoda }</dd>" +
"</dl>")
)