上回发表格视图状态ASP.Net问题 [英] ASP.Net viewstate questions on form postbacks

查看:156
本文介绍了上回发表格视图状态ASP.Net问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让我们假设我有一个非常简单的形式,一个提交按钮和一个下拉列表。当我改变列表项,点击提交,在回传处理什么阶段不视图状态反映我改变列表条目?

Let's assume I have a very simple form, with a submit button and a dropdown list. When I change the list entry and hit submit, at what stage in the postback processing does the viewstate reflect my changed list entry?

据O'Reilly的学习ASP.Net 3.5,有两个负载服用(第266页上的图对于那些复印件)后,表单验证,另外前place--之一。

According to O'Reilly's Learning ASP.Net 3.5, there are two loads taking place-- one before form validation and another after (diagram on page 266 for those with a copy).

根据在第一负载级视图状态被装入该图中,验证之前。我以为我改变了下拉在这一点上体现?

According to the diagram the viewstate is loaded during the first load stage, before the validation. I assume my changed dropdown is reflected at this point?

此外,根据该图中,发布的数据被处理两次,之前和验证之后。谁能阐述多一点这一点,并在每个点什么形式处理发生?

Also, according to the diagram, posted data is processed twice, both before and after validation. Could anyone elaborate a little more on this, and what form processing takes place at each point?

感谢您的帮助。这是一个有点飘渺,所发生的时候,我试图把它清除掉一点。

Thanks for the help. It's a little misty, what takes place when and I'm trying to clear it up a bit.

推荐答案

该视图状态页面初始化之后,但在页面加载之前加载。验证发生的事件只是之前引起验证按钮触发。

The viewstate is loaded after page initialization but before page load. Validation takes place just before the event triggers for the button that caused the validation.

  • ASP.NET Page Life Cycle Overview
  • Understanding ASP.NET View State
  • ASP.NET Validation in Depth

这篇关于上回发表格视图状态ASP.Net问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆