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. Web Development
  3. ASP.NET
  4. Working with classes in asp.net

Working with classes in asp.net

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nethelp
8 Posts 4 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.
  • S Offline
    S Offline
    srikantha_nagaraj
    wrote on last edited by
    #1

    Hi, I am working in asp.net2.0 and C#. Actually i have created classes. I can create instance of that class. But i am not able to access the methods in that. Please help me

    S A 2 Replies Last reply
    0
    • S srikantha_nagaraj

      Hi, I am working in asp.net2.0 and C#. Actually i have created classes. I can create instance of that class. But i am not able to access the methods in that. Please help me

      S Offline
      S Offline
      SeMartens
      wrote on last edited by
      #2

      hi, did you mark your methods as public? Maybe you could post a bit of your code... Regards Sebastian

      It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.

      S 1 Reply Last reply
      0
      • S srikantha_nagaraj

        Hi, I am working in asp.net2.0 and C#. Actually i have created classes. I can create instance of that class. But i am not able to access the methods in that. Please help me

        A Offline
        A Offline
        Ashfield
        wrote on last edited by
        #3

        Have you made them public/internal

        Bob Ashfield Consultants Ltd Proud to be a 2009 Code Project MVP

        1 Reply Last reply
        0
        • S SeMartens

          hi, did you mark your methods as public? Maybe you could post a bit of your code... Regards Sebastian

          It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.

          S Offline
          S Offline
          srikantha_nagaraj
          wrote on last edited by
          #4

          Yes i have done it as a public only. This is my code. public class BFS { public BFS() { // // TODO: Add constructor logic here // } public void ret(string DUv) { //My code } }

          S 1 Reply Last reply
          0
          • S srikantha_nagaraj

            Yes i have done it as a public only. This is my code. public class BFS { public BFS() { // // TODO: Add constructor logic here // } public void ret(string DUv) { //My code } }

            S Offline
            S Offline
            SeMartens
            wrote on last edited by
            #5

            And the code where you want to use your class looks like? Did you pay attention to namespaces?

            It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.

            S 1 Reply Last reply
            0
            • S SeMartens

              And the code where you want to use your class looks like? Did you pay attention to namespaces?

              It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.

              S Offline
              S Offline
              srikantha_nagaraj
              wrote on last edited by
              #6

              How should i give namespaces. Please help me. if my class in XYZ then what will be the Namespaces?

              S P 2 Replies Last reply
              0
              • S srikantha_nagaraj

                How should i give namespaces. Please help me. if my class in XYZ then what will be the Namespaces?

                S Offline
                S Offline
                SeMartens
                wrote on last edited by
                #7

                If you have this:

                namespace MyNamespace {
                public class X {
                }
                }

                then you can access the class by MyNamespace.X. Maybe you could post your code... Regards Sebastian

                It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.

                1 Reply Last reply
                0
                • S srikantha_nagaraj

                  How should i give namespaces. Please help me. if my class in XYZ then what will be the Namespaces?

                  P Offline
                  P Offline
                  padmanabhan N
                  wrote on last edited by
                  #8

                  you can use anything as namespace... but for easy use give some relevant name like when you are adding two numbers then you can give "namespace Addition"....

                  Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]

                  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