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

How to set a value into a HTML input box in ASP.NET?

Hi Experts:

I'm using ASP.NET 2.0 (C#). I need to do something a bit unusual:

There is a hidden HTML input field (text box) and I need to programmatically
set some value into it. How can I do it? Please be specific if possible.

Thanks in Advance!

Polaris
Jun 24 '07 #1
3 6115
Polaris wrote:
Hi Experts:

I'm using ASP.NET 2.0 (C#). I need to do something a bit unusual:

There is a hidden HTML input field (text box) and I need to programmatically
set some value into it. How can I do it? Please be specific if possible.

Thanks in Advance!

Polaris

Just set its runat attribute to runat="server" and you can set its value
from your code behind, simply by selecting Control.Value

Regards
Mick
Jun 24 '07 #2
Sorry, forgot to mention that I could not use the runat="server" attribute
for this input box. Is there other ways to do it?

"Polaris" <et*******@hotmail.comwrote in message
news:OX**************@TK2MSFTNGP06.phx.gbl...
Hi Experts:

I'm using ASP.NET 2.0 (C#). I need to do something a bit unusual:

There is a hidden HTML input field (text box) and I need to
programmatically set some value into it. How can I do it? Please be
specific if possible.

Thanks in Advance!

Polaris


Jun 24 '07 #3
On Jun 24, 9:50 pm, "Polaris" <etpola...@hotmail.comwrote:
Sorry, forgot to mention that I could not use the runat="server" attribute
for this input box. Is there other ways to do it?

"Polaris" <etpola...@hotmail.comwrote in message

news:OX**************@TK2MSFTNGP06.phx.gbl...
Hi Experts:
I'm using ASP.NET 2.0 (C#). I need to do something a bit unusual:
There is a hidden HTML input field (text box) and I need to
programmatically set some value into it. How can I do it? Please be
specific if possible.
Thanks in Advance!
Polaris
Hi...

Since you can not use runat server...
you got to use javascript or some thing like that...
well just use.
Page.RegisterStartupScript or
Page.RegisterClientScriptBlock to inject a script which
will set the value of the hidden textbox

Thanks
Masudur
http://munnacs.110mb.com

Jun 24 '07 #4

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

Similar topics

1
by: G Kannan | last post by:
Hey all! I have written a perl script to retrieve information from a HTML Form and insert the data into an Oracle database table. I am gettting the the following error message: "Use of...
7
by: NewbieJon | last post by:
I am attempting to send the variable "sComputerName" from my ActiveX script to "GetInfo.asp" using javascript. (Having been advised this is the way to get my ActiveX variable into my ASP script) ...
16
by: cwizard | last post by:
I'm calling on a function from within this form, and there are values set but every time it gets called I get slammed with a run time error... document.frmKitAmount.txtTotalKitValue is null or not...
1
by: MickG | last post by:
I am trying to change the value of the variable "hard" according to which radio button is pressed and I am having no joy. Could anyone help me with this, the problematic section is marked with...
5
by: drdave | last post by:
Hi, I have 6 forms being generated using coldFusion, they are named special1, special2 special3 and so on.. in these forms I have a link to open a new window. I am trying to pickup the...
5
by: stellstarin | last post by:
I have a html where fields are created and added dynamically on the client side. I use the AppendChild() call to create fields dynamically. On submit i try to get the value for all the...
12
by: Doogie | last post by:
How do I make a value the default value for a combo box in ASP 3.0? What I have below does NOT work, yet I've seen it in HTML file examples before (and works if I put it in a HTML file by itself,...
4
by: AR123 | last post by:
In the field for employee contribution I want to have GBP and make sure that this prints out in the results email. How can I set it up so that the GBP display next to the value in the results email?...
1
by: sourcie | last post by:
I am changing an existing quiz found on "JavaScriptKit.com Multiple Choice Quiz" I have an image. Instead of using the radio buttons with the normal true/false question, I want to place two...
10
by: Kelly | last post by:
Can anyone tell me what I'm doing wrong here? ================================== <html> <head> <title>Test Form</title> <script language="JavaScript" type="text/javascript"> </head>
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: 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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
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...

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.