473,320 Members | 1,572 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

debugging help: How to access POST field values

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
Sep 20 '06 #1
5 2315
AH!
Found it:
http://www.andrewconnell.com/blog/ar...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.
"sklett" <s@s.comwrote in message
news:e$**************@TK2MSFTNGP04.phx.gbl...
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

Sep 20 '06 #2
you are correct, the browser will not postback the value of a disabled
field.

-- bruce (sqlwork.com)

"sklett" <s@s.comwrote in message
news:O8**************@TK2MSFTNGP03.phx.gbl...
AH!
Found it:
http://www.andrewconnell.com/blog/ar...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.
"sklett" <s@s.comwrote in message
news:e$**************@TK2MSFTNGP04.phx.gbl...
>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


Sep 20 '06 #3
found a nice article (good ol' Scott Mitchell)
http://aspnet.4guysfromrolla.com/articles/012506-1.aspx

"bruce barker (sqlwork.com)" <b_*************************@sqlwork.comwrote
in message news:u5****************@TK2MSFTNGP05.phx.gbl...
you are correct, the browser will not postback the value of a disabled
field.

-- bruce (sqlwork.com)

"sklett" <s@s.comwrote in message
news:O8**************@TK2MSFTNGP03.phx.gbl...
>AH!
Found it:
http://www.andrewconnell.com/blog/ar...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.
"sklett" <s@s.comwrote in message
news:e$**************@TK2MSFTNGP04.phx.gbl...
>>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



Sep 20 '06 #4
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
Oct 4 '06 #5
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
Oct 4 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: David M Loraine | last post by:
I am a sql novice and would appreciate any help with the following problem. In a table I have property addresses stored in 6 fields. Field6 always hold the Post Code. However, fields 4 and 5...
20
by: Jack Schitt | last post by:
I thought I was starting to get a handle on Access, until I tried doing something useful...now I'm stuck. I have a DB with two tables - to keep it simple I'll say that one is an Employee File...
8
by: Matt Theule | last post by:
While stepping through an ASP.NET project, I found that data was being inserted into my database even though I was not stepping through the code that inserted the data. I have a single page with...
16
by: Serdar Kalaycý | last post by:
Hi everybody, My problem seems a bit clichè but I could not work around. Well I read lots of MSDN papers and discussions, but my problem is a bit different from them. When I tried to run the...
28
by: Siv | last post by:
Hi, If I run the following: strSQL = "Select * FROM Clients;" da = New OleDb.OleDbDataAdapter(strSQL, Conn) 'Create data adapter cb = New OleDb.OleDbCommandBuilder(da) ...
47
by: Jo | last post by:
Hi there, I'm Jo and it's the first time I've posted here. I'm in process of creating a database at work and have come a little unstuck.....I'm a bit of a novice and wondered if anyone could...
0
jwwicks
by: jwwicks | last post by:
Introduction This tutorial describes how to use Visual Studio to create a new C++ program, compile/run a program, resume work on an existing program and debug a program. It is aimed at the...
2
jwwicks
by: jwwicks | last post by:
C/C++ Programs and Debugging in Linux This tutorial will give you a basic idea how to debug a program in Linux using GDB. As you are aware Visual Studio doesn’t run on Linux so you have to use...
4
by: mattehz | last post by:
Hey there, I am trying to upload old source files and came across these errors: Warning: Invalid argument supplied for foreach() in /home/mattehz/public_html/acssr/trunk/inc_html.php on line 59...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.