如何使用date获取full_Name到我的所有页面 [英] How to get the full_Name to all my pages with date

查看:85
本文介绍了如何使用date获取full_Name到我的所有页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站。在那几个网页上有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>



<% - - %>



style =width:100%>

< td width =20%> 
< ; fieldset id =fsLoginrunat =serverclass =fieldsetalign =right

atomicselection =True>

登录



style =身高:148px; width:148pxbgcolor =White>

< tr>
Fspl用户登录
名称

< asp:TextBox ID =txtUNamerunat =serverHeight =10px 宽度=150pxCssClass =txtbox>

密码

< asp:TextBox ID = txtPwdrunat =serverTextMode =PasswordCssClass =txtbox

Width =150px>

< asp:Label ID =lblmessagerunat =serverText =Font-Bold =true>

< asp:CheckBox ID =chkPersistrunat =serverFont-Size =6ptVisible =FalseWidth =62px/>

<% - < asp:按钮ID =btnLoginrunat =serverText =LoginOnClick = btnLogin_ClickCssClass =txtBtn/> - %>

< asp:ImageButton ID =imgbtnLoginrunat =serverImageUrl =〜/ images / button_login.gif

OnClick =btnLogin_ClickCssClass =txtBtn/>





 

 
 
 


< asp:图片ID =Image1runat =serverImageUrl =〜/ images / Computer-Support.png高度=200px

宽度=350px/>





< 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" >

<%-- --%>

style="width: 100%">
<fieldset id="fsLogin" runat="server" class="fieldset" align="right"
atomicselection="True">
Login

style="height: 148px; width: 148px" bgcolor="White">
Fspl User Login
Name
<asp:TextBox ID="txtUName" runat="server" Height="10px" Width="150px" CssClass="txtbox" >
Password
<asp:TextBox ID="txtPwd" runat="server" TextMode="Password" CssClass="txtbox"
Width="150px">
<asp:Label ID="lblmessage" runat="server" Text="" Font-Bold="true">
<asp:CheckBox ID="chkPersist" runat="server" Font-Size="6pt" Visible="False" Width="62px" />
<%--<asp:Button ID="btnLogin" runat="server" Text="Login" OnClick="btnLogin_Click" CssClass="txtBtn" />--%>
<asp:ImageButton ID="imgbtnLogin" runat="server" ImageUrl="~/images/button_login.gif"
OnClick="btnLogin_Click" CssClass="txtBtn" />


 
 
 
 
 

<asp:Image ID="Image1" runat="server" ImageUrl="~/images/Computer-Support.png" Height="200px"
Width="350px" />


<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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆