Asp.net文本框问题 [英] Asp.net Textbox Problem
本文介绍了Asp.net文本框问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我在获取文本框值时遇到问题.
我在设计中有一个文本框,当我尝试获得该值时,值就没有来.
以下是我在Test.aspx.cs文件中的代码
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);
文档
---------------
userName_txt:-文本框名称
frm:-表格名称
Documentation
---------------
userName_txt:-TextBox name
frm:-Form Name
Thanks in Advance.
推荐答案
如何简单一些,例如:
How about something quite a bit simpler, like:
string uName = userName_txt.Text;
Response.Write( "My user name is " + uName );
严重的是,如果这很困难,那么您真的需要在ASP.NET上拿起一本书并开始研究它.
Seriously, if this was difficult, you really need to pickup a book on ASP.NET and start working through it.
这篇关于Asp.net文本框问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文