473,394 Members | 1,701 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,394 software developers and data experts.

best way to get data: request.form, request.params, controlname.value

Hi!

I think I remember somewhere that using request.form was a bad idea (I can't
say I remember why).
So I'm wondering: What is the best way to retrieve form values? Is
request.form the best way, or request.params the best way?
Or is it best to get the values by referencing directly to my controls, such
as:
textbox example: String val=mytextBox.text
In my case, I'm using x dynamically created controls, so I'd have to loop
through all of the controls of my page, check what kind of control it is,
then get the data.

Nov 17 '05 #1
1 4019
Hi,

I don’t think that using Request.Form is bad idea. Its just more
comfortable to get that data with all other control data from the
Control (If you know its name and type :-) rather then getting just the
control value. ASP.NET adopted OO and using objects its more OO than
retrieving single value from the form collection.

If you just need the Control Data stick with Form collection if you use
other Control properties, methods or events write simple function that
find the control type and retrieve the value.

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #2

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

Similar topics

7
by: Saintor | last post by:
What I do now is I put a value in the tag property, and using the form_current event, I run through all controls properties until the ones with the required tag value are met. Sound OK in theory,...
10
by: Mr Newbie | last post by:
DropDown lists and Listboxes do not appear in the list of controls and values passed back to the server on PostBack in Request.Form object. Can someone confirm this to be correct and possibly...
3
by: oopaevah | last post by:
Hello To prevent scross site scripting I am validating each value in the Request.Params collection against the following regular expression : ^*$ This only allows the following characters :...
6
by: No Spam | last post by:
Dear Access 2003 Users, Is there a way to pop up a MessageBox warning when a user changes data on a form? Basically, I have one field that I really want people to think about before changing,...
4
by: Scott Durrett | last post by:
I have 2 pages. Page1 is a .html page with a form, hidden input, and a submit button. I have the action set to Post. <form id="form1" action="paymentcatch.aspx" method="post"> <input...
8
by: Radx | last post by:
Here in my web application, I have a data entry page with serval controls. Some of the controls have autopostback is set true. But the problem is when two or more people are entering data at the...
2
by: BP | last post by:
if the input field was generated in Client-side Javascript by document.write, how to retrieve the data of the input field in code behind? Thanks
2
by: rn5a | last post by:
A Form has a select list which is populated from a MS-Access database table. The DB table from where the select list is populated has 2 columns - CountryID & CountryName. When the Form is posted,...
13
by: sheldonlg | last post by:
I could use a little help here. I have goodled with not much luck. I have been at this for a bit and would appreciate suggestions. I have a form (A.php) that collects a lot of data. When I...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.