在更新面板中找不到内容?

发布于 2024-07-10 23:35:25 字数 208 浏览 5 评论 0原文

我有一个联系表单表,该表包含另一个表,无论是否需要扩展表单,该表都会隐藏,因为该控件在多个页面上使用。 所有这一切都工作得很好,直到我在它周围放置了一个更新面板。 我可以看到后面代码中的控件,并且页面构建成功,但是当我运行它时,它会抛出此错误:

对象引用未设置到对象的实例。

我很确定我以前做过这种事情,但现在似乎行不通了。 还有其他人经历过这种情况吗?

I have a table for a contact form and this table contains another table which is hidden whether the extended form is desired or not because this control is used on several pages. All of this worked fine until I put an update panel around it. I can see the controls in the code behind and the page builds successfully but when I run it it throws this error:

Object reference not set to an instance of an object.

I am pretty sure that I have done this type of thing before, but it does not seem to work now. Has anyone else ever experienced this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

吲‖鸣 2024-07-17 23:35:25

在同事的帮助下,我解决了我的问题。

当我设置属性时,我正在引用控件,显然属性是在所有控件都放在页面上之前设置的,而如果没有更新面板,则设置工作正常。

如果其他人遇到此问题,您所要做的就是在页面上设置属性,并在页面加载中根据需要设置控件属性。

With the help from a co-worker I figured out my problem.

I was referencing the controls when I was setting a property and apparently properties were getting set before all the controls were being put on the page whereas without the update panel the set was working fine.

If anyone else ever has this problem all you have to do is set a property on the page and in the page load set the control properties as you need to.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文