Populate controls once

  • Thread starter Thread starter Mark Goldin
  • Start date Start date
M

Mark Goldin

How do I make sure that when an execution is taken back to the server
controls like combos are not populated again?

Thanks
 
If you populate your controls in the Page_Load event, you can wrap the code that populates the controls in an

If Not Page.isPostBack
....
End If

block. This will only execute the code (within the block) once; when the page loads initially. You can ensure that the data remains in the controls by setting the controls viewstate property to true.

hope this helps,
John
 
Thanks, that worked.

John Sivilla said:
If you populate your controls in the Page_Load event, you can wrap the
code that populates the controls in an
If Not Page.isPostBack
...
End If

block. This will only execute the code (within the block) once; when the
page loads initially. You can ensure that the data remains in the controls
by setting the controls viewstate property to true.
 
Back
Top