Wednesday, March 21, 2012

ModalPopup - Logic to databind control outside of modal

Hello All,

I am have a modal popup that appears and takes some input from a user. The user can then hit "submit" and logic behind the onclick for the submit button validates the input, and, if valid, submits that input to a database to be inserted.

this works great. I have update panels inside of the modal doing the work, and the user can submit as many entries as the want without the modal closing.

However, in the same method, after I update the database, I call another method to get new data from the database, and to re-databind the control they were looking at before the modal opened.

But the control (a listbox) does not change. It is not being databound. I even tried clearing the items from the listbox, and the items still remain.

I am not sure why the listbox is not updating from the logic. I would assume its not becuase the control is not in the same update panel, or the control is not in the modal popup. The listbox control is in its own update panel.

So I am trying to figure out how to make a control that is in another update panel, not in the modal popup update with logic triggered in the modal popup. I've thought about using the "onOKScript" in the modal popup properties to use some sort of JS to re-databind the control, but I am not sure how to do this.

Any ideas would be extreamly helpful

Thanks

-Shane

Hi Shane,

What you're describing should work. Code in an event handler invoked via oneUpdatePanel should be able to update controls in anotherUpdatePanel. Perhaps you can post a simple demo showing what's not working for you and we can take a look.

Thanks,
Ted

No comments:

Post a Comment