回发数据和视图状态数据有什么区别

发布于 2024-08-30 09:22:40 字数 207 浏览 5 评论 0原文

我试图了解 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

南薇 2024-09-06 09:22:40

ViewState数据是ASP.NET编码端在_ViewState隐藏字段中发送给客户端的数据。它基本上就是发送给客户端时的页面。

PostBack数据是用户提交的数据。

例如,假设页面上有一个文本框,定义如下:

<asp:TextBox id="TextBox1" runat="server" text="Some Text" />

您在文本框中输入我的用户输入并提交表单。 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:

<asp:TextBox id="TextBox1" runat="server" text="Some Text" />

You type in My user input into the textbox and submit the form. Some Text would be ViewState data and My 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.

那一片橙海, 2024-09-06 09:22:40

视图状态是页面呈现到浏览器时的当前状态。

回发数据是用户更改并重新提交的数据。

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.

私藏温柔 2024-09-06 09:22:40

视图状态意味着临时存储字段的内容,而回发意味着提交表单本身。交叉回发是从一种表单重定向到另一种表单。

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.

等风也等你 2024-09-06 09:22:40

这是 msdn 文章。它使用图像很好地解释了它。

This one is the msdn article. It sort of explains it so nicely using images.

冰魂雪魄 2024-09-06 09:22:40

视图状态是页面首次在浏览器中显示时(页面加载)
回发数据是指用户进行更改并提交表单时;

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;

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文