ASP.NET - Is HTTP Parameter ordering important?

  • Thread starter Thread starter Joe Morse
  • Start date Start date
J

Joe Morse

Hello. I'm writing an application that screen-scapes an ASP.NET
application. This ASP.NET application uses a postback to refresh state
when the value of a field in a form is changed. This works fine in a
browser, but not in my proxy. The ASP.NET returns a 500 error without
any further explanation.

I'm wondering whether .NET requires a certain ordering of the POST
body parameters? The proxy does reorder some parameters.
 
I don't believe so. Parameters are put in a dictionary and the lookups are
based on name, not index.
 
I suspected as much, as HTTP is fairly agnostic as to the order of the
parameters, and applications and frameworks typically just perform
lookups on a hash of some sort. I wonder if my problem has to do with
the ordering of HTTP headers.
 
Many thanks for your help, Ed.

I figured out what the problem is. ASP.NET postbacks (and I think web
forms in general) pass a parameter called __VIEWSTATE to themselves.
This value (at least on my installation) contains characters that need
to be encoded (spaces, forward-slashes). My proxy was encoding them,
but used '+' to encode spaces instead of '%2B'. Once I manually
replaced the '+' characters, the postback worked.

I'm curious about the format of __VIEWSTATE values. Are the spaces and
other encodable characters absolutely needed, or is there some way to
configure IIS/.NET to use a value that doesn't need to be encoded?

Thanks,

Joe
 
Back
Top