Kurkula
Kurkula

Reputation: 6762

Asp.Net Response class and Write Method

When I create a simple webform example, I write the below code to display data on a web page.

Response.Write("hello World");

Usual syntax in csharp is

Create an object like ClassName objectName = New ClassName()

And call the method like objectName.MethodName();

for STatic Classes there is no object creation and we can call method like ClassName.MethodName();

In this context

How does Response.Write() work? I know that Write() is a method. My question is what is Response here.

Is it a static class? or a Object(This should not be true)?

I am trying to understand if it is a static class from here but it is a sealed class. How is it possible to call a sealedClassName.MethodName()?

Upvotes: 0

Views: 780

Answers (1)

Servy
Servy

Reputation: 203821

It's an instance property on the class, and it is inherited from the base class (Page).

Upvotes: 1

Related Questions