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. [newbie] nested struct?

[newbie] nested struct?

Scheduled Pinned Locked Moved ASP.NET
designquestion
3 Posts 2 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.
  • J Offline
    J Offline
    jon 80
    wrote on last edited by
    #1

    Is it correct to create a struct that is nested within a class e.g. public partial class _Default : System.Web.UI.Page { protected struct SupportStruc { protected string var1 protected string var2 } SupportStruc supporter = new SupportStruc(); protected void Page_Load (..) { supporter... //var1 and var2 are not displayed here... } }

    Jon

    D 1 Reply Last reply
    0
    • J jon 80

      Is it correct to create a struct that is nested within a class e.g. public partial class _Default : System.Web.UI.Page { protected struct SupportStruc { protected string var1 protected string var2 } SupportStruc supporter = new SupportStruc(); protected void Page_Load (..) { supporter... //var1 and var2 are not displayed here... } }

      Jon

      D Offline
      D Offline
      Dave Doknjas
      wrote on last edited by
      #2

      It's neither correct nor incorrect. I try to limit nested types to private types only used from within the outer type, and you'll find that the .NET Framework has only very few public nested types.

      David Anton http://www.tangiblesoftwaresolutions.com Convert VB to C#, C++, or Java Convert C# to VB, C++, or Java Convert C++ to C#, VB, or Java Convert Java to C#, C++, or VB

      J 1 Reply Last reply
      0
      • D Dave Doknjas

        It's neither correct nor incorrect. I try to limit nested types to private types only used from within the outer type, and you'll find that the .NET Framework has only very few public nested types.

        David Anton http://www.tangiblesoftwaresolutions.com Convert VB to C#, C++, or Java Convert C# to VB, C++, or Java Convert C++ to C#, VB, or Java Convert Java to C#, C++, or VB

        J Offline
        J Offline
        jon 80
        wrote on last edited by
        #3

        Thanks, I agree with that, as a matter of fact I wanted to use the inner struct from the outer class. The problem is that Intellisense did not display any of the fields of the struct...

        Jon

        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