Click here to Skip to main content
15,889,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Is there any implict objects are available in c# or asp.net like JSP request,response.
Posted

1 solution

Yes,

In ASP.Net the web page generation works in context of an instance of the HttpApplication object.

In a page or a custom control these are available implicitly as they're included as properties within the base objects these item inherit from.

Out of context of such pages you can find the current http execution context here:

C#
System.Web.HttpContext.Current


This object includes instances of HttpSessionState, HttpRequest, HttpResponse and many other things.

To access these and have them properly initialised you must be working within a web project and have the System.Web assembly referenced.
 
Share this answer
 
Comments
BalaThakur 11-Jun-12 8:19am    
Thanks a lot for answer. And which are the explicit object then? The ones which we derive from user defined classes? Ex MyClass myObj1=new MyClass().
Is myObj1 is Explict object???
Stephen Hewison 11-Jun-12 9:44am    
I don't think implicit and explicit are really the terms you need to apply to your question. At some point within the framework everything is defined explicitly. What you have in object oriented designed is inheritance. When you create a page, Session, Request and Response are inherited but they're still explicitly defined within the class you're inheriting from.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900