0
我有onclick按鈕,當我調試時,我發現我的onclick值是NULL.Anyone知道爲什麼它不能獲得Onclick事件的值。在VB.Net中彈出窗口(aspx.vb)代碼隱藏
Dim HTMLForm As New StringBuilder
HTMLForm.Append("<html>")
HTMLForm.AppendLine("<body onload='document.forms[""" & "form1" & """].submit()'>")
HTMLForm.AppendLine("<form id='form1' method='POST'>")
'Set value to collection
SetRequestField("amount", CDec(lblTtlPayAmt.Text))
'Generate HTML content using collection
For Each kvp As KeyValuePair(Of String, String) In RequestFields
If Not String.IsNullOrEmpty(kvp.Value) Then
HTMLForm.AppendLine("<input type='hidden' id='" & kvp.Key & "' name='" & kvp.Key & "' value='" & kvp.Value & "' />")
End If
Next
HTMLForm.AppendLine("<input type = 'submit' value=PayNow' onclick = '" & window.open("~/Payment/Payment.aspx") & "'/>")
HTMLForm.AppendLine("</form>")
HTMLForm.AppendLine("</body>")
HTMLForm.AppendLine("</html>")
Response.Clear()
Response.Write(HTMLForm.ToString())
使用[選項嚴格開](https://msdn.microsoft .com/en-us/library/zcd4xwzs.aspx)來查看一些問題。 –
@ AndrewMorton ..謝謝,兄弟。 –