This question is locked. New answers and comments are not allowed.
Hi I am trying to have a custom edit client function inside of the MVC Grid using the ClientTemplate.
Below is my grid:
The issue I have is that <#= SelectedLanguageContent#> can sometimes result into an HTML code block which causes the grid to render incorrectly along with javascript errors.
I really want to avoid encoding the string from the controller or model. Can anyone advise on how I should go about this?
Thanks
Anthony
Below is my grid:
@(Html.Telerik().Grid(Model) .Name("TranslationGrid") .DataKeys(keys => keys.Add(r => r.ResourceId)) .Columns(columns => { columns.Bound(r => r.DefaultContent).Title("Default Language Content").Width(200); columns.Bound(r => r.SelectedLanguageContent).Title("Your Language Content"); columns.Bound(r => r.Description).Title("Description"); columns.Bound(r => r.ResourceId).ClientTemplate("<a href=\"#\" class=\"t-button t-grid-edit\" onclick=\"editResource('<#= ResourceId #>', '<#= SelectedCultureId#>', '<#= DefaultContent#>', '<#= SelectedLanguageContent#>')\">Edit</a>").Width(100).Title(""); }) .ClientEvents(events => events.OnDataBinding("onDataBinding")) .DataBinding(dataBinding => dataBinding.Ajax() .Select("LanguageTranslations", "Resource") .Update("LanguageTranslations", "Resource") ) .EnableCustomBinding(true) .Pageable(settings => settings.Total((int)ViewData["itemtotal"])) )The issue I have is that <#= SelectedLanguageContent#> can sometimes result into an HTML code block which causes the grid to render incorrectly along with javascript errors.
I really want to avoid encoding the string from the controller or model. Can anyone advise on how I should go about this?
Thanks
Anthony