avoiding double post when user refresh browser

J

Jeff

hi

asp.net 2.0

I know it's a good idea to perform an redirection to current page, but not
sure I do it right, I mean in the code below I send in
Request.Url.AbsoluteUri as input... not sure it's correct of me to use that
parameter...

Response.Redirect(Request.Url.AbsoluteUri + "?id=" + id.ToString());

any suggestions?
 
G

Guest

hi

asp.net 2.0

I know it's a good idea to perform an redirection to current page, but not
sure I do it right, I mean in the code below I send in
Request.Url.AbsoluteUri as input... not sure it's correct of me to use that
parameter...

Response.Redirect(Request.Url.AbsoluteUri + "?id=" + id.ToString());

any suggestions?

The AbsoluteUri property includes the entire URI stored in the Uri
instance, including all fragments and query strings.
 
J

Jeff

what you recommend me use instead of AbsoluteUri? I mean if AbsoluteUri has
the querystring then it's a potential bug doing this code:
Request.Url.AbsoluteUri + "?id=" + id.ToString()); where I again add the
querystring



hi

asp.net 2.0

I know it's a good idea to perform an redirection to current page, but not
sure I do it right, I mean in the code below I send in
Request.Url.AbsoluteUri as input... not sure it's correct of me to use
that
parameter...

Response.Redirect(Request.Url.AbsoluteUri + "?id=" + id.ToString());

any suggestions?

The AbsoluteUri property includes the entire URI stored in the Uri
instance, including all fragments and query strings.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top