Items Disappear after Postback

rated by 0 users
This post has 5 Replies | 2 Followers

Top 500 Contributor
Points 527
ustesgreenridge Posted: 10-15-2008 11:41 AM

I have a webpanel with a table and a listbar with items in it that I want the client to select one, when they don't I add text to a div on the submit button click.  When the page reloads none of the listbar items are there, the table is there and the buttons but they are disabled.  Help Please....

  • | Post Points: 20
Top 10 Contributor
Points 40,329
Infragistics Employee

Once you add your controls to the WebListbar dynamically, you need to add the controls back to the WebListbar again at the same point in the page lifecycle, if you want these controls to function correctly.  If you're adding the controls in response to a button click, it becomes very hard to add them again at the right time during subsequent postbacks.  This behavior is common among ASP.NET controls, and isn't unique to WebListbar.

My suggestion is to not put the control in the WebListbar dynamically in the first place.  Instead, put it in at design-time, with its Visible property set to false so that it doesn't render to your page's HTML output.  In response to your button click, set the Visible property to true.  That way, you'll know that your control exists when you need it.

Vince McDonald
Senior Developer Support Engineer, MCP

Need help? Find the various ways you can ask for help from Infragistics.

  • | Post Points: 20
Top 500 Contributor
Points 527

they are added at design time.  Nothing is dynamic.  Also, all al my standard asp.net control are fine, only the infragistics controls apear to disabled.  Webcombo won't drop down, webimagebutton disabled, etc.  Attached is my html.

 

  • | Post Points: 5
Top 500 Contributor
Points 527

here is the stripped down code behind.  It seems after the event the listbar is in the back.

  • | Post Points: 5
Top 500 Contributor
Points 527

ok, created a test app and copied the code to it and it works as expected.   have attached 2 images maybe someone can gather what is going on from the images.


  • | Post Points: 20
Not Ranked
Points 70

Has anyone found a solution to this?  I am experiencing the same thing.  One piece of behavior I have noticed (whether I load the groups and Items at design time or not)... When the page loads the items are not visible.  If I select the group below (its expanded and hides the first group)  then I select the first group again (first group expands)  I can see the item. Hopefully this makes sense.

  • | Post Points: 5
Page 1 of 1 (6 items) | RSS

Forum Statistics

29,462 users have contributed to 108,602 threads and 120,715 posts.

In the past week, we've had 1,062 new users, adding to our total of 446,996 registered users!

In the past 24 hours, we have 55 new thread(s), 183 new post(s), and

In the past 3 days, the most popular thread for everyone has been "Print UltraWebDayView". The post with the most views is "Using WebDataGrid with AjaxScriptManager". The most replies were made to "XamChart and Prism".

Please welcome our newest member aduarte.