Passing Variables: How can I pass results of a record after insert to a separate page?

Posted on 2009-04-27
Last Modified: 2012-05-06
Passing Variables: How can I pass results of a record after insert to a separate page?
I have a form that inserts properly, but want to pass over to another page with some results about the record to be displayed in labels.  What is the best way to do this?
Question by:devnewbee
    LVL 12

    Accepted Solution

    Lots of ways I can think of.

    (1) store everything to session after insert and grab them on 2nd page

    but better

    (2) After insert grab whatever primary id you have from the insert and append it to the querystring of the redirect

    e.g.  After inserting some record on page 1, you get a primary key value of '7' return. When you do response redirect append the '7' like


    then on page 2, you read the query string, then query the database based on the id.

    I like the second approach because most of my apps lately are heavy usage, I try to minimize storing to session

    Author Comment

    can you give me and example of actually passign the scope identity after the insert with query string other than what you have shown.  You use the valu of "7" above.  I would not know the value.  Sorry these are fundamental questions.  I am new at this...

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    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.

    For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
    For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
    This video discusses moving either the default database or any database to a new volume.

    759 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

    11 Experts available now in Live!

    Get 1:1 Help Now