J
JDP@Work
Unless I'm mistaken, I've found the following condition and ONE LINE solution to
clear controls in a panel.
Me.pnlAddUpdate.EnableViewState = False
Using the same panel of fields for both Update and New; that after first doing
an update, ViewState retains the values when starting a new process that is
supposed to have empty fields.
Details....
Manage Users page enables admin and power users to create and disable logins.
Power users can only create standard users in their market center, therefore the
field displays in a lable and the security role is automatically set to a
standard user.
I use a panel with fields and control their visibility in the code behind.
The problem occurs when I select an existing login and the fields populate with
the correct data, clicking Save/Update or Cancel returns to the datagrid,
HOWEVER when I then select New and render the panel, the fields are NOT blank
but have the last user's info.
So.....
To Add a New User....
Me.pnlAddUpdate.EnableViewState = False
Me.pnlUsersList.visible = False
Me.pnlAddUpdate.visible = True
To Update an Existing User....
Me.pnlAddUpdate.EnableViewState = True
Me.pnlUsersList.visible = False
Me.pnlAddUpdate.visible = True
HTH
JeffP....
clear controls in a panel.
Me.pnlAddUpdate.EnableViewState = False
Using the same panel of fields for both Update and New; that after first doing
an update, ViewState retains the values when starting a new process that is
supposed to have empty fields.
Details....
Manage Users page enables admin and power users to create and disable logins.
Power users can only create standard users in their market center, therefore the
field displays in a lable and the security role is automatically set to a
standard user.
I use a panel with fields and control their visibility in the code behind.
The problem occurs when I select an existing login and the fields populate with
the correct data, clicking Save/Update or Cancel returns to the datagrid,
HOWEVER when I then select New and render the panel, the fields are NOT blank
but have the last user's info.
So.....
To Add a New User....
Me.pnlAddUpdate.EnableViewState = False
Me.pnlUsersList.visible = False
Me.pnlAddUpdate.visible = True
To Update an Existing User....
Me.pnlAddUpdate.EnableViewState = True
Me.pnlUsersList.visible = False
Me.pnlAddUpdate.visible = True
HTH
JeffP....