How to call stored proc from ASP.Net MVC stack via the ORM & return them in json?
Posted
by melaos
on Stack Overflow
See other posts from Stack Overflow
or by melaos
Published on 2010-03-29T02:24:07Z
Indexed on
2010/03/29
2:33 UTC
Read the original article
Hit count: 355
Hi guys,
i'm a total newbie with asp.net mvc and here's my jam:
i have a 3 level list box which selection on box A shows options on box B and selection on box B will show the options for box C.
I'm trying to do the whole thing in asp.net MVC and what i see is that the nerd dinner tutorial uses the ORM method.
so i created a dbml to the database and drag the stored proc inside. i create a datacontext object but i don't quite know how to connect the result from the stored proce which should be multiple rows of data and make it into a json.
so i can keep all the json data inside the html page and using jquery i could make the selection process faster.
i don't expect the data inside the three boxes to change so often thus i think this method should be quite viable.
Questions:
So how do i get the stored proc part to return the data as json?
i've noticed some tutorial online that the json return result part is at the controller and not at the model end. Why is that?
© Stack Overflow or respective owner