登录后如何获取aaa.aspx页面 [英] How to get the aaa.aspx page after login
问题描述
尊敬的专家,
在此代码下,我使用登录用户名成功登录:我需要aaa.aspx.登录后如何获取aaa.aspx页面.
提前致谢.
<%@ 页面 语言 =" C#" AutoEventWireup true" CodeFile =" 继承 _ Default" %>
< !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 过渡//EN" " http://www.w3. org/TR/xhtml1/DTD/xhtml1-transitional.dtd" < html =" http://www.w3.org/1999/xhtml" >
< 头 =" Head1" runat >服务器" >
< 标题 > < /title >
< /head >
< 正文 >
< 表单 =" form1" runat >服务器" >
< h1 =" 会员资格演示" < >
< br >
< br >
< div >
< asp:LoginStatus ID =" Runat 服务器" LogoutText 退出" >
< br >
< /div >
< div >
< asp:LoginView ID =" Runat 服务器" >
< loggedintemplate >
< asp:LoginName ID =" Runat 服务器" FormatString 登录为{0}" / > << br / >
< asp:HyperLink ID =" Runat 服务器" NavigateUrl 〜/User/ChangePassword.aspx" < br >
< /loggedintemplate >
< anonymoustemplate >
< asp:HyperLink ID =" Runat 服务器" NavigateUrl 〜/UnSecured/RecoverPassword.aspx" < br >
< /anonymoustemplate >
< br >
< br >
< /div >
< /form >
< /body >
< /html >
当前网址:-Request.Url.ToString();
您可以使用Login
control
的DestinationPageUrl
属性< asp:Login id =" ="span> runat =" 服务器" DestinationPageUrl =" aaa.aspx" < /asp:登录 >
参考: http://msdn.microsoft.com/zh-我们/library/system.web.ui.webcontrols.login.destinationpageurl.aspx [<%@ 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>解决方案current url:- Request.Url.ToString();
Hi,
You can useDestinationPageUrl
property ofLogin
control
<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[^]
do you want to get current url or previous url?
这篇关于登录后如何获取aaa.aspx页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!