开发者

When Update a field with ReadOnly Mode in GridView ,value of that is empty

开发者 https://www.devze.com 2023-01-05 07:11 出处:网络
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.

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 ReadOnl开发者_开发技巧y property and its value is not empty. (GridView to the SqlDataSource is connected) How to solve this problem?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消