session object

  • Thread starter Thread starter prasad.unvss
  • Start date Start date
P

prasad.unvss

how can i instantialize the system.web.sessionstate.httpsessionstate
class and one more doubt can a class can be defined without
constructors
 
how can i instantialize the system.web.sessionstate.httpsessionstate
class

You don't. Asp.Net wil do that for you. You access the (already
instantiated) HttpSessionState through the Session property of the Page
class, or by means of a call to HttpContext.Current.Session.
and one more doubt can a class can be defined without
constructors

You can write a class without any constructor in your source code, but in
that case the compiler will automatically create a default (empty)
constructor.
If you want a class that cannot be constructed, you can define a private
constructor. This will prevent the class from being instantiated (unless you
provide a static method inside the class which creates an instance). A class
that cannot be instantiated can be useful for containing static methods.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top