如何使用date获取full_Name到我的所有页面 [英] How to get the full_Name to all my pages with date
问题描述
我有一个网站。在那几个网页上有Master Page。我有一个数据库,如Login.which有用户ID用户名全名角色电子邮件列在那里。所有用户都经过了广告认证。当用户登录如何在所有带有日期和时间的页面中显示其全名。我是asp .net.kindly中的新用户解决它。我没有使用登录控件。
我的代码是
<%@ Page Language =C#AutoEventWireup =trueCodeFile =Login.aspx.cs Inherits =登录%>
<!DOCTYPE html PUBLIC - // W3C // DTD XHTML 1.0 Transitional // ENhttp:/ /www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
< html xmlns =http://www.w3.org/1999/xhtml> ;
< head runat =server>
< title> AMC登录< / title>
< link rel = stylesheethref =CSS / Styles.csstype =text / css/>
< style type =text / css>
.style1
{
宽度:100%;
身高:30px;
}
.style2
{
font-family:verdana;
font-size:7.5pt;
颜色:#000000;
font-family:Verdana;
font-weight:700; < br $> b $ b
}
.style3
{
background-repeat:no-repeat ;
}
< / style>
< / head>
< body>
< form id =form1runat =server>
< asp:Image ID =imgLogo runat =serverImageUrl =images / logo.pngWidth =235Height =50/> | < asp:Label ID =lblHeadingrunat =serverText =Hardware ManagementCssClass =txtspanHead 字体大小=X-Large> ; | ||||||||||||||
< asp:Image ID =imgHeaderruna t =serverImageUrl =〜/ images / footer.jpgHeight =35px Width =1000pxForeColor =#FF9900GenerateEmptyAlternateText =True/> | |||||||||||||||
欢迎使用FSPL_AMC | |||||||||||||||
removed =hands.png> <% - - %>
| |||||||||||||||
< asp:Image ID =imgFooterrunat =serverImageUrl =〜/ images / header.jpgHeight =18px ImageAlign =LeftWidth =1000px/> |
< / form>
< / body>
< / html>
I have an Website. In that Several Webpages are there with Master Page. I have a database as Login.which has user id user name full name role Email columns are there. All users are Ad authenticated. When a user logon how its full Name will display in all the pages with date and time.i am new in asp .net.kindly solve it. I have not used the login control.
My code is
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" %>
<!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 runat="server">
<title>AMC Login</title>
<link rel="stylesheet" href="CSS/Styles.css" type="text/css" />
<style type="text/css">
.style1
{
width: 100%;
height: 30px;
}
.style2
{
font-family: verdana;
font-size: 7.5pt;
color: #000000;
font-family: Verdana;
font-weight: 700;
}
.style3
{
background-repeat:no-repeat;
}
</style>
</head>
<body >
<form id="form1" runat="server">
<asp:Image ID="imgLogo" runat="server" ImageUrl="images/logo.png" Width="235" Height="50" /> | <asp:Label ID="lblHeading" runat="server" Text="Hardware Management" CssClass="txtspanHead" Font-Size="X-Large"> | |||||||||||||||||||
<asp:Image ID="imgHeader" runat="server" ImageUrl="~/images/footer.jpg" Height="35px" Width="1000px" ForeColor="#FF9900" GenerateEmptyAlternateText="True" /> | ||||||||||||||||||||
Welcome to FSPL_AMC | ||||||||||||||||||||
removed="hands.png" > <%-- --%>
| ||||||||||||||||||||
<asp:Image ID="imgFooter" runat="server" ImageUrl="~/images/header.jpg" Height="18px" ImageAlign="Left" Width="1000px" /> |
</form>
</body>
</html>
推荐答案
您可以获取当前登录的用户就像这样。
string user = User.identity.Name;
Label1.Text = user;
或
user = System .Web.Security.Membership.GetUser()。用户名;
我可以创建一个userprofile / membership类的实例并获取属性。
you can get the user currently logged on like so.
string user = User.identity.Name;
Label1.Text = user;
or
user= System.Web.Security.Membership.GetUser().Username;
alternatevely you can create an instance of userprofile/membership class and get properties.
这篇关于如何使用date获取full_Name到我的所有页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!