• 弗尤博客(二)


    今天实现游客和注册用户登录

     1 using System.Collections.Generic;
     2 using System.Linq;
     3 using System.Web;
     4 using System.Web.UI;
     5 using System.Web.UI.WebControls;
     6 using System.Data;
     7 using Business;
     8 using Entity;
     9 public partial class Main : System.Web.UI.MasterPage
    10 {
    11     protected void Page_Load(object sender, EventArgs e)
    12     {
    13         if (Session["uid"] == null)
    14         {
    15             Label1.Text = "游客";
    16             lb_blogs.Text = "";
    17             lb_log.Text = "登录";
    18             lb_logoff.Text = "";
    19             lb_registe.Text = "注册";
    20         }
    21         else
    22         {
    23             UserBusiness uname = new UserBusiness();
    24             UserEntity user = new UserEntity();
    25             user.Uid= Session["uid"].ToString();
    26             DataTable dt = new DataTable();
    27             dt = uname.FindUserInfo(user);
    28             DataList1.DataSource=dt;
    29             DataList1.DataBind();
    30             Label1.Text = "";
    31             lb_blogs.Text = "我的博客";
    32             lb_log.Text = "";
    33             lb_logoff.Text = "退出";
    34             lb_registe.Text = "";
    35         }
    36     }
    37 
    38     protected void lb_log_Click(object sender, EventArgs e)
    39     {
    40         Response.Redirect("UserLogin.aspx");
    41     }
    42 }
    View Code

  • 相关阅读:
    ie678兼容问题
    ie6/7中 zindex兼容问题
    mac svn 操作
    location.hash
    让 div 浮动到底端
    timeout问题
    让footer 自适应在底端
    js获取浏览器的高度
    ajax浏览器后退功能实现
    经典SQL语句大全(二)
  • 原文地址:https://www.cnblogs.com/frankybpx/p/10084202.html
Copyright © 2020-2023  润新知