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
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