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. Dynamic Controls

Dynamic Controls

Scheduled Pinned Locked Moved ASP.NET
helpdatabasequestion
2 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.
  • M Offline
    M Offline
    Marc Paliotti
    wrote on last edited by
    #1

    I know that when there is a postback, id's for dynamic controls get re-created and they change. i know that we all get null reference exceptions when we try to retrieve them. I only have one problem that i tried looking for a solution on google but havent found it. I have a aspx page with a list of link buttons databound to a collection taken from a database. on the right of that is a user control. In that user control i have all these properties where GUID's are assigned every time some clicks buttons to re generate a new form to display. I get that null reference exception when i try to retrieve the values of the controls before the form is generating a new form. I tried re creating the fomr using the ID's i have now (in properties) but still get the same error that i could not generate my form because my id's were null? I am stuck from here and dont know where to go. Does anyone have a hint of what i can start doing to get myself going?

    T 1 Reply Last reply
    0
    • M Marc Paliotti

      I know that when there is a postback, id's for dynamic controls get re-created and they change. i know that we all get null reference exceptions when we try to retrieve them. I only have one problem that i tried looking for a solution on google but havent found it. I have a aspx page with a list of link buttons databound to a collection taken from a database. on the right of that is a user control. In that user control i have all these properties where GUID's are assigned every time some clicks buttons to re generate a new form to display. I get that null reference exception when i try to retrieve the values of the controls before the form is generating a new form. I tried re creating the fomr using the ID's i have now (in properties) but still get the same error that i could not generate my form because my id's were null? I am stuck from here and dont know where to go. Does anyone have a hint of what i can start doing to get myself going?

      T Offline
      T Offline
      theJazzyBrain
      wrote on last edited by
      #2

      You will never be able to reference an object that has not been instantiated. Try using the object after the form has been created.

      Jason Kataropoulos

      Excellence is not an act, but a habit!

      Aristotle

      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