Domanda

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?

È stato utile?

Soluzione

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top