avoiding double post when user refresh browser

  • Thread starter Thread starter Jeff
  • Start date Start date
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?
 
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.
 
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.
 
Back
Top