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. partial class in asp.net 2

partial class in asp.net 2

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netdatabase
5 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.
  • A Offline
    A Offline
    alimohammed
    wrote on last edited by
    #1

    Hi all, Anyone please tell me whether the whole page is posted back after an event in .net 2005 web pages ( eg: after dropdownlist selected index changed or button click) or is it like an ajax enabled component since code-behind file is now a partial class rather than a full class that inherits from the ASPX page. Please explain. Thanks in advance. Ali

    G 1 Reply Last reply
    0
    • A alimohammed

      Hi all, Anyone please tell me whether the whole page is posted back after an event in .net 2005 web pages ( eg: after dropdownlist selected index changed or button click) or is it like an ajax enabled component since code-behind file is now a partial class rather than a full class that inherits from the ASPX page. Please explain. Thanks in advance. Ali

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      The partial class is only used to separate your code and the auto generated code into two separate files, it's still compiled into a single class. The postback still works the same, and the aspx page still inherits from the codebehind class (not the other way around).

      --- b { font-weight: normal; }

      A N 2 Replies Last reply
      0
      • G Guffa

        The partial class is only used to separate your code and the auto generated code into two separate files, it's still compiled into a single class. The postback still works the same, and the aspx page still inherits from the codebehind class (not the other way around).

        --- b { font-weight: normal; }

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

        Thanks guffa, i was a bit confused.

        1 Reply Last reply
        0
        • G Guffa

          The partial class is only used to separate your code and the auto generated code into two separate files, it's still compiled into a single class. The postback still works the same, and the aspx page still inherits from the codebehind class (not the other way around).

          --- b { font-weight: normal; }

          N Offline
          N Offline
          Nitin1981
          wrote on last edited by
          #4

          Hi Guffa

          Guffa wrote:

          The partial class is only used to separate your code and the auto generated code into two separate files, it's still compiled into a single class.

          Which auto generated code you are referring to here.Do you mean vb.net code. I'm also confused about these partial classes. Partial class allows private part of other class to be accessed.thats OK but asp.net page still derives from codebehind so isn't it difficult to digest? Pls elaborate. Thanks -- modified at 0:09 Wednesday 8th November, 2006

          Don't Quit

          G 1 Reply Last reply
          0
          • N Nitin1981

            Hi Guffa

            Guffa wrote:

            The partial class is only used to separate your code and the auto generated code into two separate files, it's still compiled into a single class.

            Which auto generated code you are referring to here.Do you mean vb.net code. I'm also confused about these partial classes. Partial class allows private part of other class to be accessed.thats OK but asp.net page still derives from codebehind so isn't it difficult to digest? Pls elaborate. Thanks -- modified at 0:09 Wednesday 8th November, 2006

            Don't Quit

            G Offline
            G Offline
            Guffa
            wrote on last edited by
            #5

            A partial class is just a class that is split into separate parts.

            public partial class A {
            ... some code
            }

            public partial class A {
            ... some more code
            }

            is the same as:

            public class A {
            ... some code
            ... some more code
            }

            The auto generated code is the code that is automatically created to interface with the server controls in the page. For example, if you have a Label named InfoLabel in the page, a reference is created for it:

            public protected Label InfoLabel;

            --- b { font-weight: normal; }

            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