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

Can we set form field in Asp.net

ad
We can set and get form field in Asp.
How can we set and get form field in Asp.net?
Nov 19 '05 #1
3 944
You can still use Request.Form

but typically you'd used a web control, such as an <asp:textbox id="name"
runat="server" />

and just access the value via name.Text

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:OP***************@TK2MSFTNGP10.phx.gbl...
We can set and get form field in Asp.
How can we set and get form field in Asp.net?

Nov 19 '05 #2
ad

Thank,
I have a some purpose, so I must use Request.Form to get some value.
I have tried below codes:

in a button's onClick event
TextBox1.Text="Hellow";

in the FormLoad event:
string myString = Request.Form["TextBox1"];
Label1.Text = myString;

But the the myString return null.

How can I do that?

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> ¼¶¼g
©ó¶l¥ó·s»D:eD**************@tk2msftngp13.phx.gbl.. .
You can still use Request.Form

but typically you'd used a web control, such as an <asp:textbox id="name"
runat="server" />

and just access the value via name.Text

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:OP***************@TK2MSFTNGP10.phx.gbl...
We can set and get form field in Asp.
How can we set and get form field in Asp.net?


Nov 19 '05 #3
two things...
Setting the text property of the textbox doesn't put the value in the
request.form...

and FormLoad happens BEFORE OnClick...so setting the the text in the button
click, even if it did set the value in request.form, would do so after
page_load fired...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:up**************@tk2msftngp13.phx.gbl...

Thank,
I have a some purpose, so I must use Request.Form to get some value.
I have tried below codes:

in a button's onClick event
TextBox1.Text="Hellow";

in the FormLoad event:
string myString = Request.Form["TextBox1"];
Label1.Text = myString;

But the the myString return null.

How can I do that?

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
¼¶¼g
©ó¶l¥ó·s»D:eD**************@tk2msftngp13.phx.gbl.. .
You can still use Request.Form

but typically you'd used a web control, such as an <asp:textbox id="name"
runat="server" />

and just access the value via name.Text

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:OP***************@TK2MSFTNGP10.phx.gbl...
> We can set and get form field in Asp.
> How can we set and get form field in Asp.net?
>
>



Nov 19 '05 #4

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

Similar topics

2
by: JJ | last post by:
Hi All, When someone selects a value in a select on a form I want to show the same form with another select with certain values depending on first select. How can I do this? Should I keep...
4
by: Andrew Williams | last post by:
Does anyone know of a way to quickly validate an HTML web form? I need to make sure that certain fields on my form actually contain data and are not submitted blank. I have tried using...
4
by: Andy Hutchings | last post by:
Hi everybody - hope you can help out here. I have a form in a database, which is a columnar form from one of the tables in the db - there is a sub-form to the form which is a datasheet view of...
15
by: Steve | last post by:
I have a form with about 25 fields. In the BeforeUpdate event of the form, I have code that sets the default value of each field to its current value. For a new record, I can put the focus in any...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
6
by: LSemos | last post by:
I am trying to lookup phone numbers in a separate table based on the name in the current Tab control tblContacts has the fields: Name, Phone, Fax, and Email In my Form's Tab control, I have...
2
by: fstenoughsnoopy | last post by:
I have a customer order database and I need to pull a customers information, ie first name, last name, address, city, state, zip, phone, etc, into the oder table. i don't know how to go about...
2
by: Cerebral Believer | last post by:
Hi folks, Can anyone help me with this form: http://futurebydesign-music.com/_member/club_fbd_reg.php I have followed to coding instructions aas closely as I can, but I am getting errors...
8
by: M.L. | last post by:
Hello. I created a form using JS validation with the form tag as follows: <form name="form1" action="dynaform.php" method="post" onsubmit="return pvg_sub();"> The js validation script sends...
3
by: mckbill | last post by:
Is there a way I can direct the cursor to a specific field (variable) in a form by typing the field name while in form view? I have a form with many fields, and it would be nice if there were...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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.