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