Public Overloads Function Check_GroupMembership(ByVal GroupID As Integer) As Boolean Dim result As Boolean = False If Session("user_groups") = "" Then Reset_Session_Data(Page) If Session("user_groups") <> "" Then If InStr(Session("user_groups"), "~" & GroupID & "~") <> 0 Then result = True End If Return result End Function
public bool Check_GroupMembership(int GroupID) { bool result = false; if (string.IsNullOrEmpty(Session["user_groups"])) Reset_Session_Data(Page); if (!string.IsNullOrEmpty(Session["user_groups"])) { if (String.InStr(Session["user_groups"], "~" + GroupID + "~") != 0) result = true; }
if("" + Session["user_groups"] != "") // if the session value is null then appended to an empty string is an empty string { Reset_Session_Data(Page); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)