Click here to Skip to main content
15,895,667 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Experts,
Below this code I am successfully login with the login user name: I need aaa.aspx. How to get the aaa.aspx page after login.
thanks in advance.

ASP.NET
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <h1 title="Membership Demonstration">Welcome</h1>
        <br />
        <br />
        <div>
            <asp:LoginStatus ID="LoginStatus1" Runat="server" LogoutText="Log Out"  />
            <br />
        </div>
        <div>
            <asp:LoginView ID="LoginView1" Runat="server" >
                <loggedintemplate>
            <asp:LoginName ID="LoginName1" Runat="server" FormatString="Logged in as {0}"  /> <br />
                    <asp:HyperLink ID="HyperLink2" Runat="server" NavigateUrl="~/User/ChangePassword.aspx">
                    <br />
                      
                </loggedintemplate>
                <anonymoustemplate>
                    <asp:HyperLink ID="HyperLink1" Runat="server" NavigateUrl="~/UnSecured/RecoverPassword.aspx">Forgot Your Password? <br />
                </anonymoustemplate>
            
            <br />
            <br />
            
        </div>
    </form>
</body>
</html>
Posted
Updated 26-Apr-12 2:37am
v3

current url:- Request.Url.ToString();
 
Share this answer
 
Hi,

You can use DestinationPageUrl property of Login control
XML
<asp:Login id="Login1" runat="server"
    DestinationPageUrl="aaa.aspx">
</asp:Login>


Reference:http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.login.destinationpageurl.aspx[^]
 
Share this answer
 
do you want to get current url or previous url?
 
Share this answer
 
Comments
Dhanamanikandan 26-Apr-12 8:27am    
Pls have ur question in 'Have a Question or Comment' tag.. You should not ask question on Solution tag.. Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900