469,625 Members | 1,106 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,625 developers. It's quick & easy.

Server Transfer doesn't Set Focus to Page

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.

Nov 18 '05 #1
1 1493
It is setting focus, but a refresh forces the same action when you have the
form linked via Server.Transfer(). I would consider going to
Response.Redirect instead as a refresh will only refresh the page rather than
rerun the form submit.

The action you are speaking of is normal, as the browser is asking for a
refresh on the entire process, as it does not realize it has been transfered
on the server side.

---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

"Jim Bayers" wrote:
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.

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Harsh Thakur | last post: by
3 posts views Thread by Manuel Lopez | last post: by
5 posts views Thread by Nedu N | last post: by
4 posts views Thread by Bob H | last post: by
9 posts views Thread by Mark | last post: by
3 posts views Thread by Ken Varn | last post: by
5 posts views Thread by Richard | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.