debugging help: How to access POST field values

  • Thread starter Thread starter sklett
  • Start date Start date
S

sklett

I'm not real experienced with asp.net so this may be obvious.

I've got a situation where some of my client side javascript is causing my
posted form's controls to lose their values.
In other words, I have a server control TextBox, I enter some text, my
client side scripts do some stuff and in the Page_Load method after
submitting the form the value for my TextBox is empty.

If the javascipt doesn't run, the values are fine. I've looked over the
javascript code and don't see anything obvious, so I wanted to try and
determine how asp.net retrieves the values from a posted form and assigns
them to the server controls. In other words, how does a TextBox control
get the value back from the posted form?

can I access the field values in the HttpRequest after submitting the form?
I've done this with the query string, but how do I access the fields when
the method is a POST?

This is a weird problem, I may be barking up the wrong tree but I need to
start somewhere? :0(

Thanks for any help,
Steve
 
AH!
Found it:
http://www.andrewconnell.com/blog/archive/2004/10/07/523.aspx

My javascript is enabling and disabling controls to control what part of a
form a user is interacting with and prevent them from changing values
without clicking 'edit' first.
Apparently disabled controls aren't updated in teh post back. Great.

So for now I will abandon this approach and try and think of something that
is .net friendly.
 
you are correct, the browser will not postback the value of a disabled
field.

-- bruce (sqlwork.com)
 
why dont you duplicate the disabled fields as hidden fields as well and just look for those values.

you can use javascript to repopulate hidden fields just like text boxes
 
why dont you duplicate the disabled fields as hidden fields as well and just look for those values.

you can use javascript to repopulate hidden fields just like text boxes
 
Back
Top