基于ASP.NET的个人网站构建 第9页|论文
{
Artical.Visible=true;
Logout.Visible=true;
//
if (SqlAccess.UserRole=="普通用户")
{
ArticalAdd.Visible=true;
MyArtical.Visible=true;
ManageUserInfo.Visible=true;
ManageUser.Visible=false;
ManageArtical.Visible=false;
}
else
{
ArticalAdd.Visible=true;
ManageUser.Visible=true;
ManageArtical.Visible=true;
MyArtical.Visible=false;
ManageUserInfo.Visible=false;
}
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
4.3 文章管理代码
(1)、类中命名空间:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
(2)操作类代码:
namespace eBBS
{
public class ArticleShow : System.Web.UI.Page
{
protected System.Web.UI.WebControls.DataGrid datagrid1;
private void Page_Load(object sender, System.EventArgs e)
{
if (!Page.IsPostBack)
{
BindGrid();
}
}
void BindGrid()
youerw.com();
}
else
{
datagrid1.DataSource = myarticle.GetArticle();
}
datagrid1.DataBind();
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
}
}
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] 下一页