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. Asp.net User controls

Asp.net User controls

Scheduled Pinned Locked Moved ASP.NET
helpcsharphtmlasp-netwinforms
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.
  • M Offline
    M Offline
    mcd2424
    wrote on last edited by
    #1

    Hi I have built 2 .net user controls and placed them both on the same page. One control (headlinedisplay.ascx) displays headlines from a webservice and the other displays the full article of a headline when you click on a headline links in the first usercontrol(articleDisplay.ascx). I am displaying the headlines from headlinedisplay by progamatically creating asp/html controls. The problem I have is that when I click on a headline(linkbutton) and the Articleclick event fires to render the article the headlines in the headlinedisplay user control dissapear becuase of the post back. I think this happens because the controls were created dynamically and I need to redraw them. (If I through the data into a datalist this doesnt happen but leads to other problems so i cant really use that as a solution) Does anybody know of away around this? thanks for your help,

    G 1 Reply Last reply
    0
    • M mcd2424

      Hi I have built 2 .net user controls and placed them both on the same page. One control (headlinedisplay.ascx) displays headlines from a webservice and the other displays the full article of a headline when you click on a headline links in the first usercontrol(articleDisplay.ascx). I am displaying the headlines from headlinedisplay by progamatically creating asp/html controls. The problem I have is that when I click on a headline(linkbutton) and the Articleclick event fires to render the article the headlines in the headlinedisplay user control dissapear becuase of the post back. I think this happens because the controls were created dynamically and I need to redraw them. (If I through the data into a datalist this doesnt happen but leads to other problems so i cant really use that as a solution) Does anybody know of away around this? thanks for your help,

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

      There is no way around it. If you create controls dynamically, you have to create them every time the page is created.

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

      M 1 Reply Last reply
      0
      • G Guffa

        There is no way around it. If you create controls dynamically, you have to create them every time the page is created.

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

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

        Guffa, thanks for the reply. I kind of figured that. I guess I will store the response from the webservice in a session vaiable and then just redisplay the headlines on postback.

        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