Re: forms based authentication

From: buran (buran@buran.com)
Date: 04/18/03


From: "buran" <buran@buran.com>
Date: Fri, 18 Apr 2003 15:20:51 +0300


Following code solved the tissue. Thanks :)

Private Sub btnValidate_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnValidate.Click

Dim redirectUrl As String

redirectUrl = FormsAuthentication.GetRedirectUrl(txtUserName.Text, False)

If redirectUrl = "http://localhost/Calisma3/default.aspx" Then

Response.Redirect("http://localhost/Calisma3/login.aspx")

Else

FormsAuthentication.RedirectFromLoginPage(txtUserName.Text, False)

End If

End Sub

"buran" <buran@buran.com> wrote in message
news:Owsx6rXBDHA.1016@TK2MSFTNGP12.phx.gbl...
> Hi there,
> I am using forms based authentication and everything works fine except
> something I cannot resolve. If I call a page in my application without
being
> logged in, the application sends me to the login page, that's what it
should
> do. After logging in, I can view the page. But, if I call the login page
> directly, and enter correct credentials, it will look for default.aspx
page
> which is not available. How can I avoid that? Thanks in advance.
>
> Private Sub btnValidate_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles btnValidate.Click
>
> If ValidateUser(txtUserName.Text, txtPassword.Text) Then
>
> FormsAuthentication.RedirectFromLoginPage(txtUserName.Text,
> False)
>
> End If
>
> End Sub
>
>



Relevant Pages

  • Re: Automate data from Web to Excel.
    ... I was using the below one for login ... Dim MyPass As String, MyLogin As String, myac As String ... Sub SetRefs() ...
    (microsoft.public.excel.programming)
  • RE: Login help
    ... the user login name from the system all i want is to record them using the ... Private Sub Command2_Click ... Dim strUIdCheck As Variant ... Dim strErrorMessage As String ...
    (microsoft.public.access.devtoolkits)
  • RE: Login help
    ... the user login name from the system all i want is to record them using the ... Private Sub Command2_Click ... Dim strUIdCheck As Variant ... Dim strErrorMessage As String ...
    (microsoft.public.access.devtoolkits)
  • Re: Forms Authentication Problem...
    ... Patrick:) ... >> Can someone please tell me why I keep being redirected back to the login ... >> End Sub ... >> String) As Boolean ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Not getting all data from Stored Procedure.
    ... > Sub moveQAToSql(ByVal fileName As String) ... >> Dim ConnectionString as String ... >> Dim Login as String ...
    (microsoft.public.dotnet.framework.aspnet)