newsList.aspx.cs
资源名称:yjal.rar [点击查看]
上传用户:shjujing
上传日期:2022-07-28
资源大小:11244k
文件大小:3k
源码类别:
Email客户端
开发平台:
Visual C++
- 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;
- public partial class newsList : System.Web.UI.Page
- {
- BaseClass bc = new BaseClass();
- string strStyle;
- protected void Page_Load(object sender, EventArgs e)
- {
- int n = Convert.ToInt16(Request.QueryString["id"]);
- switch (n)
- {
- case 1: strStyle = "时政要闻";
- Image1.ImageUrl = "~/image/seach/szyw.gif";
- Label1.Text = "新闻网络中心->时政要闻";
- break;
- case 2: strStyle = "经济动向";
- Image1.ImageUrl = "~/image/seach/jjdx.gif";
- Label1.Text = "新闻网络中心->经济动向";
- break;
- case 3: strStyle = "世界军事";
- Image1.ImageUrl = "~/image/seach/sjjs.gif";
- Label1.Text = "新闻网络中心->世界军事";
- break;
- case 4: strStyle = "科学教育";
- Image1.ImageUrl = "~/image/seach/kxjy.gif";
- Label1.Text = "新闻网络中心->科学教育";
- break;
- case 5: strStyle = "法治道德";
- Image1.ImageUrl = "~/image/seach/fzdd.gif";
- Label1.Text = "新闻网络中心->法治道德";
- break;
- case 6: strStyle = "社会现象";
- Image1.ImageUrl = "~/image/seach/shxx.gif";
- Label1.Text = "新闻网络中心->社会现象";
- break;
- case 7: strStyle = "体育世界";
- Image1.ImageUrl = "~/image/seach/tysj.gif";
- Label1.Text = "新闻网络中心->体育世界";
- break;
- case 8: strStyle = "时尚娱乐";
- Image1.ImageUrl = "~/image/seach/ssyl.gif";
- Label1.Text = "新闻网络中心->时尚娱乐";
- break;
- }
- DataList1.DataSource = bc.GetDataSet("select * from tbNews where style='" + strStyle + "'and issueDate='" + DateTime.Today.ToString() + "'", "tbNews");
- DataList1.DataKeyField = "id";
- DataList1.DataBind();
- }
- protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
- {
- string id = DataList1.DataKeys[e.Item.ItemIndex].ToString();
- Response.Write("<script language=javascript>window.open('showNews.aspx?id=" + id + "','','width=520,height=260')</script>");
- }
- }