Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System.Net vs. System.Web. What is the difference?

Tags:

.net

One of the things I've noticed, but have never formally asked until now: What is the difference between the classes in the System.Net namespace and the System.Web namespace? Why do they both exist? They seem to have different implementations of the same classes/concepts (Cookie, Mail, HttpWebRequest, for example). Are they designed to be used for slightly different purposes? Or is one a legacy namespace?

like image 613
Ken Avatar asked Oct 20 '14 14:10

Ken


People also ask

What is .NET system Web?

Defines the methods, properties, and events that are common to all application objects in an ASP.NET application. This class is the base class for applications that are defined by the user in the Global.

What is System Web namespace?

System. Web namespace is an important base for Web Form user interface and web services. Use of Built-in Objects like Request and Response are very common and widely used. We directly write them without creating objects as they are built-in objects.

Which namespace is used to create Web application that execute over the Internet?

UI Namespace. Provides classes and interfaces that enable you to create ASP.NET server controls and ASP.NET Web pages for the user interface of your ASP.NET Web applications.


1 Answers

It follows the natural segregation between client and server apps. System.Web is (almost) exclusively used by .NET apps that implement a server. Like an ASP.NET app. It is notable for being missing in the Client framework profile. System.Net contains classes useful to a client app.

like image 193
Hans Passant Avatar answered Sep 18 '22 19:09

Hans Passant