📄 personnote.aspx.cs
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
using Office.DAL;
using Office.Model;
using Office.BLL;
public partial class ScheduleManage_PersonNote : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
this.MyBind();
this.DataList1.RepeatColumns = 3;
}
}
//数据绑定
public void MyBind()
{
this.DataList1.DataSource = MyNoteManager.GetAllMyNotes();
this.DataList1.DataBind();
}
//ImageButton事件
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
Response.Redirect("AddPersonNote.aspx");
}
//自定义DataList显示日志信息
int count = 1;
protected void DataList1_ItemCreated(object sender, DataListItemEventArgs e)
{
LinkButton lk = new LinkButton();
IList<MyNote> tmp = MyNoteManager.GetAllMyNotes();
for(int i = 0 ; i < tmp.Count; i++)
{
if (count == i + 1)
{
lk.Text = tmp[i].NoteTitle;
if(tmp[i].NoteTitle.Length > 12)
{
lk.Text = tmp[i].NoteTitle.Substring(0, 12) + "...";
}
lk.PostBackUrl = "AddPersonNote.aspx?Nid=" + tmp[i].NoteId;
}
}
count++;
e.Item.Controls.Add(lk);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -