473,395 Members | 1,403 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Altering RedirectFromLoginPage redirction page

Hi

I have an app that requires the following scenarios:

- A registererd user can login via a login page. This will redirect them
to Default.aspx via the use of FromsAuthentication.RedirectFromLoginPage
- A new user can register and on completion, will automatically get
logged in and then get redirected to a different page.

I can't implement the second scenario using RedirectFromLoginPage as it
insists on going to default.aspx. However, on completion of registration, it
would be very nice to autatically log the user in and then redirect them to
this other page.

Is there any way of doing this with ASP.NET?

Ben
Nov 19 '05 #1
3 1066
Why dont you add the functionality to the same page ie (Login or Register),
you could optionally have a new form pop up to take the details and return
them to the login form. One successfull registration is complete, the fields
for username and password could be automatically filled in ready for login.

--
Best Regards

The Inimitable Mr Newbie º¿º

"Ben Fidge" <be*******@nospambtopenworld.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Hi

I have an app that requires the following scenarios:

- A registererd user can login via a login page. This will redirect
them to Default.aspx via the use of
FromsAuthentication.RedirectFromLoginPage
- A new user can register and on completion, will automatically get
logged in and then get redirected to a different page.

I can't implement the second scenario using RedirectFromLoginPage as it
insists on going to default.aspx. However, on completion of registration,
it would be very nice to autatically log the user in and then redirect
them to this other page.

Is there any way of doing this with ASP.NET?

Ben

Nov 19 '05 #2
I actually solved it using the following in the Confirm button OnClick:

FormsAuthenticationTicket oTicket = new FormsAuthenticationTicket(
1,
sUserName
DateTime.Now,
DateTime.Now.AddMinutes(20),
false,
"",
FormsAuthentication.FormsCookiePath);

// Encrypt the ticket.
string oEncTicket = FormsAuthentication.Encrypt(oTicket);

// Create the cookie.
Response.Cookies.Add(new
HttpCookie(FormsAuthentication.FormsCookieName, oEncTicket));

Response.Redirect("UserRegistered.aspx");
"Mr Newbie" <he**@now.com> wrote in message
news:un**************@TK2MSFTNGP10.phx.gbl...
Why dont you add the functionality to the same page ie (Login or
Register), you could optionally have a new form pop up to take the details
and return them to the login form. One successfull registration is
complete, the fields for username and password could be automatically
filled in ready for login.

--
Best Regards

The Inimitable Mr Newbie º¿º

"Ben Fidge" <be*******@nospambtopenworld.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Hi

I have an app that requires the following scenarios:

- A registererd user can login via a login page. This will redirect
them to Default.aspx via the use of
FromsAuthentication.RedirectFromLoginPage
- A new user can register and on completion, will automatically get
logged in and then get redirected to a different page.

I can't implement the second scenario using RedirectFromLoginPage as it
insists on going to default.aspx. However, on completion of registration,
it would be very nice to autatically log the user in and then redirect
them to this other page.

Is there any way of doing this with ASP.NET?

Ben


Nov 19 '05 #3
Okely Dokely !

--
Best Regards

The Inimitable Mr Newbie º¿º

"Ben Fidge" <be*******@nospambtopenworld.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
I actually solved it using the following in the Confirm button OnClick:

FormsAuthenticationTicket oTicket = new FormsAuthenticationTicket(
1,
sUserName
DateTime.Now,
DateTime.Now.AddMinutes(20),
false,
"",
FormsAuthentication.FormsCookiePath);

// Encrypt the ticket.
string oEncTicket = FormsAuthentication.Encrypt(oTicket);

// Create the cookie.
Response.Cookies.Add(new
HttpCookie(FormsAuthentication.FormsCookieName, oEncTicket));

Response.Redirect("UserRegistered.aspx");
"Mr Newbie" <he**@now.com> wrote in message
news:un**************@TK2MSFTNGP10.phx.gbl...
Why dont you add the functionality to the same page ie (Login or
Register), you could optionally have a new form pop up to take the
details and return them to the login form. One successfull registration
is complete, the fields for username and password could be automatically
filled in ready for login.

--
Best Regards

The Inimitable Mr Newbie º¿º

"Ben Fidge" <be*******@nospambtopenworld.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Hi

I have an app that requires the following scenarios:

- A registererd user can login via a login page. This will redirect
them to Default.aspx via the use of
FromsAuthentication.RedirectFromLoginPage
- A new user can register and on completion, will automatically get
logged in and then get redirected to a different page.

I can't implement the second scenario using RedirectFromLoginPage as it
insists on going to default.aspx. However, on completion of
registration, it would be very nice to autatically log the user in and
then redirect them to this other page.

Is there any way of doing this with ASP.NET?

Ben



Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Rob O'Cop | last post by:
Hi, I've got an Intranet site that's been using the usual Forms authentication. Now, I want to retrieve the Windows Login and authenticate the user automatically without her typing...
0
by: Andres Romero | last post by:
I have a login web form named login.aspx, wich validates user from a database. I configure the Web.config file to it authenticates using Form mode, and when the user try acces other page than...
3
by: Shawn | last post by:
Hi. I'm using RedirectFromLoginPage to redirect the user if the login was successful. The problem is that I don't want the user to be redirected to the page he requested. I want him to be...
2
by: Ben Fidge | last post by:
Is FormsAuthentication.RedirectFromLoginPage the only way to populate the HttpContext.Current.User.Identity.Name property? A base class for each page contains the follwoing property: public...
2
by: Rob O'Cop | last post by:
Hi, I've got an Intranet site that's been using the usual Forms authentication. Now, I want to retrieve the Windows Login and authenticate the user automatically without her typing...
2
by: tshad | last post by:
I have a logon page that is may be called by the Forms Authentication setup. This would put a ReturnURL as part of the URL. I would normally then just issue a: ...
8
by: Edward Mitchell | last post by:
I have a main project that is protected in that the user is directed to a login.aspx file. The text in the web.config file is: <authentication mode="Forms"> <forms loginUrl="Login.aspx" />...
9
by: Sandy | last post by:
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...
1
by: Jeremy Chapman | last post by:
I have built a web app. While testing I have found that if I browse to a page in the app, then get redirected to the login page and enter my credentials. The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.