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.
- when users navigate view containing
foob
, displaydrop-down list
(even if empty), , button calledadd
(or whatever want) next it. - when users click
add
, pop-up appear, contains necessary fields cerate datadrop-down list
. - when user click
create
, makeajax
call server create data. then, display success or fail message , refreshdrop-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
Post a Comment