User Login session variable filtered

前端 未结 3 2095
感情败类
感情败类 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:10

    String Compare returns 0 if the strings are equal. To evaluate for true change your comparison to = 0 rather than <> 0.

    If String.Compare(string1, string2, StringComparison.InvariantCultureIgnoreCase) = 0 Then
    

    If you envision performing such checks frequently to display different portions of a page you might want to break your pages up based on the different types (or levels) of users you expect and redirect them to a particular page upon login. Depending on how similar the pages are between users you'll likely find using master pages and/or user controls to be beneficial.

提交回复
热议问题