Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. location in c# program for creating object

location in c# program for creating object

Scheduled Pinned Locked Moved C#
csharptutorialquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    yogita charhate
    wrote on last edited by
    #1

    Good Morning, I have to create object of c# class in aspx.cs class . I'm not sure whether it is good to create instance of that class globaly or to create its instance in every evnt block in aspx.cs file.Which one would be efficient and good way of programming?Please guide.

    yog hui gfgh kgdgrt njjn hjgkn

    H 1 Reply Last reply
    0
    • Y yogita charhate

      Good Morning, I have to create object of c# class in aspx.cs class . I'm not sure whether it is good to create instance of that class globaly or to create its instance in every evnt block in aspx.cs file.Which one would be efficient and good way of programming?Please guide.

      yog hui gfgh kgdgrt njjn hjgkn

      H Offline
      H Offline
      Haseeb Mukhtar
      wrote on last edited by
      #2

      Hello yogita , It depands on your working scenerio. If its just class with some methods to call then I suggest to Create instance in every aspx but please dispose that object too. If that class contains session or user information then you may use in global class. Thank You.

      Y 1 Reply Last reply
      0
      • H Haseeb Mukhtar

        Hello yogita , It depands on your working scenerio. If its just class with some methods to call then I suggest to Create instance in every aspx but please dispose that object too. If that class contains session or user information then you may use in global class. Thank You.

        Y Offline
        Y Offline
        yogita charhate
        wrote on last edited by
        #3

        Thank you.

        yog hui gfgh kgdgrt njjn hjgkn

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups