我正在编写一个 Google map 应用程序,它使用 jQuery 的 $.ajax() 从服务器请求数据,以将请求发送到我的 ASP.Net MVC Controller 。此控件需要一个用于便利设施类型的列表。查询字符串应该是什么样的?
我试过了
http://localhost:9090/mapamenities?amenityTypes=1,5
http://localhost:9090/mapamenities?amenityTypes=[1,5]
没有运气。
我尝试绑定(bind)的 SearchRquest 属性是
public List<int> AmenityTypes { get; set; }
谢谢 丹尼斯
最佳答案
试试 ?amenityTypes=1&amenityTypes=5
。
关于c# - 我可以在服务器上传递一个转换为 List<int> 的查询字符串吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3032879/