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. Where do I put my initialization code in my custom web component vb project?

Where do I put my initialization code in my custom web component vb project?

Scheduled Pinned Locked Moved Web Development
questiondesign
2 Posts 1 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.
  • H Offline
    H Offline
    howardjr
    wrote on last edited by
    #1

    My class is called cwcComboBox, and it inherits from the System.Web.UI.WebControls.ListBox class, so I created a sub called cwcComboBox with no parameters to be my classes constructor, but I never see the message box I put at the end of it, so I don't think it's being called. I want to put a bunch of initialization code in the constructor that will be run before the properties get called. If not in a constructor, where should I put this code? If I do use a constructor, how do I call the MyBase's constructor? Thank you.

    H 1 Reply Last reply
    0
    • H howardjr

      My class is called cwcComboBox, and it inherits from the System.Web.UI.WebControls.ListBox class, so I created a sub called cwcComboBox with no parameters to be my classes constructor, but I never see the message box I put at the end of it, so I don't think it's being called. I want to put a bunch of initialization code in the constructor that will be run before the properties get called. If not in a constructor, where should I put this code? If I do use a constructor, how do I call the MyBase's constructor? Thank you.

      H Offline
      H Offline
      howardjr
      wrote on last edited by
      #2

      Too much C# for me. I forgot that New was the constructor for a class in VB.Net. Coming from C++ and C# I thought it was the name of the class. Anyway now that I'm using New, I can use the MyBase.New() to call the constructor for the base class. So this issue is solved :)

      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