J
Jim Little
Hello,
I'm driving myself crazy either because I'm missing something about ASP.NET,
or what I'm trying to do simply can't be done.
First, I am not using session variables to track state. My app will
ultimately be web-farmed, so I resisted using either session variables.
Second, what I'm trying to do is easy. What I'm trying to prevent seems
impossible.
I have web form "a" and web form "b". a.aspx contains a form; b.aspx shows
the data submitted by a. I am using the Context object to make information
from a.aspx available to b.aspx after a Server.Transfer("b.aspx") operation.
This works, no problem.
The problem is that if the user hits <F5> (refresh) in IE while they're
viewing b.aspx, then a.aspx is re-displayed and a "duplicate row" error
message is displayed, since a.aspx inserts a unique row into a database
table.
I am trying to "detect" when a user refreshes document b.aspx.
I understand that if I used Response.Redirect from a.aspx to go to b.aspx,
then this problem wouldn't occur. But then I have a new problem: how do I
make data submitted to a.aspx available in b.aspx without using session
variable or querystring variables? The session variables are not possible
for the reason I mentioned earlier; querystring variables will be messy,
because there are a dozen or so fields entered in a.aspx...
The only thing I could think of is to use Response.Redirect("b.aspx"), and
pass only the record-key information. I could then read the submitted data
from the database. But that seems silly, since the user just submitted the
data a moment before. Taking a database hit seems wasteful under these
circumstances.
Unless I'm missing something big, it seems that there is no good way to use
Context and Server.Transfer()--and also detect a refresh so that the form is
NOT redisplayed but, rather, the summary (b.aspx) page could be displayed
instead.
Any ideas would be greatly appreciated.
Thank you so much,
Jim
I'm driving myself crazy either because I'm missing something about ASP.NET,
or what I'm trying to do simply can't be done.
First, I am not using session variables to track state. My app will
ultimately be web-farmed, so I resisted using either session variables.
Second, what I'm trying to do is easy. What I'm trying to prevent seems
impossible.
I have web form "a" and web form "b". a.aspx contains a form; b.aspx shows
the data submitted by a. I am using the Context object to make information
from a.aspx available to b.aspx after a Server.Transfer("b.aspx") operation.
This works, no problem.
The problem is that if the user hits <F5> (refresh) in IE while they're
viewing b.aspx, then a.aspx is re-displayed and a "duplicate row" error
message is displayed, since a.aspx inserts a unique row into a database
table.
I am trying to "detect" when a user refreshes document b.aspx.
I understand that if I used Response.Redirect from a.aspx to go to b.aspx,
then this problem wouldn't occur. But then I have a new problem: how do I
make data submitted to a.aspx available in b.aspx without using session
variable or querystring variables? The session variables are not possible
for the reason I mentioned earlier; querystring variables will be messy,
because there are a dozen or so fields entered in a.aspx...
The only thing I could think of is to use Response.Redirect("b.aspx"), and
pass only the record-key information. I could then read the submitted data
from the database. But that seems silly, since the user just submitted the
data a moment before. Taking a database hit seems wasteful under these
circumstances.
Unless I'm missing something big, it seems that there is no good way to use
Context and Server.Transfer()--and also detect a refresh so that the form is
NOT redisplayed but, rather, the summary (b.aspx) page could be displayed
instead.
Any ideas would be greatly appreciated.
Thank you so much,
Jim