Postback Url redirects form to anothdr page but no data inserted RRS feed

  • Question

  • I have a formview in c# and i can enter the data and have it insert on the database but when i put in a postback url page to go to a thank you page, this works but the data inserted has not been added to the database. what am i doing wrong please?
    Friday, February 16, 2018 8:56 PM

All replies

  • You don't' want to post back to the thank-you page. You want to post back to the current page that processes the data (which is the default submit behavior), and then, in the C# code, redirect to the thank-you page after the data has been inserted.

    Kathleen Wilber
    BrightWillow - Asp.Net Applications

    • Edited by KathyW2 Saturday, February 17, 2018 10:48 AM
    Saturday, February 17, 2018 9:49 AM
  • The easiest thing would be to use a couple of panel controls.  Put the formview in the panel (call it PnlLoad or some such thing) that is made visible when you load the page.  Put the thank you message in a different panel (PnlThankYou) on that same page.

    When the form is submitted, instead of taking them to a separate thank-you page, just make the PnlThankYou visible and PnlLoad not visible.

    ClarkNK AKA HomePage Doctor
    Database Tutorials Using ASP.NET Controls
    My recommended web hosting company: RDOServers

    Saturday, February 17, 2018 1:35 PM