在表单视图中绑定隐藏字段
我正在尝试使用绑定到 ObjectDataSource 的表单视图,在表单视图中我使用几个隐藏字段来保存插入所需的值。
我在 devexpress ASPxGridLookup 上的 TextChanged 事件期间设置了服务器端这些字段的值。
然而,在插入事件期间,这些字段存在,但没有给出任何值。
我试图弄清楚这里发生了什么,我可以看到隐藏字段不保持其设置值。
任何帮助将不胜感激。
谢谢。
基兰
I am trying to use a formview bound to an ObjectDataSource, in the formview I use a couple of hidden fields which hold values required for an insert.
I set the value of these fields server side during a TextChanged event on a devexpress ASPxGridLookup.
However during the Inserting event these fields are present but no value is given.
I am trying to figure out what has happened here and I can see that the hidden fields do not maintain their set values.
Any help would be much appreciated.
thanks.
Kieran
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保页面加载期间不会重置这些值。不确定您是否在那里运行任何代码来准备页面,但我以前遇到过这种情况。
如果确实有在页面加载上执行的代码,您可以尝试将其包装在以下 If 语句中。这将防止在引发插入事件之前执行页面加载时重置它。
Make sure that the values aren't being reset during the the Page Load. Not sure if you have any code running there to prepare the page, but I've run into that before.
If you do have code executing on the Page Load, you might try to wrap it in the following If statement. That will prevent it from being reset when the page load executes prior to your inserting event being raised.