I've got a header include file that contains the code.
I have another in line code module in the same app where the following redirect code works great, but in this file it won't work. The select statement is working in the other file.
I can't figure out how to test this module because the code is in a code behind file called forum.aspx.vb.
This is the code:
Public Class viewAllRecords : Inherits System.Web.UI.Page
Public myIncludes As New includeFunctions
Protected dotForumDisplay As System.Web.UI.WebControls.DataGrid
Protected messageCenter As System.Web.UI.HtmlControls.HtmlGenericControl
Protected threadLink As System.Web.UI.HtmlControls.HtmlGenericControl
Public pageTitle As String = "BCA Members Area"
Public pageDesc As String = "BCA Bulletin Board"
Public pageKeys As String = "clinic management, software, IT Services"
Sub Page_Load(sender as Object, e as EventArgs)
Dim MyConnection As SqlConnection
Dim strRole as string
if not Page.IsPostBack then
Dim strConn as string = "server=(local);database=BCA;Trusted_Connection=yes"
Dim sql as string = "SELECT Role FROM Users WHERE (UserName = '" + Session("Username") +"')"
Dim conn as New SQLConnection(strConn)
Dim Cmd as New SQLCommand(sql, conn)
Dim objDR as SQLDataReader
if not Page.IsPostBack And strRole="Admin" then
Why isn't it redirecting?