Re: Help!! RedirectFromLoginPage and GetRedirectUrl
- From: "Sandy" <Sandy@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 25 May 2005 20:18:02 -0700
Thanks so much for your response.
The problem is not getting to the login page. It is the redirecting back to
the original page they came from.
The RedirectFromLoginPage and GetRedirectUrl are supposed to, as a fellow
programmer put it, "automagically" redirect back to the page that took them
to the login page. As I understand it, from all the reading I've done, both
in books and on the Internet, he is entirely correct . . . however, for some
reason my machine seems to have a mind of its own and is not responding
correctly. (Of course, I blame it on my box, but we both know who's the
smarter of the two . . .guess I'm doing something dumb - I haven't found an
instance where anyone has had a problem with this.)
Can you give me another clue?
Again, thanks so much for your response! This is sooooo frustrating!
--
Sandy
"TJS" wrote:
> try this
>
>
> If User.Identity.IsAuthenticated Then
> [do whatever here]
> Else
> response.redirect("~/login.aspx")
> End If
>
>
>
>
> "Sandy" <Sandy@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:C6FFCFB1-75EF-4BD0-8246-8E95BC550B68@xxxxxxxxxxxxxxxx
> > Any help anyone can give me will be appreciated!!!! This is driving me
> > c-r-a-z-y!
> >
> > All I can get from both of the above redirections is a redirect to a page
> > named default.aspx. How do I make either of these work? I have an app
> > that
> > has two pages that need a login. I need to be able to have it
> > automatically
> > return to whichever page the user came from.
> >
> > I've tried both of the following (not together, of course):
> > [Button Submit has code to check database]
> > FormsAuthentication.RedirectFromLoginPage(txtUserName.Text, False)
> >
> > [Button Submit has code to check database]
> > Response.Redirect(FormsAuthentication.GetRedirectUrl(txtUserName.Text,
> > False))
> >
> > My Web Config has this in it:
> >
> > <authentication mode="Forms" >
> > <forms name=".LoginCookie" loginUrl="Login.aspx"
> > protection="All" timeout="40" path="/" />
> > </authentication>
> > (Although I would rather not rely on cookies since people can turn them
> > off,
> > but I got this from an example in a book and couldn't find an example of
> > how
> > to do it without cookies.)
> >
> > I made sure in IIS the app was an app.
> >
> > I originally had one of the pages in a separate folder. I thought maybe
> > that had something to do with it, so I cut and pasted it to the first
> > level.
> > That did nothing.
> >
> > Again, any suggestions will be greatly appreciated!
> > --
> > Sandy
>
>
>
.
- Follow-Ups:
- References:
- Prev by Date: Image thing question
- Next by Date: RE: WebClient.DownloadFile only see's Local????
- Previous by thread: Re: Help!! RedirectFromLoginPage and GetRedirectUrl
- Next by thread: Re: Help!! RedirectFromLoginPage and GetRedirectUrl
- Index(es):