I’m working on an Asp.net website (it’s been awhile) coming from an MVC background. How would I mimic partial views in Asp.net? Do I use web user controls or web part zones, or other?
I’m working on an Asp.net website (it’s been awhile) coming from an MVC background.
Share
ASP.NET is actually the base engine for both ASP.NET Webforms and ASP.NET MVC.
If you’re used to MVC then you should really use ASP.NET MVC, where Partial Views are first class citizens.
Use ASP.NET MVC
To use one, you simply create a new MVC project, right click on the shared folder in the View folder, and select Add New View. From there you can select Partial View.
If you have to use Webforms
If you’re stuck with webforms, then you use UserControls. The webforms model doesn’t really translate well to the MVC paradigm, but UserControls are the closest things.
I think webparts are for Sharepoint only… ignore them.