473,850 Members | 2,248 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 2351
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
2479
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
2394
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
3529
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
4232
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
1910
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
2897
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
7346
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
20868
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
6350
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
9895
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
9741
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
10666
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...
1
10724
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9501
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...
1
7899
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4545
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
4140
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3177
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.