How to properly call a method from a container control into web dialog(modal)?
I have container control named “OfficialVehiclesContainer” with a “deletedata” method in it.
I have web dialog (modal) named “confirmdeleteitemdialog”. I need to call the method “deletedata” from the “OfficialVehiclesContainer”.
i already tried this : Var a As OfficialVehiclesContainer a.DeleteData
was able to call the method but it wont work.
It is just for simple confirmation modal of deleting an item in a listbox.
Others may disagree, but to me a dialog is something that is short lived and that loads its data every time it is called. So, you would create a base webdialog and you would create instances of the webdialog every time you need it. The instance would load its data fresh every time. Once you are done, you close that instance.
The scheme that I suggest would eliminate the need to update the dialog from pages or containers. So the better answer is probably that you need to rethink your architecture a bit. You can use handler methods to capture the results of the dialog in the calling object (page, container, etc.).
OR alternate use dependencies injection and store your ContainerControl object in a dialog property,
u can use its public methods there in a button Action event.
the disadvantage you can’t reuse this dialog.