在动态数据自定义页面中,如何检索刚刚更新的对象?
我正在使用 ASP.NET 动态数据并有一个自定义页面。
在此页面中,我有一个关于 DetailsView 插入事件的句柄,我想在其中根据最近更新的对象的值执行某些操作。 但是,我无法将事件处理放在相应对象的模型类中,因为它也基于自定义页面中自定义(未绑定)表单元素的值。
如何检索刚刚由DetailsView 更新的对象?
I am using ASP.NET Dynamic Data and have a custom page.
In this page I have a handle on the DetailsView inserted event where I would like to do something based on the value of the recently updated object. However, I can't put the event handling in the model class of the respective object because it is also based on the value of a custom (unbound) form element in the custom page.
How can I retrieve the object that was just updated by the DetailsView?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一种半解决方案至少会为您提供通过表单控件更新的字段(不是新的 id 或类似的内容),即访问 DetailsViewInsertedEventArgs 的“Values”属性,如下所示:
One semi-solution that will at least give you the fields that were updated though form controls (not the new id or anything like that though) is to access the 'Values' property of the DetailsViewInsertedEventArgs like so: