how to display confirmation data in formview prior to insert

Posted on 2008-11-19
Last Modified: 2013-11-26
We're using ASP.NET 2.0 FormView control wrapped by a web user control to handle CRUD UI operations.  It works well except for confirmation PRIOR to insert or update.  All the links I find on "confirmation" are the response.redirect type after the insert has been made to database.  I need to display the data to user one last time prior to insert.

Formview does not appear to have a mechanism for displaying a readonly template of insert/update data PRIOR to insert/update.  

Tried Me.fvAccountCC.ChangeMode(FormViewMode.ReadOnly) but user input from viewstate doesn't appear in this mode

I'm not good enough yet w/ ADO/XML to extract insert/update data as DataTable and use as datasource for new instance of user control/Formview in readonly view in confirmation page.

Any ideas before I start messy marshalling of user input to duplicate controls in <EmptyDataTemplate> using .FindControl across two instances of usercontrol/formview
  Public Sub SetConfirmTemplate(ByVal Src As ctlAccountCC)
        Me.fvAccountCC.DataSourceID = Nothing
        CType(Me.fvAccountCC.FindControl("lblAccountName"), Label).Text = CType(Src.FormView.FindControl("txtAccountNo"), TextBox).Text
        CType(Me.fvAccountCC.FindControl("lblAccountNo"), Label).Text = CType(Src.FormView.FindControl("txtAccountNo"), TextBox).Text
        CType(Me.fvAccountCC.FindControl("imgCardType"), Image).ImageUrl = CType(Src.FormView.FindControl("imgCardType"), Image).ImageUrl


Question by:mstanley67
    1 Comment
    LVL 10

    Accepted Solution

    Set the formview.enabled=false.  Then create a panel object with the confirm text.  The accept button on the panel will be the actual update code, the cancel button will hide the panel and enable the formview again.  One thing I ahve found doing this is that it is much simpler to create a class, then when making the panel visble, set the cssclass of the panel.  That makes editing thepage much simple, since if you set the location in the style for the panel it makes it difficult to edit the page.  
    In the panel you can create whatever kind of confirmation dialog you want.
    Another option you may want to investigate is the ajax control toolkit ( which has a "ModalPopupExtender" control.  I have never had much luck with it, preferring to create my own, but it is there for you to use.
    Good luck.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
    Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now