This has been driving me crazy. server.transfer doesn't set the focus
to the page I transfer to so when the user does a refresh, the results
aren't what's expected.
I have a datagrid on one page that lists the student's guests. At the
bottom of the datagrid is an 'add a new guest' button. Users click on
this button an it takes them to a new page where they can add a new
guest. So they type in the guest information and click on the 'save'
button. server.transfer takes them back to the datagrid page where
their guest is listed.
Simple enough, right? The problem is, after you save a guest and return
to the datagrid page, when the user refreshes, it adds the same guest to
the datagrid, creating a duplicate guest entry. It took me a long time
to figure out what is happening. The focus is still on the 'add a
guest' page so when you refresh, it's just like clicking on the 'save'
button.
How do I set the focus to the datagrid page after I save a guest? I
need to use server transfer.