Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

redirecting after login

Status
Not open for further replies.

ArmenD

Programmer
Feb 3, 2005
101
US
hi all,
regarding form that authenticates logging in ppl.
so the current function loads "Default.html" but I would like it to load "authok.html".
not quite sure where i should make modifications to.


*************************
Sub Page_Load
Dim strLinkPath As String

If Not IsPostBack Then
strLinkPath = String.Format( "Register.aspx?ReturnUrl={0}", _
Request.Params( "ReturnUrl" ) )
lnkRegister.NavigateUrl = String.Format( strLinkPath )
End If
End Sub
*************************
 
so the current function loads "Default.html"
There is no mention of that page in your function. The only page mentioned is Register.aspx.

Please provide a clearer explanation.

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
how can i redirect users to say "okauth.aspx" after they log in?

I just don't know how to override going to default.aspx?

Code:
<%@ Page Language="VB" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>

<Script Runat="Server">

Sub Page_Load
  Dim strLinkPath As String

  If Not IsPostBack Then
    strLinkPath = String.Format( "Register.aspx?ReturnUrl={0}", _
      Request.Params( "ReturnUrl" ) )
    lnkRegister.NavigateUrl = String.Format( strLinkPath )
  End If
End Sub

Sub Button_Click( s As Object, e As EventArgs )
  If IsValid Then
    If DBAuthenticate( txtUsername.Text, txtPassword.Text ) > 0 Then
      FormsAuthentication.RedirectFromLoginPage( "ReturnUrl", False )
    End If
  End If
End Sub

****Dbauthenticate here, works fine so skip this line

</Script>

<html>
<head><title>Login.aspx</title></head>
<body>
<form Runat="Server">

<h2>Please Login:</h2>

<asp:Label
  ID="lblMessage"
  ForeColor="Red"
  Font-Bold="True"
  Runat="Server" />
<p>
<b>Username:</b>
<br>
<asp:TextBox
  ID="txtUsername"
  Runat="Server" />
<asp:RequiredFieldValidator
  ControlToValidate="txtUsername"
  Text="Required!"
  Runat="Server" />
<p>
<b>Password:</b>
<br>
<asp:TextBox
  ID="txtPassword"
  Runat="Server" />
<asp:RequiredFieldValidator
  ControlToValidate="txtPassword"
  Text="Required!"
  Runat="Server" />
<p>
<asp:Button
  Text="Login!"
  OnClick="Button_Click"
  Runat="Server" />
<hr>
<asp:HyperLink
  ID="lnkRegister"
  Text="Click Here To Register!"
  Runat="Server" />

</form>
</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top