Показать сообщение отдельно
Старый 13.08.2010, 21:06   #1  
Blog bot is offline
Blog bot
Участник
 
25,646 / 848 (80) +++++++
Регистрация: 28.10.2006
sumitax: Use of ViewState in User control
Источник: http://sumitax.wordpress.com/2010/07...-user-control/
==============

During development of user controls in EP, if  you wish to preserve the state(value) of  Page Level variables , you can use ViewState available in EP Framework in Ax2009. This is useful because Enterprise portal by default is stateless and if data  need to persisted across various postbacks events  in web control for example in a Dataset, ViewState comes as a handy option.

Scenario :  When a button is clicked on user control or user goes to next page in a Web control which uses a wizard , then a postback event is fired and value of page level variables is lost.

Usage : Use the following code to store the variable under ViewState

 ViewState[“InvoiceId”] = invoiceId; 

And to retrieve the value , use code below

invoiceId = ViewState[“InvoiceId”]




Источник: http://sumitax.wordpress.com/2010/07...-user-control/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.