login控件怎样取username
接手别人做过的一个程序,看他login是用vs自带控件的。只有前台代码:
<%@ Page Language="C#" MasterPageFile="~/Master.master" AutoEventWireup="true" CodeFile="login.aspx.cs" Inherits="login" Title="Wind Hover Login" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:Login ID="Login1" runat="server" DestinationPageUrl ="~/search/Default.aspx"
FailureText="Your login attempt was not successful, please try again!">
<LayoutTemplate>
<table width="350" cellpadding="1" cellspacing="0" style="height:200px; border-right: inactivecaption 1px ridge; border-top: inactivecaption 1px ridge; border-left: inactivecaption 1px ridge; border-bottom: inactivecaption 1px ridge;">
<tr>
<td class="titletextstyle">
<span><strong>LOGIN</strong></span></td>
</tr>
<tr>
<td style="height: 50px" >
<asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName" >UserName:</asp:Label>
<asp:TextBox ID="UserName" runat="server" Height="20px" Width="125px"></asp:TextBox>
<asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
ErrorMessage="User name is required." ToolTip="User name is required." ValidationGroup="ctl00$Login1">*</asp:RequiredFieldValidator></td>
</tr>
<tr>
<td>
<asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password" > Password:</asp:Label>
<asp:TextBox ID="Password" runat="server" TextMode="Password" Height="20px" Width="125px"></asp:TextBox>
<asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
ErrorMessage="Password is required." ValidationGroup="ctl00$Login1">*</asp:RequiredFieldValidator></td>
</tr>
<tr>
<td colspan="2" style="height: 20px"></td>
</tr>
<tr>
<td style="color: red">
<asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal>
</td>
</tr>
<tr>
<td colspan="2">
<asp:Button ID="LoginButton" runat="server" CommandName="Login"
Text="Login" ValidationGroup="ctl00$Login1" Width="96px" />
</td>
</tr>
</table>
</LayoutTemplate>
</asp:Login>
</asp:Content>
我想把谁谁登陆的信息,传递到后面的页面,请问怎么写?我想用DestinationPageUrl=="~/search/Default.aspx?Username=....."
请教高手,还有什么其他办法么?