Reloading a custom control

547 Views Asked by At

I have a cs class which I use as a control on one of my page. It is like a table with some values. This control is loaded when the page loads. After user does some selection, I need to refresh this control with the new values which I do by assigning it in code behind. My problem is that though I am reassigning some properties, the control which was loaded on the page load, does not refresh, which makes sense. i have tried a few ways but could not figure it out. I am posting it here as I am running short of time and would appreciate it if anyone can point me to the right direction.

Thanks.

1

There are 1 best solutions below

0
On

Make sure you are calling LoadControl on PreInit and doing so on each postback.

PreInit:

Use this event for the following:

  • Create or re-create dynamic controls.
  • ....

ASP.NET Page Life Cycle Overview