473,657 Members | 2,516 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2337
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$******** ******@TK2MSFTN GP04.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******** ******@TK2MSFTN GP03.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$******** ******@TK2MSFTN GP04.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_************ *************@s qlwork.comwrote
in message news:u5******** ********@TK2MSF TNGP05.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******** ******@TK2MSFTN GP03.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$******* *******@TK2MSFT NGP04.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
2475
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 are sometime NULL. Using the desktop integration package we have which interfaces with MS Word when printing an address in a letter the end results often end up looking like this. 1 Any Street AnyTown
20
2356
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 (Employees), and the other is an Address File (Addresses) linked by SSN. I've set Addresses as a Lookup Table - If the user starts typing in the SSN it should pull up the Employees records. I'm getting stuck in the Data Entry form. When I type in...
8
3514
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 inline code. The page has a Datagrid, a textbox and a button. When the button is clicked, the value of the textbox is inserted into the table whose contents are displayed on the page. The problem occurs when I set a breakpoint on a line *IN*...
16
4199
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 project in debug mode (by hitting F5) it gives an error message "Error while trying to run project: Unable to start debugging on the web server.
28
1879
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) 'Create command builder using the datadapter dt = New Data.DataTable da.Fill(dt) 'pour in the data using the adapter
47
2860
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 help. I work in a library and send out dual language books to babies of dual or other nationality. The db is to be used for logging a range of book titles and numbers ordered and books sent out to individuals. I am trying to work out a way of...
0
7324
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 beginning CIS student who is struggling to get their programs working. I work in the computer lab at the college I'm attending and I see many students who don't know how to use the IDE for best results. Visual Studio automatically creates a number of...
2
20836
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 some of the tools provided on the command-line. If you hate the command line tools, get over it since you’re bound to be using them at some point in your career. All commands in Linux ARE case sensitive so capital letters are different from lowercase...
4
6308
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 Notice: Undefined index: args in /home/mattehz/public_html/acssr/trunk/inc_error.php on line 92 Warning: Invalid argument supplied for foreach() in /home/mattehz/public_html/acssr/trunk/inc_error.php on line 92
0
8420
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8324
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8842
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8740
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7353
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2743
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.