我试图在visual studio vb中的网络表单上做一些警告消息,但是当我尝试在动作方法中动态编码时,它一直给我这个错误 " 只允许在包含内容控件的内容页面中直接使用内容控件"
我将旧代码留在了它只是在HTML
中生成标签错误消息的位置在此行下方获得蓝色波浪线
popupScript = "<script language='javascript'>" + "showErrorToast();" + "</script>"
jquery函数
<script type="text/javascript">
function showErrorToastr() {
toastr.warning('Please enter at least 3 characters of the organisation name')
}
单击取消按钮时的Vb动作方法
Protected Sub btnSelect0_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim popupScript As String = ""
If txtorgname.Text = "" Then
lblerror.Text = "Please enter at least 3 characters of the organisation name"
txtorgname.Focus()
popupScript = "<script language='javascript'>" + "showErrorToast();" + "</script>"
ElseIf Len(txtorgname.Text) < 3 Then
lblerror.Text = "Please enter at least 3 characters of the organisation name"
txtorgname.Focus()
ElseIf Len(txtorgname.Text) > 50 Then
lblerror.Text = "Organisation name too long. Max 50"
txtorgname.Focus()
Else
BindData()
End If
End Sub
答案 0 :(得分:0)
showErrorToast
,但showErrorToastr
会这样做。
尝试改变。如果它不起作用,请发表评论。