Friday, March 17, 2006

restore input data for dynamic created controls

In a dynamic created control, if the "ViewState"property is disabled, when page is postback,
use Request.Form(ControlName) to retrieve user input value.
Eg,

A dropdownlist named "ddlList", to retrieve the selection user made when page is postback,
Under Page_Load() event, add code like:
ddlList.SelectedItem.Text= Request.Form("ddlList")

No comments:

Blog Archive