0
I have an application where there is a central entity and several other auxiliary registers, such as Status, Format, Type, etc. All these auxiliary entities have only 2 fields: Name and Status (boolean, stating whether it is active or not). Since they are very simple entities, I would not like to create a screen for each one. In addition, I would like to allow the user, when registering a record of the main entity, to do maintenance in these auxiliary entities (exclusion, inclusion, editing...).
However, when I work with Partialviews and forms, I have a problem, because the screen is loaded again, for validations in the backend and, when it is returned, the screen is reloaded, losing the state of open modals and everything else.
How to do this type of maintenance with modals? I would like to open 2 modals: one for listing and one for editing/insertion.
Form field with Format CRUD button
Form with editing/insertion of Formats
When I click the Create button, in the form inside the modal, the screen is redirected and I miss all the state of the main form and open modals.
Inlua the code of your views and controller only with the image can not answer. But in the backend validation you need to popular these components indicating which value had been selected.
– Leandro Angelo
Basically, they are partialviews (for auxiliary forms) within modals, in a main form (View). It’s not much of a secret, and I’m starting the code now. I did just one test, adding an error in Modelstate and when the validation returns the result, the screen is redirected to the partialview action.
– Claudio Neto
I know, but the code is more useful than the images.
– Leandro Angelo