Question

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?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top