Posted on: 6/8/2013 8:02:29 PM | Views : 387

I am part way through this website (asp.net)'s series on roles, and here is one thing I want to do with roles.  Suppose on my website I have a gridview listing movies.  Different roles have access to different movies.  Some users can be members of more than one role.
So I thought I could do the following:  In the page_load event, find out who the user is, then make an array of strings where each string is a role that he is a member of.  I assume that before this code is reached,  I've stored in a database the role that each movie is associated with.
Now lets suppose a user is a member of 3 roles.  That means an array of 3 strings.  I could store these in a session variable, and then have a sqldatasource with a "sessionparameter" of that array.  But then I get stuck.  I can't think of a way to combine a sql statement with an array of 3 strings, or even a long string that has the role names separated b ...

Go to the complete details ...