所以我一直在尝试从输入文本中获取值并将其设置为字符串,我尝试了4种不同的方式,出于某种原因,我得到String = ""
或String
没什么
代码VB背后
Public Sub subscriber(sender As Object, e As EventArgs)
Dim check_Mail As String = subs_text.Value()
If check_Mail = Nothing Then
alertJava("Working Empty")
Else
alertJava(check_Mail.ToString())
End If
End Sub
也尝试了
Dim checkmail as string = Page.Request.Form("subs_text")
Dim checkmail as string = Request("subs_text")
Dim checkmail as string = Request(subs_text.value())
我有HTML代码
<div class="input-group"> ------
<input id="subs_text" runat="server" name="subs_text" type="text" class="form-control">
<placeholder="Email Adress"> / -----
<span class="input-group-btn"> ----
<input type="button" runat="server" onserverclick="subscriber" class="btn btn-primary" value="JoinUS"> ----
</span>
</div>
答案 0 :(得分:0)
您没有设置value =“”属性。因此,它总是空的
答案 1 :(得分:0)
实际上是表单不在Runat = server中的值,回发值返回uniqueID而不是实际值,所以
Dim Check_Main as String = Request.Form(TEXTFIELD_ID.UniqueID)
希望这有助于某人