473,395 Members | 1,348 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.

Custom redirectURL

In Forms based authentication mode, say my login page has to be
redirected to "db.aspx" if the login was successful, how do I supply
this redirect without a Response.Redirect() using FormsAuthentication
class?

If I simply say,

If MyDatabaseUserAuthenticationMethod(txtUserName.Tex t,
txtPassword.Text) Then
FormsAuthentication.RedirectFromLoginPage(txtUserN ame.Text, False)
Else
lblMessage.Text = "Please jump into the well and die."
End If

and if the user logs in correctly, then he will, by default, be
redirected automatically to the "default.aspx" page if it exists. If
the page does not exist, he will come back to the login page because no
where in the login page have we specified an equivalant of the
primitive "action" attribute that tells whom to POST the page to, so
the same page will recieve a POSTBACK.

How do I tell ASP.NET that if the forms based authentication is
successful, take this guy to this page, say, "db.aspx"?

Nov 19 '05 #1
7 3011
re:
How do I tell ASP.NET that if the forms based authentication
is successful, take this guy to this page, say, "db.aspx"?
You can't.

What you could do is :

1. set the default page for the application to "db.aspx"

or

2. In "default.aspx", if that's your default page, or in whatever page
you have set the default page to, set a Response.Redirect("db.aspx")

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Water Cooler v2" <wt*****@yahoo.com> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com... In Forms based authentication mode, say my login page has to be
redirected to "db.aspx" if the login was successful, how do I supply
this redirect without a Response.Redirect() using FormsAuthentication
class?

If I simply say,

If MyDatabaseUserAuthenticationMethod(txtUserName.Tex t,
txtPassword.Text) Then
FormsAuthentication.RedirectFromLoginPage(txtUserN ame.Text, False)
Else
lblMessage.Text = "Please jump into the well and die."
End If

and if the user logs in correctly, then he will, by default, be
redirected automatically to the "default.aspx" page if it exists. If
the page does not exist, he will come back to the login page because no
where in the login page have we specified an equivalant of the
primitive "action" attribute that tells whom to POST the page to, so
the same page will recieve a POSTBACK.

How do I tell ASP.NET that if the forms based authentication is
successful, take this guy to this page, say, "db.aspx"?

Nov 19 '05 #2
>2. In "default.aspx", if that's your default page, or in whatever page
you have set the default page to, set a Response.Redirect("db.aspx")

Hmm! this sounds do-able.

What about the first option. I didn't get it. How do you change your
default page to some other name?

Nov 19 '05 #3
Open the IIS Manager; scroll down the left to your application
( opening "Web Sites" and "Default Web Site"); select your App
by clicking it; then right-click your Application and select "Properties";
then click the "Documents" tab, and enter the name of the default
document you want your application to have.

Make sure you have the default documents in
the order you want ASP.NET to process them.

The default documents will be processed in the order they're listed.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Water Cooler v2" <wt*****@yahoo.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
2. In "default.aspx", if that's your default page, or in whatever page

you have set the default page to, set a Response.Redirect("db.aspx")

Hmm! this sounds do-able.

What about the first option. I didn't get it. How do you change your
default page to some other name?

Nov 19 '05 #4
aha! Thanks!

Nov 19 '05 #5
You can redirect to any page you want to. Instead of
FormsAuthentication.RedirectFromLoginPage, use
FormsAuthentication.SetAuthCookie to authenitcate the user, then use
response.redirect to move to whatever page your logic chooses. I use this
for sites because different users have different start pages, but I use the
same link and login page for both.

Good luck!
Curt

"Water Cooler v2" <wt*****@yahoo.com> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...
In Forms based authentication mode, say my login page has to be
redirected to "db.aspx" if the login was successful, how do I supply
this redirect without a Response.Redirect() using FormsAuthentication
class?

If I simply say,

If MyDatabaseUserAuthenticationMethod(txtUserName.Tex t,
txtPassword.Text) Then
FormsAuthentication.RedirectFromLoginPage(txtUserN ame.Text, False)
Else
lblMessage.Text = "Please jump into the well and die."
End If

and if the user logs in correctly, then he will, by default, be
redirected automatically to the "default.aspx" page if it exists. If
the page does not exist, he will come back to the login page because no
where in the login page have we specified an equivalant of the
primitive "action" attribute that tells whom to POST the page to, so
the same page will recieve a POSTBACK.

How do I tell ASP.NET that if the forms based authentication is
successful, take this guy to this page, say, "db.aspx"?

Nov 19 '05 #6
Thanks, Curt. From all the place, all I got was work-arounds to this
question: change your default in IIS console, do a response.redirect in
default.aspx to db.aspx.

I think this answer is the most sensible one because I guess that is
what RedirectFromLoginPage does:

(1) Set authentication cookie
(2) Go to default.aspx

Thanks!

Nov 19 '05 #7
Oh, OK...

You're absolutely right.

However, he did specify that he wanted
to do it *without* a Response.Redirect.
how do I supply this redirect without a Response.Redirect()

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Curt" <cu**@nospam.com> wrote in message
news:Yb****************@newssvr33.news.prodigy.com ... You can redirect to any page you want to. Instead of
FormsAuthentication.RedirectFromLoginPage, use FormsAuthentication.SetAuthCookie to
authenitcate the user, then use response.redirect to move to whatever page your logic
chooses. I use this for sites because different users have different start pages, but I
use the same link and login page for both.

Good luck!
Curt

"Water Cooler v2" <wt*****@yahoo.com> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...
In Forms based authentication mode, say my login page has to be
redirected to "db.aspx" if the login was successful, how do I supply
this redirect without a Response.Redirect() using FormsAuthentication
class?

If I simply say,

If MyDatabaseUserAuthenticationMethod(txtUserName.Tex t,
txtPassword.Text) Then
FormsAuthentication.RedirectFromLoginPage(txtUserN ame.Text, False)
Else
lblMessage.Text = "Please jump into the well and die."
End If

and if the user logs in correctly, then he will, by default, be
redirected automatically to the "default.aspx" page if it exists. If
the page does not exist, he will come back to the login page because no
where in the login page have we specified an equivalant of the
primitive "action" attribute that tells whom to POST the page to, so
the same page will recieve a POSTBACK.

How do I tell ASP.NET that if the forms based authentication is
successful, take this guy to this page, say, "db.aspx"?


Nov 19 '05 #8

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

Similar topics

4
by: jjjooooohhnnn | last post by:
Greetings, I have encountered what appears to be a fairly common problem: RedirectFromLoginPage is not redirecting to RedirectUrl. I have tried all the advice that I could on the 'net, and...
5
by: Graham | last post by:
I have created a custom MembershipProvider called "LassieMembershipProvider" that derives from "MembershipProvider". This providor is located in a Businesslogic layer dll called...
2
by: Suzanne | last post by:
Hi all, I'm reposting this message as I'm experiencing this problem more and more frequently : I really hope someone out there can help me as I've been tearing my hair out on this one for a...
27
by: Wayne | last post by:
I've been clicking around Access 2007 Beta 2 and can't see the custom menu bar designer. Is it in the beta? Maybe I'm blind. The question that comes to mind is: Will custom menu bars be the same...
1
by: Jakob Lithner | last post by:
When I started a new ASP project I was eager to use the login facilities offered in Framework 2.0/VS 2005. I wanted: - A custom principal that could hold my integer UserID from the database -...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
1
by: asharda | last post by:
I have a custom property grid. I am using custom property grid as I do not want the error messages that the propertygrid shows when abphabets are entered in interger fields. The custom property...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.