Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System.Web.Mvc vs. System.Web.WebPages.Html for SelectList

I noticed today that both namespaces System.Web.Mvc and System.Web.WebPages.Html have a SelectListItem. What is the difference between the too and is there times you should use one over the other?

like image 826
Matthew Verstraete Avatar asked Oct 02 '22 18:10

Matthew Verstraete


1 Answers

System.Web.Mvc is specific to the MVC framework.

System.Web.WebPages.Html is for use with Web Pages that use Razor.

To be honest I've never used them in Web Pages but the examples I have seen they look identical, I just remember to never select the WebPages namespace.

There is an example available here:

http://www.mikesdotnetting.com/Article/184/HTML-Helpers-For-Forms-In-Razor-Web-Pages

like image 66
hutchonoid Avatar answered Oct 12 '22 12:10

hutchonoid