Problem with response.redirect sending incorrect HTTPMethod

Posted by Andy Macnaughton-Jones on Stack Overflow See other posts from Stack Overflow or by Andy Macnaughton-Jones
Published on 2009-09-22T08:22:55Z Indexed on 2010/04/15 1:03 UTC
Read the original article Hit count: 483

Filed under:
|

Hi, I've got a strange problem with a Response.Redirect. I'm using VB.NET with the .NET 2 framework (so VS2005 & SP1).

I've got a page that I do a form submit on (that's a proper form method="POST" hard-coded onto the page) and that properly posts me back the page data which is then processed. As part of that processing the system determines if we need to get sent to another URL after processing has been complete. So the request.httpmethod = "POST".

So if the "GotoPage" parameter has a URL specified we then do a response.redirect(URL, false). (False as we want page processing to complete in order to write some timing logs etc).

The page correctly redirects but instead of the response having a "GET" as the request.httpmethod it has a "POST" instead !

Now, we're using our own custom framework so that we use the HTTPRequest method to determine if a page has been posted back or is being "Getted" so the "IsPagePostBack" property doesn't work (that only works when you're using the normal .NET controls and form submissions). In all other instances our code works happily but what might be causing the Request.httpMethod to not be being set correctly ? I've tried doing a response.clear before the redirect in case headers are being written out before hand but to no avail.

Any clues ?!

thanks, Andy

© Stack Overflow or respective owner

Related posts about vb.net

Related posts about response.redirect