回发数据和视图状态数据有什么区别
我试图了解 Asp.net 页面生命周期中的不同事件。我发现了这个链接。它有两个阶段“加载视图状态”和“加载回发数据”。我以前以为这两个是同一个意思。但这篇文章说,回发数据不是视图状态数据。我不明白这一点。如果有人可以看一下的话。
I am trying to understand different events in a Asp.net page life cycle. I came across to this link. It has two stages Load view state and Load postback data. I used to thought that these both means the same thing. But this article says, that postback data is not viewstate data. I don't understand this. If anyone can have a look.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
ViewState数据是ASP.NET编码端在
_ViewState
隐藏字段中发送给客户端的数据。它基本上就是发送给客户端时的页面。PostBack数据是用户提交的数据。
例如,假设页面上有一个文本框,定义如下:
您在文本框中输入我的用户输入并提交表单。
Some Text
将是 ViewState 数据,My user input
将是 PostBack 数据。编辑如果您想了解有关 ViewState 的更多信息,这里有一篇很棒的文章:真正了解视图状态。
ViewState data is data that ASP.NET encoded end sent to the client in the
_ViewState
hidden field. It's basically the page as it was when it was sent to the client.PostBack data is data that the user submits.
For example suppose you have a textbox on a page defined like so:
You type in My user input into the textbox and submit the form.
Some Text
would be ViewState data andMy user input
would be the PostBack data.EDIT And in case you would like to learn more about ViewState, there's an excellent article here: Truly Understanding Viewstate.
视图状态是页面呈现到浏览器时的当前状态。
回发数据是用户更改并重新提交的数据。
The viewstate was the current state when the page was rendered to the browser.
The post back data is what the user changed and resubmitted.
视图状态意味着临时存储字段的内容,而回发意味着提交表单本身。交叉回发是从一种表单重定向到另一种表单。
view state means storing the contents of fields temporarorily where as postback means submitting the form itself .cross postback is the redirecting from one form to another form.
这是 msdn 文章。它使用图像很好地解释了它。
This one is the msdn article. It sort of explains it so nicely using images.
视图状态是页面首次在浏览器中显示时(页面加载)
回发数据是指用户进行更改并提交表单时;
viewstate is when the page is first displayed in the browser (page load)
Post back data is when the user has made changes and submitted the form;