I use the following login controls. Problem is if user logs in correctly it automatically redirects to default.aspx. I just want it to stay on the login page. Any ideas?
code:
<form id="form1" runat="server">
<h1>Log in to Management</h1>
<p>
<asp:LoginView ID="LoginView1" runat="server">
<AnonymousTemplate>
<asp:Login ID="Login1" runat="server"
CreateUserText="Sign Up for a New Account" CreateUserUrl="SignUp.aspx">
</asp:Login>
</AnonymousTemplate>
<LoggedInTemplate>
You are already logged in!
</LoggedInTemplate>
</asp:LoginView>
</p>
<p>
<asp:LoginStatus ID="LoginStatus1" runat="server" />
</p>
</form>
On the web.config file change the defaulturl property to login.aspx if you want it to redirect to that page. I assume login.aspx is your login page.
MSDN links:
http://msdn.microsoft.com/en-us/library/ka5ffkce.aspx
http://msdn.microsoft.com/en-us/library/system.web.security.formsauthentication.defaulturl.aspx