什么是存储在视图状态的项目寿命? [英] what is life span for items stored in view state?

查看:148
本文介绍了什么是存储在视图状态的项目寿命?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

昨天我去面试中的小组问我这个问题。

Yesterday I went on an interview where the panel asked me this question.

推荐答案

存储在视图状态的项传送到隐藏控件中的客户端浏览器为HTML,并发送回服务器时,该网页上用户的信息(详细信息从不可或缺的 ViewState的:所有你想知道):

Items stored in view state are transmitted to the client's browser as HTML within a hidden control, and sent back to the server when the user posts from that page (details from the indispensable ViewState: All You Wanted to Know):

1),ASP.NET开始渲染页面。在目前的ViewState中的所有对象都使用自定义格式,看起来像这样连载: T< 1234567890; T< P< L< prpA; prpB;朊蛋白;取代; L<瓦拉;值Valb; valC; >取代;

1) ASP.NET begins rendering the page. All objects in the current ViewState are serialized using a custom format that looks like this: t<1234567890;t<p<l<prpA;prpB;prpC;>;l<valA;valB;valC;>>;

2),即串行数据连接codeD并写入到ASP.NET页面的表单,它看起来像这样(模拟数据)上的HTML隐藏控制: dDwxMjM0NTY3ODkwO3Q8cDxsPHBycEE7cHJw

2) That serialized data is encoded and written to an HTML hidden control on the ASP.NET page's form, where it looks like this (simulated data): dDwxMjM0NTY3ODkwO3Q8cDxsPHBycEE7cHJw

3)此时的项目都在客户端浏览器潜在的:你可以说他们正在

3) At this point the items are latent on the client's browser: you might say they're 'hibernating.'

4)如果客户端帖的页面,ASP.NET德codeS和反序列化视图状态数据为对象再次,他们活直到请求结束(或直到它们被写入到另一页)

4) If the client posts the page, ASP.NET decodes and deserializes the view state data into objects again, and they 'live' until the request is over (or until they are written to another page).

这篇关于什么是存储在视图状态的项目寿命?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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