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

[Solved] Passing databind expression to Razor from ClientTemplate

1 Answer 120 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Chris
Top achievements
Rank 1
Chris asked on 18 Oct 2011, 04:49 PM

I'm having a hard time figuring out how to pass a databind expression to a Razor method.  Any ideas ?

Thanks


 columns.Bound(model => model.Image).Width(64)
                .ClientTemplate("<img class='gridThumbnail' width='96' height='128' alt='<#= ToolName #>' src='" +
                        @GhostscriptSharp.GhostscriptWrapper.GeneratePageThumb(Url.Content("~/Content/t/p/" + "<#= Pdf #>"), Url.Content("~/Content/t/igs/" + "<#= ToolName #>" + ".jpg") , "/Content/t/igs/" + "<#= ToolName #>" + ".jpg", 1, 96, 128) +
              .Title("Thumbnail");

1 Answer, 1 is accepted

Sort by
0
Chris
Top achievements
Rank 1
answered on 18 Oct 2011, 05:28 PM
It works ok with server side template:

.Template(
    model => 
    "<img class='gridThumbnail' width='96' height='128' alt='<#= ToolName #>' src='" +  @GhostscriptSharp.GhostscriptWrapper.GeneratePageThumb(Server.MapPath("~/Content/t/p/" + model.Pdf), Server.MapPath("~/Content/t/igs/" + model.ToolName + ".jpg"), "/Content/t/igs/" + model.ToolName + ".jpg", 1, 96, 128) + "' />")
Tags
Grid
Asked by
Chris
Top achievements
Rank 1
Answers by
Chris
Top achievements
Rank 1
Share this question
or