User Login session variable filtered

前端 未结 3 2093
感情败类
感情败类 2021-01-28 04:47

I am trying to compare a session variable to another string so that i can enable or disable image buttons. I am using asp.net vb with a sql2005 express backend

P         


        
3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-28 05:14

    this is works!

        ImageButton1.Enabled = Not Session("UserName") Is Nothing AndAlso Session("UserName").ToString.ToLower.Trim.Equals("username")
    

    ImageButton2.Enabled = Not Session("UserName") Is Nothing AndAlso_ Session("UserName").ToString.ToLower.Trim.Equals("username")

提交回复
热议问题