在viewstate中创建和存储控件对象 [英] Create and store a control object in viewstate
问题描述
当前,我正在页面上创建一些动态控件,这些控件可能是数百个控件.
根据页面的输入,其中一些将可用,因此您可以说可见性将有所不同.该页面实际上代表了数十个页面.
我想从viewstate创建这些页面,例如,我在page_Init()上创建了5个文本框,然后要将它们存储在Viewsate中,如果需要的话下次再从视图状态加载.
换句话说,我可以创建并将所有控件对象及其所有属性存储在viewstate中,如果可以的话,那么我将如何完成此操作.
非常感谢
问候
Basharat
Currently I am creating some dynamic controls on my page these can be hundreds of controls.
Some of these will be available depending upon the input of the page so you can say the visibility will be different. This page in fact represents the dozens of pages.
I want to create these pages from viewstate, e.g I have created 5 textboxes on page_Init() and then want to store these in Viewsate and next time if needed then load from the view state.
In the other words can I create the and store the whole control object with all of the properties in viewstate, if so then how I will be able to accomplish this.
Many Thanks
Regards
Basharat
推荐答案
很适合您.
初学者查看状态指南 [如何以视图状态存储对象? [
A good article for you.
Beginner''s Guide To View State [^]
How to store object in view state?[^]
这篇关于在viewstate中创建和存储控件对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!