页面循环 - 将数据输入数据库的正确方法
我有一个页面,有几个文本框和一个下拉列表。 当登录用户打开此页面时,框中将填充他之前输入的数据,他可以更改数据并通过按更新按钮进行更新。 还有一个下拉列表,其中有动态填充的数据供他选择。
使该页面正常工作的最佳方法是什么?我在页面周期的哪里填充表单以及在哪里将数据输入到数据表。
目前,我正在 PreRender 上填充数据,但在 preinit 上填充下拉列表。我有一个按钮事件处理程序来更新数据表。问题是自动回发弄乱了下拉列表中的数据,因为它是动态填充的,我该如何解决这个问题?
I have a page that has a few textboxes and a dropdownlist.
When a logged in user opens this page the boxes are filled with data that he has input before, he can change the data and update it by pushing a update button.
There is also that dropdownlist which has a dynamically populated data for him to choose from.
What is the best way to make this page work. Where in the page cycles do I populate the forms and where do I input the data to the datatable.
At the moment I'm populating the data on PreRender but the dropdownlist on the preinit. I have a button event handler to do the update on the datatable. The problem is that the autopostback messes up the data in the dropdownlist because its dynamically populated, how would I go by fixing this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是我在大多数情况下遵循的
Here is what I follow in most of my cases