开发者

How do I retrieve readonly values when using a DetailsView control to update a record?

I'm using a detailsview control to update a record, however in this particular case there's only one field that can be changed out of a many. The update method for my object takes all fields as parameters. When the detailsview's updating method fires, the values for the readonly fields (those re开发者_如何学Cndered as a Label) are not available in the e.NewValues collection.

I'm currently grabbing a reference to the object when the detailsview is databound (in the objectdatasource selected event handler), storing it in session and manually adding entries to the e.NewValues collection when updating fires. It works but seems kind of heavy handed.

So, is there a better way to get the read only values back into my update method? Or is there a better way of doing this altogether?


There should be an OriginalValues collection too, which may have the collection of readonly values... can you verifiy that?

HTH.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜