测试代码

本文介绍了一个使用ASP.NET技术实现的网页布局方案,并详细展示了如何通过代码块进行用户登录状态验证及个性化欢迎信息展示的过程。

 

<form id="Form1" method="post" runat="server"><FONTFONT-SIZE: 12pt; LINE-HEIGHT: 150%;">宋体">
<TABLE id="Table1" cellSpacing="0" cellPadding="0" width="100%" border="0">
<TR><TD style="HEIGHT: 18px" width="5%"></TD>
<TD style="HEIGHT:18px"><uc1:Head id="Head1"runat="server" OnLoad="Head1_Load"></uc1:Head></TD><TD style="HEIGHT: 18px" width="5%"></TD></TR>
<TR><TD style="HEIGHT: 18px" width="5%"></TD><TD style="HEIGHT: 18px">
<asp:Label id="welcome" runat="server" Visible="False"></asp:Label> </TD>
<TD style="HEIGHT: 18px" width="5%"></TD></TR>
<TR><TD style="HEIGHT: 18px" width="5%"></TD>
<TD style="HEIGHT: 18px"><TABLE id="Table2" height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0"><TR><TD vAlign="top" width="20%">
<TABLE id="Table4" cellSpacing="0" cellPadding="0" width="100%" border="0"><TR><TD><uc1:Navigator id="Navigator1"runat="server"OnLoad="Navigator1_Load"></uc1:Navigator></TD></TR><TR><TD width="20%"></TD></TR></TABLE></TD><TD vAlign="top" align="center" colSpan="2"><TABLE id="Table3" cellSpacing="0" cellPadding="0" width="100%" border="0"><TR><TD>
<uc1:Search id="Search1" runat="server"></uc1:Search></TD></TR><TR><TD>
<TABLE id="Table5" cellSpacing="0" cellPadding="0" width="100%" border="0"><TR><TD style="HEIGHT: 16px" colSpan="2"><uc1:Popular id="Popular1" runat="server" OnLoad="Popular1_Load"></uc1:Popular></TD></TR></TABLE></TD></TR></TABLE></TD></TR></TABLE></TD><TD style="HEIGHT: 18px" width="5%"></TD></TR>
<TR><TD></TD><TD><uc1:Foot id="Foot1" runat="server"></uc1:Foot></TD>
<TD></TD></TR></TABLE></FONT></form>
// 在此处放置用户代码以初始化页面
//获取当前ASP.NET请求的HttpContext
System.Web.HttpContext thecontext = System.Web.HttpContext.Current;
if(thecontext.User.Identity.Name != "")
{    
welcome.Visible=true;
        if (thecontext.Request.Cookies["Store_UserName"]!= null)
       {
       welcome.Text=thecontext.Request.Cookies["Store_UserName"].Value + "  欢迎您的光临!";                               
              }
       }
              else
              {
                     welcome.Visible=false;
              }
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值