我正在使用Jquery-bootgrid创建表格。在文档中,它将这种参数传递给控制器
current=1&rowCount=10&sort[columnName]=asc&searchPhrase=&id=b0df282a-0d67-40e5-8558-c9e93b7befed
我可以获得所有的参数值,除了带括号的sort[columnName]=asc,我通过创建与参数相同的属性名来获得参数
public class Bootgrid
{
public int current { get; set; }
public int rowCount { get; set; }
public string searchPhrase { get; set; }
public string[] sort{ get; set; } //can't get the value
}敬请指教
发布于 2019-10-02 16:15:14
string[]使用的是整型索引,而不是字符串索引。
例如,您可以使用字典。
public void GetTest(Dictionary<string, string> som)
这适用于Test?somkey1=value2
其中som包含值为"value2“的键"key1”
https://stackoverflow.com/questions/58196180
复制相似问题