Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 在VB.NET中显示警报消息_Asp.net_Alert - Fatal编程技术网

Asp.net 在VB.NET中显示警报消息

Asp.net 在VB.NET中显示警报消息,asp.net,alert,Asp.net,Alert,在我的服务器端代码中,我需要显示一条警告消息,并在满足特定条件时停止页面的执行。执行停止,但我没有收到警报消息。我错过了什么?我的代码是这样的 Try If txtAmtRequested.Text > Val(HiddenTotalFeeAmount.Value) Then ScriptManager.RegisterClientScriptBlock(Me, GetType(Page), UniqueID, "javasc

在我的服务器端代码中,我需要显示一条警告消息,并在满足特定条件时停止页面的执行。执行停止,但我没有收到警报消息。我错过了什么?我的代码是这样的

Try
        If txtAmtRequested.Text > Val(HiddenTotalFeeAmount.Value) Then
            ScriptManager.RegisterClientScriptBlock(Me, GetType(Page), UniqueID,
            "javascript:alert('Total Fee Amount set for this student is - '" & HiddenTotalFeeAmount.Value & "'... Enter Concession Amount lesser than this one..!')", True)
                Exit Function
            End If
        Catch ex As Exception

        End Try
试试这个:

Try
    If txtAmtRequested.Text > Val(HiddenTotalFeeAmount.Value) Then
        ScriptManager.RegisterClientScriptBlock(Me, GetType(Page), UniqueID,
        "javascript:alert('Total Fee Amount set for this student is - " & HiddenTotalFeeAmount.Value & "... Enter Concession Amount lesser than the..!');", True)
            Exit Function
        End If
    Catch ex As Exception

    End Try
在插入值时,您在javascript中结束了字符串,导致以下javascript:

javascript:alert('Total Fee Amount set for this student is - ' <Value> '... Enter Concession Amount lesser than the..!');
javascript:alert('为该学生设置的总费用金额为-'',请输入低于..的优惠金额!');
与此相反,您必须将值直接插入字符串,或在字符串中添加“+”:

 javascript:alert('Total Fee Amount set for this student is - <Value> ... Enter Concession Amount lesser than the..!');
javascript:alert('为该学生设置的总费用金额为-…输入低于..的优惠金额!');

javascript:alert('为该学生设置的总费用金额为-'+'…输入低于..!'的优惠金额);
javascript:alert('Total Fee Amount set for this student is - ' + <Value> + '... Enter Concession Amount lesser than the..!');