gpt4 book ai didi

c# - 导致 "Failed to load viewstate."错误的页面主题

转载 作者:太空宇宙 更新时间:2023-11-03 14:26:14 25 4
gpt4 key购买 nike

在我的 web.config 中我有以下内容:

<pages theme="myTheme" enableSessionState="true" validateRequest="false" 
enableEventValidation="false" viewStateEncryptionMode="Never"
enableViewStateMac="false">

添加主题属性后,我立即开始收到:

Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request.For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request.

当我删除主题时,我不再收到 View 状态错误。任何人都可以提供正在发生的事情或如何解决它的内部信息吗?

谢谢。

最佳答案

修复者:

  1. runat="server"ID 属性添加到链接(样式表)
  2. 在母版页的 Page_Load 方法中调用 Page.Header.FindControl("link").DataBind()

不要调用 Page.Header.DataBind();,因为它将对整个 header 进行数据绑定(bind)。

关于c# - 导致 "Failed to load viewstate."错误的页面主题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3886544/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com