Asp.net 没有显示来自“我的代码”的消息。我做得不对吗?
我在formview控件上有这个标记。formview的控件id为scoreGrid:Asp.net 没有显示来自“我的代码”的消息。我做得不对吗?,asp.net,vb.net,formview,Asp.net,Vb.net,Formview,我在formview控件上有这个标记。formview的控件id为scoreGrid: <asp:Label ID="PercentLabel" runat="server" Text='<%# Eval("PercentCorrect","{0:0.00}%" ) %>' “75”那么 Message.Text=“祝贺您;您通过了测试” 如果结束 根据用户的分数,显示用户是否通过了测试 我没有得到任何错误。但是,没有显示任何消息 我做错了什么 谢谢当您需要使用数字类型进行
<asp:Label ID="PercentLabel" runat="server" Text='<%# Eval("PercentCorrect","{0:0.00}%" ) %>'
“75”那么
Message.Text=“祝贺您;您通过了测试”
如果结束
根据用户的分数,显示用户是否通过了测试
我没有得到任何错误。但是,没有显示任何消息
我做错了什么
谢谢当您需要使用数字类型进行比较时,您正在比较逻辑大于和小于的字符串,如下所示:
Dim number As Single
If Single.TryParse(lbscore.Text, number) Then
' Do comparison logic
If number < 75 Then
Message.Text = "Your score does not meet minimum requirement"
ElseIf number >= 75 Then
Message.Text = "Congratulations; you have passed the test"
End If
Else
' Could not convert text from lbscore to a Single
Message.Text = "Error trying to determine your score!"
End If
Dim编号为单个
如果是Single.TryParse(lbscore.Text,number),则
做比较逻辑
如果数字小于75,则
Message.Text=“您的分数不符合最低要求”
如果号码>=75,则
Message.Text=“祝贺您;您通过了测试”
如果结束
其他的
'无法将文本从lbscore转换为单个
Message.Text=“尝试确定分数时出错!”
如果结束
当需要使用数字类型进行比较时,您正在比较逻辑大于和小于的字符串,如下所示:
Dim number As Single
If Single.TryParse(lbscore.Text, number) Then
' Do comparison logic
If number < 75 Then
Message.Text = "Your score does not meet minimum requirement"
ElseIf number >= 75 Then
Message.Text = "Congratulations; you have passed the test"
End If
Else
' Could not convert text from lbscore to a Single
Message.Text = "Error trying to determine your score!"
End If
Dim编号为单个
如果是Single.TryParse(lbscore.Text,number),则
做比较逻辑
如果数字小于75,则
Message.Text=“您的分数不符合最低要求”
如果号码>=75,则
Message.Text=“祝贺您;您通过了测试”
如果结束
其他的
'无法将文本从lbscore转换为单个
Message.Text=“尝试确定分数时出错!”
如果结束
太好了,很高兴听到这个消息。如果你觉得我的答案对你有帮助,那么请随意投票和/或接受答案。太好了,很高兴听到。如果你觉得我的答案对你有帮助,那么请随意投票和/或接受答案。