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
  1. Home
  2. Web Development
  3. ASP.NET
  4. App_code classes

App_code classes

Scheduled Pinned Locked Moved ASP.NET
questionhosting
4 Posts 3 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.
  • R Offline
    R Offline
    reogeo2008
    wrote on last edited by
    #1

    Hi all, i have created a web application with three classes in it App_Code folder.When i run the pjt in local system everything was working.but after hosting the site it give erroe "Object reference not set to an instance of an object." where it encounter a line having a call to the functions in the class Suppose A is my class in App_Code I have declared the objt of it in a .aspx page as A objA=new A(); objA.Function(); What is wrong with this.I got a solution saying thatfor that "U have to include namespace of APP_code Class File into ur webpage .cs file".How can i do it? :^) :confused: Thanks in advance.

    P 1 Reply Last reply
    0
    • R reogeo2008

      Hi all, i have created a web application with three classes in it App_Code folder.When i run the pjt in local system everything was working.but after hosting the site it give erroe "Object reference not set to an instance of an object." where it encounter a line having a call to the functions in the class Suppose A is my class in App_Code I have declared the objt of it in a .aspx page as A objA=new A(); objA.Function(); What is wrong with this.I got a solution saying thatfor that "U have to include namespace of APP_code Class File into ur webpage .cs file".How can i do it? :^) :confused: Thanks in advance.

      P Offline
      P Offline
      Parwej Ahamad
      wrote on last edited by
      #2

      Are you using any name space in Class files ? Are you getting exception while creating a new object i.e

      A objA=new A();

      OR on Method call

      objA.Function();

      ?

      Parwej Ahamad g.parwez@gmail.com

      R 1 Reply Last reply
      0
      • P Parwej Ahamad

        Are you using any name space in Class files ? Are you getting exception while creating a new object i.e

        A objA=new A();

        OR on Method call

        objA.Function();

        ?

        Parwej Ahamad g.parwez@gmail.com

        R Offline
        R Offline
        reogeo2008
        wrote on last edited by
        #3

        i am getting error when a line with a call to the member function encounters ie, your second option

        K 1 Reply Last reply
        0
        • R reogeo2008

          i am getting error when a line with a call to the member function encounters ie, your second option

          K Offline
          K Offline
          kandalu
          wrote on last edited by
          #4

          Hi, If your Class file in App_code contains namespace you have to import it in your .cs file. If your code behind is vb then use "import" or c# means use "using" to import your namespace.

          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