我有一个带有输入字段的用户控件。
<input type="text" name="firstName1" id="txtFirst1" />
我正在尝试从代码隐藏页面获取用户输入的值。我不想将属性runat =“server”添加到字段中。
我尝试使用以下代码,但没有运气:
Dim MyFistName As String = Request.Form("txtFirst1")
如何在不添加runat =“server”的情况下获取输入字段txtFirst1的值?
答案 0 :(得分:0)
使用此:
Request.Form['txtFirst1']
即。 (C#):
string inputValue = String.Format("{0}", Request.Form['txtFirst1']);