I created a simple persmissions event that checks if someone was added to a a permissions database.
Whiel if gives them a response.write you do not have persmissions to view this page. i want to add on to it to show this message and then redirect them to another page. Follwoing is my code for page load and then the main code from my common file.
If checkAdmin() = False Then
Response.Write("You do not have permission to view this page!")
Common file code tha is called.
Public Shared Function checkAdmin() As Boolean
Dim userLogon = Split(Current.User.Identity.Name, "\")(1)
sql = "select intAdminID from tblAdmin where intAdminID = (select intID from WORSDotNet.dbo.tblUser " _
& "where strLogon = '" & userLogon & "')"
myDataTable = New DataTable
myDataTable = getData(sql)
If myDataTable.Rows.Count = 0 Then
checkAdmin = False
checkAdmin = True