asp.net mvc - Change View template -


i'm learning asp.net mvc creating web application.

i have 2 models: fooa , foob (has attribute of type fooa). controllers , views generated automatically.

now, want little change in create view of foob:

  • if there entries of fooa normal dropdown appears;
  • if there no entries of fooa button appears following behaviour:
    • save remaining input data;
    • redirect fooa create view;
    • redirect foob create view data restored.

i hope did job explaining.

my problems start question: should doing change in view or controller "side"? how can it?

thank you.

from description, think want. when users navigate view containing foob, display drop-down list if has data. if not, try create data drop-down list. here suggestion.

  1. when users navigate view containing foob, display drop-down list (even if empty), , button called add (or whatever want) next it.
  2. when users click add, pop-up appear, contains necessary fields cerate data drop-down list.
  3. when user click create, make ajax call server create data. then, display success or fail message , refresh drop-down list new data if needed.

by doing way, not have redirect , forward between pages, try maintain data through redirect process.

i hope mean. feel free leave questions if find unclear.


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -