I'm assuming that we can still make reusable controls that can be dropped into more than one view. Lets say .. for example, we are using the Northwind DB and we have a simple control (ie. ascx file) that lists products from the Products table. We can
then drop this ascx control onto any View we have, I assume.
So .. is this possible?
Secondly, if i create a simple standard default MVC project using my VS2008 -> File -> New Project -> New MVC Web Application .... where should i put these controls? Should I make a folder called Controls, under the default folder Content? eg.
/MVC Web Application
|___ Content
|___ Controls <-- my new folder.
|___ Controllers
|___ Models
... etc
??? just not sure of the common practice and what other people are doing.
:: Never underestimate the predictability of stupidity ::
pure.krome
Member
532 Points
349 Posts
MVC & reusable Controls.
Jan 16, 2008 12:20 PM|LINK
Hi folks,
I'm assuming that we can still make reusable controls that can be dropped into more than one view. Lets say .. for example, we are using the Northwind DB and we have a simple control (ie. ascx file) that lists products from the Products table. We can then drop this ascx control onto any View we have, I assume.
So .. is this possible?
Secondly, if i create a simple standard default MVC project using my VS2008 -> File -> New Project -> New MVC Web Application .... where should i put these controls? Should I make a folder called Controls, under the default folder Content? eg.
/MVC Web Application
|___ Content
|___ Controls <-- my new folder.
|___ Controllers
|___ Models
... etc
??? just not sure of the common practice and what other people are doing.
rjcox
Contributor
7064 Points
1444 Posts
Re: MVC & reusable Controls.
Jan 16, 2008 01:20 PM|LINK
Under Views/Shared.
Search path is Views/Controller then Views/Shared for both pages and controls.
pure.krome
Member
532 Points
349 Posts
Re: MVC & reusable Controls.
Jan 16, 2008 10:49 PM|LINK
Thanks heaps mate :)