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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. controls lost in a placeholder when button is clicked

controls lost in a placeholder when button is clicked

Scheduled Pinned Locked Moved ASP.NET
questionhelp
4 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
    momo007
    wrote on last edited by
    #1

    Hi every one, i've created controls dynamically in a placeholder, everything works fine, but when click to a button to save text in the textboxes, everything in the placeholder is gone... because the webform is refreshed. how can i proceed to avoid that??? can any one help me??? Thanks

    P 1 Reply Last reply
    0
    • M momo007

      Hi every one, i've created controls dynamically in a placeholder, everything works fine, but when click to a button to save text in the textboxes, everything in the placeholder is gone... because the webform is refreshed. how can i proceed to avoid that??? can any one help me??? Thanks

      P Offline
      P Offline
      Paddy Boyd
      wrote on last edited by
      #2

      Add controls in the page preinit event.

      M 1 Reply Last reply
      0
      • P Paddy Boyd

        Add controls in the page preinit event.

        M Offline
        M Offline
        momo007
        wrote on last edited by
        #3

        thanks for the reply, could you give the syntax of this event plz??

        P 1 Reply Last reply
        0
        • M momo007

          thanks for the reply, could you give the syntax of this event plz??

          P Offline
          P Offline
          Paddy Boyd
          wrote on last edited by
          #4
          Protected Sub Page\_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit
          
          End Sub
          

          This should create the controls before the page control hierarchy is built, this way they are retained.

          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