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

How to get value of html control?

dgk
Simple question. How do I get the value of an html textbox? This is
the guy:

<INPUT style="Z-INDEX: 113; LEFT: 657px; WIDTH: 78px; POSITION:
absolute; TOP: 62px; HEIGHT: 21px type="password" size="7"
name="pwtext">

It doesn't seem to become a session variable.
Nov 18 '05 #1
4 1323
It wouldn't be in a session variable unless you wrote code that stored it in a session variable (which would have to have been before the control was rendered to the client.

The easiest thing would probably be to make it a Web Control, something like this

<asp:TextBox id="pwtext" style="Z-INDEX: 103; LEFT: 141px; POSITION: absolute; TOP: 27px" runat="server" TextMode="Password"></asp:TextBox

When your form is submitted back to the server, the value will be accessible in code-behind like this: TextBox1.Tex

If, for some reason, you don't want to use a Web Control, the text box value will be avaiable to your server-side application if it was included in a submitted form. Assuing METHOD=POST, you would be able to access it with the following expression: Request.Form.Item("pwtext")
Nov 18 '05 #2
Hello dgk,

Assign it an ID and then do Request.Forms["pwtext"] in your codebehind.
Simple question. How do I get the value of an html textbox? This is
the guy:

<INPUT style="Z-INDEX: 113; LEFT: 657px; WIDTH: 78px; POSITION:
absolute; TOP: 62px; HEIGHT: 21px type="password" size="7"
name="pwtext">

It doesn't seem to become a session variable.

--

--
Matt Berther
http://www.mattberther.com
Nov 18 '05 #3
dgk
On Thu, 27 May 2004 11:46:04 -0700, "Rich"
<an*******@discussions.microsoft.com> wrote:
It wouldn't be in a session variable unless you wrote code that stored it in a session variable (which would have to have been before the control was rendered to the client.)

The easiest thing would probably be to make it a Web Control, something like this:

<asp:TextBox id="pwtext" style="Z-INDEX: 103; LEFT: 141px; POSITION: absolute; TOP: 27px" runat="server" TextMode="Password"></asp:TextBox>

When your form is submitted back to the server, the value will be accessible in code-behind like this: TextBox1.Text

If, for some reason, you don't want to use a Web Control, the text box value will be avaiable to your server-side application if it was included in a submitted form. Assuing METHOD=POST, you would be able to access it with the following expression: Request.Form.Item("pwtext"))

Thanks, Request.Form.Item("pwtext")) does it.

I didn't even notice that the asp textbox had a password textmode or I
likely would have used it. But, I thought the general idea was to use
HTML controls wherever the extra overhead of server controls wasn't
needed. In this case I don't want it to maintain state and I don't
need to refer to it except to get the value. So is there a reason to
make it a server control?
Nov 18 '05 #4
Or supply the tag with runat="server" parameter to make it HtmlControl will
do too.
Best of all, in this way only little coding is added but you'll then be able
to program all avaliable attribute of the password box.

"Matt Berther" <mb******@hotmail.com> ???
news:e4**************@TK2MSFTNGP11.phx.gbl ???...
Hello dgk,

Assign it an ID and then do Request.Forms["pwtext"] in your codebehind.
Simple question. How do I get the value of an html textbox? This is
the guy:

<INPUT style="Z-INDEX: 113; LEFT: 657px; WIDTH: 78px; POSITION:
absolute; TOP: 62px; HEIGHT: 21px type="password" size="7"
name="pwtext">

It doesn't seem to become a session variable.

--

--
Matt Berther
http://www.mattberther.com

Nov 18 '05 #5

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

Similar topics

8
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
2
by: VB Programmer | last post by:
I created a VB6 user control with a ActiveX Knob on it. Here's the simple code: Public Property Get Value() As Integer Value = CWKnob.Value End Property Public Property Let Value(Value As...
6
by: Tom Kiefer | last post by:
Question: If I have an ASP.NET User Control which defines/exposes a property that the page can use to specify a mode or data subset for the control to use, is there a way to tell the @OutputCache...
12
by: Mark Kurten | last post by:
i have the code below: for starters the value of txtempid = 1 after i go through this routine (i put a break point on the txtname.value line), the value of txtEmpID is 2 (Just like it is...
1
by: Martin | last post by:
Dear Group Sorry for bothering you again but I need expert advice on this. I have placed a HTML textbox on my aspx form and converted it to run as a server control. At some point in my code I...
1
by: Will Gillen | last post by:
I know this has probably been asked before, but I can't seem to find a solid answer in any of the archives. First, before my question, please forgive my limited knowledge of the event lifecycle...
8
by: Nathan Sokalski | last post by:
I have a System.Web.UI.HtmlControls.HtmlInputFile control that I use to submit files. After the file is successfully submitted, I want the field to be reset so that the user knows the file was...
11
by: saurabh | last post by:
Can anybody tell me how to change the value of an html control from the c#.... eg i hv one asp.net radio button control and one html hidden variable... so on page load in case the radio button is...
3
by: dcassar | last post by:
I am working on a complex server control that dynamically creates an HtmlInputHidden control that stores its value. As far as the postback process is concerned, this hidden input acts as the...
4
by: TS | last post by:
In my production exceptions i get an email with all the form elements and their values to debug. the controls that have a blank value are not seen and it makes my debug job harder (was the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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...
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...

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.