asp.net mvc multiple values to route -


Is there any way to send multiple parameters to the controller as a parameter? For example, if I have the path:

{controller} / {action} / {languages}

Can parameter values ​​be an array of strings? If this happens, how to use it ... How to send an array to the controller and how to parse it in the controller system?

Thanks Marco

It is possible that you see the Mvc.Net model binding Be there It is used by a controller to give objects (instead of primitives) to name the fields that you are sending with a normal prefix.

Here's an example:

To create an array of objects, you want the name of the field person [i]. Name, etc. And it will create the objects for you and keep it in an array, assuming that the action of the controller is set to accept one


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -