467,119 Members | 1,204 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,119 developers. It's quick & easy.

How ASP.NET find Login page?

In VS2005, I create a ASP.NET website project.One page named
Default.aspx with LoginView and LoginStatus controls; and one page
named Login.aspx with Login control in it. After setup of users, I
press Ctrl+F5, IE window is popped up, redirect to Login.aspx page ask
me to input username and password. This works fine.

I am wondering, how does ASP.NET know to redirect to Login.aspx from
Default.aspx? I renamed Login.aspx to something else, and it still
works fine.

I add another page named AnotherLogin.aspx with Login Control too.
But, Default.aspx doesn't redirect to AnotherLogin.aspx, but to
original Login.aspx. What's the connection between Default.aspx and
Login.aspx? How to configure it?

Thanks

Apr 21 '07 #1
  • viewed: 1778
Share:
2 Replies
I did some investigation and found that loginurl can be configured in
web.config, like
<system.web>
<authentication mode="forms">
<forms loginUrl="AnotherLogin.aspx"></forms>
</authentication>
</system.web>

However, without this configuration, the loginurl is Login.aspx. I
even tried to rename Login.aspx to ABCLogin.aspx, then loginurl is
ABCLogin.aspx. But, I cannot find any default config in the project's
folder. Or, just guessing, VS2005 make the first created login page as
default?
On Apr 21, 12:47 pm, Morgan Cheng <morgan.chen...@gmail.comwrote:
In VS2005, I create a ASP.NET website project.One page named
Default.aspx with LoginView and LoginStatus controls; and one page
named Login.aspx with Login control in it. After setup of users, I
press Ctrl+F5, IE window is popped up, redirect to Login.aspx page ask
me to input username and password. This works fine.

I am wondering, how does ASP.NET know to redirect to Login.aspx from
Default.aspx? I renamed Login.aspx to something else, and it still
works fine.

I add another page named AnotherLogin.aspx with Login Control too.
But, Default.aspx doesn't redirect to AnotherLogin.aspx, but to
original Login.aspx. What's the connection between Default.aspx and
Login.aspx? How to configure it?

Thanks

Apr 21 '07 #2
If you use the VS tools to help set up login, it will place the config
element for you. It will also watch page name changes and adjust config
accordingly. You can "trick" it and mess things up, if you try reallly hard.
Fortunately, it is a simple matter of manually configuring through the
config file. ;-)

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*********************************************
Think outside the box!
*********************************************
"Morgan Cheng" <mo************@gmail.comwrote in message
news:11**********************@q75g2000hsh.googlegr oups.com...
In VS2005, I create a ASP.NET website project.One page named
Default.aspx with LoginView and LoginStatus controls; and one page
named Login.aspx with Login control in it. After setup of users, I
press Ctrl+F5, IE window is popped up, redirect to Login.aspx page ask
me to input username and password. This works fine.

I am wondering, how does ASP.NET know to redirect to Login.aspx from
Default.aspx? I renamed Login.aspx to something else, and it still
works fine.

I add another page named AnotherLogin.aspx with Login Control too.
But, Default.aspx doesn't redirect to AnotherLogin.aspx, but to
original Login.aspx. What's the connection between Default.aspx and
Login.aspx? How to configure it?

Thanks
Apr 21 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Simon | last post: by
2 posts views Thread by Tom Loach | last post: by
1 post views Thread by Tom Jones | last post: by
11 posts views Thread by David W. Simmonds | last post: by
4 posts views Thread by nicholas | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.