Missing System.Web.UI and System.Web.Security
I can't compile a project because the namespaces System.Web.UI and System.Web.Security are missing. I can开发者_开发问答 only see System.Web.ApplicationServices, System.Web.Mvc and System.Web.Services when I do add references. Where do I download the missing namespaces?
Go to menu Project -> Add reference and find out the System.Web.dll in the list
I don't know about System.Web.UI, but System.Web.Security moved to the System.Web.ApplicationServices assembly in .NET 4.0 Framework.
Following Kinderchocolate's suggestion, I switched to ".Net Framework 4" in my project's Properties (VS 2010), and that caused "System.Web" to appear in the assemblies list. From then on I was finally able to use System.Web.UI.
So I'm not sure what failed for kinderchocolate, but his change worked for me.
You can add System.Web.ApplicationServices assembly in .NET 4.5 Framework.
using System.Web.ApplicationServices;
Yes, Kinderchocolate is correct. Once you add the Reference System.Web
to your project, then in the code you can add using System.Web.UI
and all sub-components of System.Web.UI
, e.g. System.Web.UI.HtmlControls
.
you can go to : project -> proprieties -> and change the Framework from Client profile to .Net 4, if it doesn't work you can add the reference manually. Good luck
Add references System.Web.Extensions
and System.Web.Extensions.Design
in 4.6.1
if you miss ListView
or LinqDataSource
精彩评论