简体   繁体   中英

Reloading a custom control

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM