📄 simplenews.ascx.cs
字号:
namespace qminoa.Webs.usercontrol
{
using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Configuration;
using qminoa.DA;
/// <summary>
/// simplenews 在首页面显示最新新闻标题。
/// </summary>
public abstract class simplenews : System.Web.UI.UserControl
{
protected System.Web.UI.WebControls.DataGrid DataGridnews;
protected System.Web.UI.WebControls.LinkButton LinkButton1;
static string path = ConfigurationSettings.AppSettings["ConnectionString"];
// newsdata mydataset = new newsdata(path);
//显示所有的新闻记录
private void Page_Load(object sender, System.EventArgs e)
{
// if(!this.IsPostBack )
// {
// //每次打开页面时自动更新新闻发布状态
// mydataset.updatedaynews ();
//
// //处理时间的格式为日期型
// DataTable dt = mydataset.GetfiveNewsData().Table;
// if( dt.Columns ["date"] == null)
// dt.Columns .Add ("date");
// foreach( DataRow thisRow in dt.Rows )
// {
// thisRow["date"] = (DateTime.Parse (thisRow["newsfirsttime"].ToString ())).ToShortDateString ();
// }
// DataView ds = dt.DefaultView ;
//
// DataGridnews.DataSource = ds;
// DataGridnews.DataBind ();
// }
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// 设计器支持所需的方法 - 不要使用
/// 代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.LinkButton1.Click += new System.EventHandler(this.LinkButton1_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
//导航到普通用户浏览页面
private void LinkButton1_Click(object sender, System.EventArgs e)
{
Response.Redirect ("morenewscus.aspx");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -