I am new to ASP.NET.
I have a function that validates a user. If it succeeds it want to go to a different page. Can I do this in the code behind file? If not what is the best way to take a user to another page based on a condition?
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' If this is a Postback check the credentials against the db
If Page.IsPostBack Then
If funValidateUser() > 0 Then
Consultant.UserName = txtUserName.Text
' Here I want to redirect...
'Response.Redirect("TopicList.aspx"
Else
lblMessage.Text = "The credentials entered where invalid."
End If
End If
End Sub
I have a function that validates a user. If it succeeds it want to go to a different page. Can I do this in the code behind file? If not what is the best way to take a user to another page based on a condition?
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' If this is a Postback check the credentials against the db
If Page.IsPostBack Then
If funValidateUser() > 0 Then
Consultant.UserName = txtUserName.Text
' Here I want to redirect...
'Response.Redirect("TopicList.aspx"
Else
lblMessage.Text = "The credentials entered where invalid."
End If
End If
End Sub