I start develop in MVC and need to get an idea how better implement my requirement.
I need build somthing like UserControl that get the user the posibilitry to search data. This "UserControl" need contains some combox controls for choose Country,City and Zip Code and when the user click the Serach button it should go to DB and return some
data. This "UserControl" should be in some pages and need get parameter from the containing page and after the search it need return the result to the containing page.
What is the best way to implement this requirement? To build a partialView? To build EditorTemplate? or what?
We try build partialView, but how we send and get the data to and from the partial view?
Do someone can explain me in simple words what is the best implementation way?
YochevedB
0 Points
1 Post
UserControl in MVC
May 02, 2012 01:46 PM|LINK
Hello,
I start develop in MVC and need to get an idea how better implement my requirement.
I need build somthing like UserControl that get the user the posibilitry to search data. This "UserControl" need contains some combox controls for choose Country,City and Zip Code and when the user click the Serach button it should go to DB and return some data. This "UserControl" should be in some pages and need get parameter from the containing page and after the search it need return the result to the containing page.
What is the best way to implement this requirement? To build a partialView? To build EditorTemplate? or what?
We try build partialView, but how we send and get the data to and from the partial view?
Do someone can explain me in simple words what is the best implementation way?
Thanks,
Yocheved
ignatandrei
All-Star
134903 Points
21619 Posts
Moderator
MVP
Re: UserControl in MVC
May 02, 2012 02:18 PM|LINK
I would build a EditorTemplate, since you have a clear Model( Country, City, Zip).
I use partial views just for rendering templates( such as a row from a table).