Leon,
..Net handles that for you. It sends the user to the original page they were
trying to go to when they were redirected to the login page.
Sincerely,
--
S. Justin Gengo, MCP
Web Developer
Free code library at:
www.aboutfortunate.com
"Out of chaos comes order."
Nietzche
"Leon Shaw" <vnality@msn.com> wrote in message
news:eUaCg32WDHA.2328@TK2MSFTNGP12.phx.gbl...[color=blue]
> but what if you wanted to send the user back to a specified pade(not
> RedirectFromLoginPage) which is the default.aspx?
> "S. Justin Gengo" <sjgengo@aboutfortunate.com> wrote in message
> news:%234C4JU2WDHA.216@TK2MSFTNGP11.phx.gbl...[color=green]
> > Leon,
> >
> > Here's how I'm doing it:
> >
> > '---My login page code
> > Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As
> > System.EventArgs) Handles btnLogin.Click
> > Try
> > Dim FormsAuth As New FormsAuthentication
> > If FormsAuth.Authenticate(txtbxUsername.Text.ToString ,
> > txtbxPassword.Text.ToString) Then
> > FormsAuth.RedirectFromLoginPage(txtbxUsername.Text .ToString,
> > True)End If
> > Catch ex As Excepion
> > '---Handle errors
> > End Try
> > End Sub
> >
> > --
> > S. Justin Gengo, MCP
> > Web Developer
> >
> > Free code library at:
> >
www.aboutfortunate.com
> >
> > "Out of chaos comes order."
> > Nietzche
> > "Leon Shaw" <vnality@msn.com> wrote in message
> > news:u1TXQE2WDHA.2392@TK2MSFTNGP10.phx.gbl...[color=darkred]
> > > so how do send use to a protect page in the application. Is this[/color][/color]
> correct?[color=green][color=darkred]
> > > If Me.IsValid Then
> > >
> > > If Me.myAuthorization(Me.txtUsername.Text.ToLower,
> > > Me.txtPassword.Text.ToLower) > 0 Then
> > >
> > >[/color]
> >[/color]
>[/color]
System.Web.Security.FormsAuthentication.RedirectFr omLoginPage(Me.txtUsername[color=blue][color=green][color=darkred]
> > > .Text, True)
> > >
> > > Me.Response.Redirect("../ulogin/default.aspx")
> > >
> > > End If
> > >
> > > End If
> > >
> > > "S. Justin Gengo" <sjgengo@aboutfortunate.com> wrote in message
> > > news:uhttIx1WDHA.2476@tk2msftngp13.phx.gbl...
> > > > Leon,
> > > >
> > > > If you want instead of adding a separate web.config file to your[/color][/color]
> folder[color=green][color=darkred]
> > > you
> > > > can actually use the main web.config file to protect a folder within[/color][/color]
> the[color=green][color=darkred]
> > > web
> > > > site.
> > > >
> > > > I have an example on how to do this on my website:[/color]
> >
www.aboutfortunate.com.[color=darkred]
> > > > Just search the code library for: "protect a folder with forms
> > > > authentication"
> > > >
> > > > I also have a link to an article about how to use a database with[/color][/color]
> forms[color=green][color=darkred]
> > > > authentication in the library (I just added the link when I saw it[/color]
> > posted[color=darkred]
> > > > here).
> > > >
> > > > Good luck!
> > > >
> > > > --
> > > > S. Justin Gengo, MCP
> > > > Web Developer
> > > >
> > > > Free code library at:
> > > >
www.aboutfortunate.com
> > > >
> > > > "Out of chaos comes order."
> > > > Nietzche
> > > >
> > > >
> > > > "Leon Shaw" <vnality@msn.com> wrote in message
> > > > news:eoo3Qs1WDHA.1268@TK2MSFTNGP11.phx.gbl...
> > > > > ok so if I added a folder named ulogin to my application in which[/color][/color]
> all[color=green]
> > my[color=darkred]
> > > > > protected webpage and web.config file is located then ulogin[/color][/color][/color]
folder[color=blue][color=green][color=darkred]
> > > itself
> > > > > must be a web application. So how do I add an application[/color][/color][/color]
(instead[color=blue]
> of[color=green]
> > a[color=darkred]
> > > > > folder) to my main web application inside of VS.net IDE, so I can
> > > password
> > > > > protect certain pages?
> > > > >
> > > > > "S. Justin Gengo" <sjgengo@aboutfortunate.com> wrote in message
> > > > > news:%23tzbdc1WDHA.652@TK2MSFTNGP10.phx.gbl...
> > > > > > Leon,
> > > > > >
> > > > > > It looks like the folder your .net files are in is not[/color][/color][/color]
configured[color=blue]
> as[color=green]
> > a[color=darkred]
> > > > web
> > > > > > application on the server.
> > > > > >
> > > > > > On the server go to:
> > > > > >
> > > > > > Administrative Tools - Internet Information Services
> > > > > >
> > > > > > Expand the computer node, expand the web sites node, and find[/color][/color][/color]
your[color=blue][color=green]
> > web[color=darkred]
> > > > > site
> > > > > > in the list (It may be within the "Default Web Site" node[/color][/color]
> depending[color=green]
> > on[color=darkred]
> > > > how
> > > > > > your machine is set up.) If the web site's icon is a folder it[/color][/color][/color]
is[color=blue][color=green]
> > not[color=darkred]
> > > > > > configured as a web site.
> > > > > >
> > > > > > To configure it as a web site, right click on it and choose
> > > properties.
> > > > > > Click the create button and then everything should be fine.
> > > > > >
> > > > > > If you have added a web.config file to a folder within your main
> > > website
> > > > > > then that folder needs to be a website itself in order for[/color]
> > web.config[color=darkred]
> > > to
> > > > > > function properly.
> > > > > >
> > > > > > I hope this helps.
> > > > > >
> > > > > > --
> > > > > > S. Justin Gengo, MCP
> > > > > > Web Developer
> > > > > >
> > > > > > Free code library at:
> > > > > >
www.aboutfortunate.com
> > > > > >
> > > > > > "Out of chaos comes order."
> > > > > > Nietzche
> > > > > > "Leon Shaw" <vnality@msn.com> wrote in message
> > > > > > news:ermU4T1WDHA.1900@TK2MSFTNGP10.phx.gbl...
> > > > > > > Someone please help me understand the following error message:
> > > > > > >
> > > > > > > Server Error in '/solo' Application.
> > > > > >
> > > > >
> > > >
> > >[/color]
> >[/color]
>
> --------------------------------------------------------------------------[color=green][color=darkred]
> > > > > > --
> > > > > > > ----
> > > > > > >
> > > > > > > Configuration Error
> > > > > > > Description: An error occurred during the processing of a
> > > > configuration
> > > > > > file
> > > > > > > required to service this request. Please review the specific[/color][/color]
> error[color=green][color=darkred]
> > > > > details
> > > > > > > below and modify your configuration file appropriately.
> > > > > > >
> > > > > > > Parser Error Message: It is an error to use a section[/color][/color][/color]
registered[color=blue][color=green]
> > as[color=darkred]
> > > > > > > allowDefinition='MachineToApplication' beyond application[/color][/color][/color]
level.[color=blue][color=green][color=darkred]
> > > This
> > > > > > error
> > > > > > > can be caused by a virtual directory not being configured as[/color][/color][/color]
an[color=blue][color=green][color=darkred]
> > > > > > application
> > > > > > > in IIS.
> > > > > > >
> > > > > > > Source Error:
> > > > > > >
> > > > > > > Line 23: "Forms", "Passport" and "None"
> > > > > > > Line 24: -->
> > > > > > > Line 25: <authentication mode="Forms" />
> > > > > > > Line 26: <forms name="uloginCookie" loginUrl="login.aspx">
> > > > > > > Line 27:
> > > > > > >
> > > > > > > Source File: c:\inetpub\wwwroot\solo\ulogin\web.config[/color][/color][/color]
Line:[color=blue]
> 25[color=green][color=darkred]
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >[/color]
> >[/color]
>
> --------------------------------------------------------------------------[color=green][color=darkred]
> > > > > > --
> > > > > > > ----
> > > > > > > Version Information: Microsoft .NET Framework[/color]
> > Version:1.1.4322.573;[color=darkred]
> > > > > > ASP.NET
> > > > > > > Version:1.1.4322.573
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]