need to clear controls while postback

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Prabhupl
    New Member
    • Aug 2006
    • 3

    need to clear controls while postback

    Hi

    I have an problem in asp.net code behine vb.net. :confused: I need to clear the controls while postback the page. eg:- i am getting the input of an child information(nam e, age, qualification, address, and so on), when i click the (save)button the present information should save in database and clear the control to accept the information for the second child in a single page itself.

    My problem is after i click the save button, the data are saved in database, but the controls are not clear for getting the second child, controls are retain the previous information. i need to clear controls while getting information for 2nd child :confused:
    hope u may get my problem


    Bye
    Prabhu
  • axas
    New Member
    • Jul 2006
    • 32

    #2
    You can use the method Clear() for each control, and after that, you can load them again. For example for the object DropDownList ddl, you write:

    ddl.Items.Clear ();

    Comment

    • rajulg
      New Member
      • Aug 2006
      • 2

      #3
      In the button click event set each control's text property to textbox1.text=" ".

      Hope it will work.

      Comment

      • dotnet
        New Member
        • Jul 2006
        • 22

        #4
        On page load event of your of your page re-initialize all controls to have blank values.

        Comment

        Working...