|
Rank: Newbie Groups: Member
Joined: 8/21/2007 Posts: 8
|
Here is my scenario:
I have a parent callback panel and inside it there are two child callback panels. Parent callback panel also has a message bar that displays messages for any event happen in any of the three callback panels. I put them in a group so, I can easily update the message bar from any of the callback panels. but here problem comes.
when parent callback have any post back trigger, after callback_execute, child callback panels disappear. I am not sure, what I am doing wrong. Help me out please.
Thanks.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi Adeel, Usually this has to do with dynamically creating of controls. If in one of your event handler, you changed TextBox1.Text, the new text will be persisted in the view state; However if you did Panel1.Controls.Add(new Label()), the newly created Label control will NOT be persisted. CallbackPanel falls into this situation very often because CallbackPanel are often used together with dynamic control creation. As a reference, you can take a look of this topic, which discusses view states but also mentioned the importance of this factor: http://www.essentialobjects.com/Forum/Default.aspx?g=posts&t=347Our samples uses child callback panels this way. You can see we have some code in Page_Init to ensure we always load the "last loaded" sample. It's for exactly the same reason. Thanks
|
|
Rank: Newbie Groups: Member
Joined: 8/21/2007 Posts: 8
|
Thanks for you reply,
I have read the post you provided, but my scenario is little different. I am not creating any control dynamically. The problem is: if I do not set the group name for callback panels, each panel works independently and it works fine, it displays all the panels and their controls. The only problem was, I was not able to update my messagebar as it is in the parent panel and post back happend because of the child panel. But if I put them in a group, after parent's panel post back my child panels disapper.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Ah....interesting scenario, but I do not think you can group a parent CallbackPanel and a child CallbackPanel together. Is it possible for you to use a separate CallbackPanel just for the message bar?
|
|