Correct Event after record is saved to SQL for updating Detailsview fields

Rate It (1)

Last post 10-03-2009 3:47 PM by rtpHarry. 3 replies.

Sort Posts:

  • Correct Event after record is saved to SQL for updating Detailsview fields

    09-29-2009, 1:31 PM
    • Member
      point Member
    • webadm
    • Member since 09-28-2009, 1:17 AM
    • Posts 6

    I am using Visual Web Developer 2005 Express Edition and  writing Visual Basic code to handle my events.  I have designed a feedback input form using the Detailsview with a defaultmode of input.  The form set some intial values for the fields when the form is opened.  What I want to do is after the records is saved in the SQL database and the new blank form comes up is to set the default values for several of the fields.  I have tried calling the routine that sets the initial values in the DetailsView1_ItemInserted event

    but the default values are not set for the fields in the detailsview when I do a call SetDefaultvalues() subroutine.  What event should I be placing this call statement in so that it will set the default values after the records has been save and the new blank input screen appears?  If there some way to test for the condition that the record has been successful saved?

  • Re: Correct Event after record is saved to SQL for updating Detailsview fields

    09-29-2009, 6:50 PM
    • All-Star
      36,220 point All-Star
    • rtpHarry
    • Member since 10-01-2006, 8:51 AM
    • Lincoln, England
    • Posts 5,819

    Hey could you clarify what you are trying to achieve?

    If you want to set default values then you should do it in the ItemDataBound event because it is called after the rest is setup so it shouldnt be overwritten.

    If you want to edit values you have submitted then you should change the mode of the details view to update mode rather than insert mode.

  • Re: Correct Event after record is saved to SQL for updating Detailsview fields

    09-30-2009, 7:14 AM
    Answer
    • Member
      point Member
    • webadm
    • Member since 09-28-2009, 1:17 AM
    • Posts 6

    After the detail view is reset I want to put defauklt values in certain fields without having to put a button on the page for the user to click to popuplate these fields with their default values.  I want it to be seemless to the user so that don't to click a button, but when the form resets after a save to automaticlly populate the default value.  I need to figure out what event I need to put my code to set the default values after a the user has saved a record.

  • Re: Correct Event after record is saved to SQL for updating Detailsview fields

    10-03-2009, 3:47 PM
    Answer
    • All-Star
      36,220 point All-Star
    • rtpHarry
    • Member since 10-01-2006, 8:51 AM
    • Lincoln, England
    • Posts 5,819

    Yeah ok that makes sense now.

    This thread says the event to do it in is ItemDataBound:

Page 1 of 1 (4 items)