K
Keith Patrick
After completely giving up on finding some way in my ASP.Net app to take a
query string URL and redirect to it as a POST instead, I went with a system
like so:
Upon "redirection," all the QueryString pairs are placed in
HttpContext.Current.Items and retrieved with a wrapper for Request.Params
that includes checks there. This works in general instances, but one
problem has come up that has me stuck: since the stuff is in the context and
not physically presented on a page anywhere, if I move to another page and
then hit "Back," my context items are once again lost, and the page won't
display properly. Seems like the only way to persist those fields correctly
is to either put them in the query string when I go from one page to
another, which I *can't reliably do because my URLs will exceed the limit
and result in an HTTP error*, or somehow POST the variables, which I also
have not been able to do because the Request.Forms collection is read-only,
and I cannot programmatically add hidden fields to the ASP.Net form (says I
can't modify the set of controls).
So given the aforementioned scenario, is ASP.Net simply incapable of
handling this? I would think not, since Java has allowed programmatic
POSTing + it seems just too restrictive to imagine that the designers would
have made it impossible to change pages when the # of KV pairs would
potentially exceed a URL's maximum allowable length. However, I have yet to
find an actual answer to the GET-to-POST questions that have been posed (the
answers veer more towards, "just do whatever you're trying to do another
way"), and this is searching over several years of usenet posts.
query string URL and redirect to it as a POST instead, I went with a system
like so:
Upon "redirection," all the QueryString pairs are placed in
HttpContext.Current.Items and retrieved with a wrapper for Request.Params
that includes checks there. This works in general instances, but one
problem has come up that has me stuck: since the stuff is in the context and
not physically presented on a page anywhere, if I move to another page and
then hit "Back," my context items are once again lost, and the page won't
display properly. Seems like the only way to persist those fields correctly
is to either put them in the query string when I go from one page to
another, which I *can't reliably do because my URLs will exceed the limit
and result in an HTTP error*, or somehow POST the variables, which I also
have not been able to do because the Request.Forms collection is read-only,
and I cannot programmatically add hidden fields to the ASP.Net form (says I
can't modify the set of controls).
So given the aforementioned scenario, is ASP.Net simply incapable of
handling this? I would think not, since Java has allowed programmatic
POSTing + it seems just too restrictive to imagine that the designers would
have made it impossible to change pages when the # of KV pairs would
potentially exceed a URL's maximum allowable length. However, I have yet to
find an actual answer to the GET-to-POST questions that have been posed (the
answers veer more towards, "just do whatever you're trying to do another
way"), and this is searching over several years of usenet posts.