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. Access specifier for method

Access specifier for method

Scheduled Pinned Locked Moved ASP.NET
question
3 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.
  • S Offline
    S Offline
    sris 426
    wrote on last edited by
    #1

    Deal all, I have a method in my aspx.cs file say methodone,which will be called from one of the event or method from the same aspx.cs file... So what access specifier i can give for that method.I am thinking private is enough for my requirement. AM i correct / wrong? Please provide your views... Thanks, Srinivas Mateti

    A G 2 Replies Last reply
    0
    • S sris 426

      Deal all, I have a method in my aspx.cs file say methodone,which will be called from one of the event or method from the same aspx.cs file... So what access specifier i can give for that method.I am thinking private is enough for my requirement. AM i correct / wrong? Please provide your views... Thanks, Srinivas Mateti

      A Offline
      A Offline
      Abhishek Sur
      wrote on last edited by
      #2

      If you want to access the method from your html page, you need to make it at least Protected. I mean if you write <asp:textbox OnClick="txt_Click" runat="server" /> the txt_click should be made at least protected. Privates cant be used in events. If you are just calling the method from the class itself, you can use Private. :rose:

      Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


      My Latest Articles-->** Simplify Code Using NDepend
      Basics of Bing Search API using .NET
      Microsoft Bing MAP using Javascript

      1 Reply Last reply
      0
      • S sris 426

        Deal all, I have a method in my aspx.cs file say methodone,which will be called from one of the event or method from the same aspx.cs file... So what access specifier i can give for that method.I am thinking private is enough for my requirement. AM i correct / wrong? Please provide your views... Thanks, Srinivas Mateti

        G Offline
        G Offline
        Gamzun
        wrote on last edited by
        #3

        Yes, you're correct.

        Please don't forget to mark 'Good Answer', if you find it really a good one! Kashif

        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