Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All ,

I am facing a problem getting a text box value.

I have a textbox in the design and when I try to get that value the value is not coming.

Below is my Code in Test.aspx.cs file

string uName=Request.Form[document.frm.userName_txt.value];
Response.Write("My User Name is"+uName);


Documentation
---------------
userName_txt:-TextBox name
frm:-Form Name

Thanks in Advance.
Posted
Updated 16-Mar-11 10:44am
v2

1 solution

How about something quite a bit simpler, like:
string uName = userName_txt.Text;
Response.Write( "My user name is " + uName );

Seriously, if this was difficult, you really need to pickup a book on ASP.NET and start working through it.
 
Share this answer
 
Comments
raju melveetilpurayil 16-Mar-11 18:24pm    
good one
Sreejith Gopinathan 16-Mar-11 21:07pm    
+5, nice answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900