locked
difference between protected, partial, public etc. RRS feed

  • Question

  • User-956384462 posted

     Hi, I'm new to this. Can someone explain the difference between the above.

     I am making some code to build a html string on the page_load to write to literals.

     What Sub should I use 

    and for example (ByVal sender As Object... etc.....  (what should I use here and what does it mean!)

    Thanks

    Monday, July 7, 2008 2:26 PM

Answers

  • User-125547262 posted

     protected --  A class and other its children have access to that member or method

    public -- as the name suggests its public hence anyone can access this member or method

    partial-- this keyword is used when a class declaration is split up into more than one file.At compile time the compiler combines the declarations into one class

     

    Having said this if this method is inside your page class and its used only in the page_load then private would suffice ( private means only that class has access)


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, July 7, 2008 2:41 PM