problem in user identity

A

asheeshbarua

hi all
i have a problem with this code i m executing this code on
page load this is working fine but when i change the url from browser
then this go to director_home.aspx as default


' If Not Page.IsPostBack Then

Dim strConnection As String =
Convert.ToString(Application("adventure_club_connection_string"))

Dim cn As SqlConnection = New SqlConnection(strConnection)
cn.Open()


'figure out which page to redirect to based on whether or not
it's a director log in
Dim strSelect As String = "SELECT * FROM Employee " & _
" WHERE EmailAddress='" & StrQuoteReplace(User.Identity.Name) &
"' "

Dim cmd As New SqlCommand(strSelect, cn)
Dim dr As SqlDataReader = cmd.ExecuteReader()

Dim redirect_page As String = "index.aspx"
' Dim redirect_page As String
If dr.Read Then
If Convert.ToString(dr("Director")) = "1" Then
redirect_page = "director_home.aspx"

'lse
redirect_page = "index.aspx"

End If
End If

dr.Close()
cmd.Dispose()
cn.Close()
cn.Dispose()

Response.Redirect(redirect_page)








any one solve my problem
thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,797
Messages
2,569,647
Members
45,378
Latest member
danzeev

Latest Threads

Top