Asp.net MVC seems to be binding a List<string> property of my model incorrectly in certain environments
We have developed an asp.net mvc application which is an internal application. Our web app is accessed through other websites/applications on our companies network. One of the applications is a windows app that displays the site through a web browser in its application. I've been told by the developers of that application that it uses IE as its browser engine.
My problem is this. My application takes a payload from the calling systems in the query string. One of the properties in my model is a list<'string'>, we'll call it listProperty. So when you want to set listProperty in your call to our site you do this
http://mysite.com/?listProperty=value1&listProperty=value2
This method works when called through a regular web browser. It binds to the model as a list containing two strings. My problem is when it is called through the windows application browser. When it bind to my model, it binds it as a list containing one string. The value of the string is a comma separated list of the values. e.g. value1, value2.
So my questions are:
- Are there any circumstances where the environment in which an asp.net MVC 开发者_StackOverflowapp is running would cause model bindings to behave differently?
- Has anyone ever seen behavior like this when binding a list<'string'> property?
Thanks
what if you tried ? I am not sure it will work, but it's worth a shot
http://mysite.com/?listProperty=value1,value2
精彩评论