详细信息视图控件asp.net [英] Details view control asp.net

查看:68
本文介绍了详细信息视图控件asp.net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有这个详细信息视图控件,用户可以在其中输入休假应用程序,我使用了if语句来设置条件,但是即使不满足条件,仍然可以插入详细信息.我试过使用exit sub,但给出的结果相同.
这是代码.

Hi,
I have this details view control where users enter their leave application I have used the if statement to set conditions but the details are still inserted even when the conditions are not met. I have tried using exit sub but its giving the same result.
Here is the code.

If days <= 1 Then
            Label3.Visible = True
            lvconn.Close()
            Exit Sub
        ElseIf days >= 30 Then
            Label4.Visible = True
            lvconn.Close()
            Exit Sub
        Else
            Response.Redirect("Leave_details.aspx")
        End If

推荐答案

此代码是否在循环中?
如果是这样,您可以使用Exit ForExit Do,它们将分别从for循环和do循环退出.
Is this code in a loop?
If so you could use Exit For or Exit Do which will exit from a for loop and a do loop respectively.


这篇关于详细信息视图控件asp.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆