本文介绍了在MVC中,HTML Kendo Grid不会传递“&".通过数据源从视图传输到控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Kendo网格数据源未传递值&"从视图到MVC中的控制器

Kendo grid datasource is not passing values "&" from view to controller in MVC

例如,如果testIdVal值为"Interface Class& Function",则从下面的代码中获取.仅接口类"被传递给控制器​​.

For instance from the below code if testIdVal value is "Interface Class & Function" . Only "Interface Class" are being passed to the controller .

.DataSource(Function(d) d.Ajax() _
                                    .Read(Function(read) read.Action("GetResourcesForRolesForRootDomain", "Inquiry", New With {.testId= "#=testIdVal#"}).Type(HttpVerbs.Post).Data("additionalData"))) _

推荐答案

关于这一个的两个想法:尝试在testIdVal周围添加encodeURIComponent:"#=encodeURIComponent(testIdVal)#"或在additinaldata中添加testIdVal.顺便说一句,additinaldata中有一个错字. ;)

Two ideas on that one: Try to add encodeURIComponent around testIdVal: "#=encodeURIComponent(testIdVal)#" or add testIdVal in additinaldata. By the way, there is a typo in additinaldata. ;)

这篇关于在MVC中,HTML Kendo Grid不会传递“&".通过数据源从视图传输到控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-13 14:15