当在 GridView 中使用只读模式更新字段时,该字段的值为空
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您不想更新此值,请将其从 asp:SqlDataSource 上的 UpdateCommand 中删除。
如果您希望在更新命令中获取此值,则需要将其包含在
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
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.