how do I do this in MVC

Soldato
Joined
27 Mar 2003
Posts
2,710
So am finally put some solid time into some MVC development and have hit a stumbling block.

By the way I am a c# developer with mainly webforms background.

So I am currently prototyping a website for a friend (student information mainly) and wanted to develop it in MVC and start to learn it with a real world example but I am stuck at the first hurdle.

It would seem fairly simple to do in Web Forms but I am kind of stuck with MVC.

The scenario is that I have a combo box that when the selected value is changed I want areas on the page to display relevant information.

I want it to show some info about the student such as name, a photo if available, year group, house etc.

Then in another area of the page to show some charts and additional information about problem areas etc.

These two areas should only be populated based on the selected value in the combo box.

So I am using Kendo UI + MVC wrappers to make the transition a little easier for me but I am just getting lost with not having the traditional web forms events being available to me.

So can someone guide me on how I can seamlessly fire off an event from the combo box to load the rest of the information (I have it writing to the console/displaying an alert once the value is change but can't figure out the next step). I suspect that the use of partial views is required but I am not sure what I am really doing at the moment.


Thanks in advance for any guidance.
 
Soldato
OP
Joined
27 Mar 2003
Posts
2,710
Thanks for the link but I am not seeing how this applies to my situation as I want an action to happen once I have selected someone from the combo box.

So effectively I want to do a post back or AJAX post back to get the information for the selected student and populate the rest of the screen that way.

As said in web forms I could do this no problem but I am just finding it difficult to understand how to do things in the mvc world.
 
Soldato
OP
Joined
27 Mar 2003
Posts
2,710
Thanks for the info. It is amazing how many different ways there seems to be to do the thing I want too. Luckily managed to grab some time with one of the MVC guys in the team and show me a simple way to get a JSON object back and then apply the values back to the elements on the page using JQuery.

Thanks the responses anyway. I suspect I will probably be asking some equally dumb/simple questions over the weekend.
 
Back
Top Bottom