重新加载自定义控件
我有一个 cs 类,我将其用作我的页面之一上的控件。它就像一个带有一些值的表。该控件在页面加载时加载。用户进行一些选择后,我需要使用新值刷新此控件,这是通过在后面的代码中分配它来完成的。我的问题是,虽然我重新分配了一些属性,但在页面加载上加载的控件不会刷新,这是有道理的。我尝试了几种方法但无法弄清楚。我将其发布在这里,因为我时间不够,如果有人能指出我正确的方向,我将不胜感激。
谢谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保您在
PreInit
上调用LoadControl
并在每次回发时执行此操作。PreInit:
使用此事件进行以下操作:
ASP.NET 页面生命周期概述
Make sure you are calling
LoadControl
onPreInit
and doing so on each postback.PreInit:
Use this event for the following:
ASP.NET Page Life Cycle Overview