当在 GridView 中使用只读模式更新字段时,该字段的值为空

发布于 2024-09-08 03:31:40 字数 128 浏览 9 评论 0原文

ReadOnly 属性等于 True 的少数字段之一,然后编辑和更新值字段为空 ReadOnly 属性被记录。 我还有一个 ReadOnly 属性,它的值不为空。 (GridView到SqlDataSource是连接的) 如何解决这个问题呢?

One of the few fields that have their ReadOnly property equal to True then Edit and Update the value field is empty ReadOnly property is recorded.
I also have a ReadOnly property and its value is not empty. (GridView to the SqlDataSource is connected)
How to solve this problem?

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

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

发布评论

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

评论(1

⒈起吃苦の倖褔 2024-09-15 03:31:40

如果您不想更新此值,请将其从 asp:SqlDataSource 上的 UpdateCommand 中删除

如果您希望在更新命令中获取此值,则需要将其包含在

<asp:SqlDataSource ...
<UpdateParameters>
  <asp:Parameter Name="YourFieldName" Type="Bool" />
  ...
</UpdateParameters>

ReadOnly 字段中,只是说当您进入编辑模式时,因为此字段不会更改为控件以提供更改的机会,但上的值SqlDataSource 不受此只读标志的影响。

If you do not wish to update this value, remove it from your UpdateCommand on your asp:SqlDataSource.

If you wish to get this value on your update command you need to included it on

<asp:SqlDataSource ...
<UpdateParameters>
  <asp:Parameter Name="YourFieldName" Type="Bool" />
  ...
</UpdateParameters>

The ReadOnly field is just say that when you go to edit mode, for this field is not change to control for give the opportunity to change, but the values on SqlDataSource is not affected by this readonly flag.

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