我有一个带有 Dictionary 参数的控制器操作:
[HttpPost]
[AllowCrossSiteJson]
public ActionResult MyActionMethod(Dictionary<string, string> EnteredValues)
当我尝试使用 JSON 调用此方法时,带有 @ 符号的字典条目会从列表中删除。例如,如果我使用此 JSON 调用该方法:
{
"EnteredValues": {
"__EVENTTARGET": "",
"__EVENTARGUMENT": "",
"__LASTFOCUS": "",
"ctl00$txtContractQuickSearch": "Contract Search",
"ctl00$txtAdvisorQuickSearch": "Rep Search",
"New Business.@StartDate": "1/1/2013",
"New Business.@EndDate": "10/25/2013",
"New Business.@RegionCode": "All",
"ShowChart": "on",
"txtSearchContractNumber": "Contract Number",
"txtSearchContractFirstName": "Owner First Name",
"txtSearchContractLastName": "Owner Last Name",
"DXScript": "1_42"
}
}
3 个“新业务”条目被删除,因为它们有一个 @ 符号。为什么会发生这种情况,我该如何解决?