Click here to Skip to main content
15,892,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have 2 controllers event and students,

i would like to display student name in events as a dropdownlist ?

student contain name and age

event should contain a dropdownlist of student name and date .
Posted

1 solution

If you mean MVC, you cannot (or, rather, should not). Data is not "displayed" in a controller at all, no matter "one" or "another". Data presentation is done in a view. So, the problem should be reformulated somehow, but… the view is not manipulated directly by a controller, as you can see on the collaboration diagram describing MVC patter: http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller[^].

So, as to your possible concerns, the key is the isolation between a view and a controller, which, in principle, would allow you to add yet another controller without redefining the view(s). It reduced your problem just to the perceiving of the pattern correctly. You can consider this as a case of loose coupling between views and controllers; see also:
http://en.wikipedia.org/wiki/Loose_coupling[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900